diff --git a/README b/README index 621baf4..5b02558 100644 --- a/README +++ b/README @@ -1,27 +1,21 @@ cppipe - C Plus Pipe ==================== -cppipe is a utility that allows you to use C++ programs as scripts. +cppipe is a utility that allows you to use C/C++ programs as scripts. it also offers a shell like syntax for seamless command execution In this way your scripts can benefit from increased control and speed, while maintaining a lot of the potential for simple command call syntax. -Webpage -------- -https://vene.volconst.com/en/cppipe - Installation ------------ git clone https://gitlab.com/venelin98/cppipe.git cd cppipe sudo ./install.sh -How to write a cppipe program ------------------------------ -Just include - -How to execute a cppipe program -------------------------------- -cppipe my_cppipe_program.cpp ${ANY_ARGUMENTS_FOR_YOUR_PROGRAM} - +How to execute a C/C++ source file +---------------------------------- +cppipe PATH_TO_SRC [ARGUMENTS_FOR_YOUR_PROGRAM]... +Webpage +------- +https://vene.volconst.com/en/cppipe diff --git a/src/cppipe.cpp b/src/cppipe.cpp index dc9119d..bf2ef9c 100644 --- a/src/cppipe.cpp +++ b/src/cppipe.cpp @@ -36,8 +36,8 @@ struct MappedFile // todo: move to utils // process the args until the src file arg is found, return its index int parse_args_until_src(int argc, char* argv[]); -// find the cpp to run, if it doesn't exist, exit program -fs::path find_path_to_cpp(string_view src_file); +// find the source file to run, if it doesn't exist, exit program +fs::path find_path_to_src(string_view src_file); // find the path of the cache for the given src_file path fs::path get_cache_dir_path(const fs::path& src_file); @@ -72,7 +72,7 @@ int main(int argc, char* argv[]) int src_arg = parse_args_until_src(argc, argv); // Init context - src_file = find_path_to_cpp( argv[src_arg] ); + src_file = find_path_to_src( argv[src_arg] ); src_type = find_src_type( argv[src_arg] ); cache_dir = get_cache_dir_path(src_file); bin = cache_dir / (debug ? DEBUG_PREFIX : "") += src_file.filename(); @@ -112,7 +112,7 @@ int parse_args_until_src(int argc, char* argv[]) if( arg == "--help" ) { print_usage(); - cout << "Compile and run C++ source CPP_FILE that uses the cppipe library.\n" + cout << "Compile and run C/C++ source FILE.\n" "Pass the ARGUMENTS to the compiled binary.\n" "The binaries are cached and recompiled only if the source or it's headers have changed.\n" "-g debug the binary, asserts are also enabled\n"; @@ -139,7 +139,7 @@ int parse_args_until_src(int argc, char* argv[]) return src_arg; } -fs::path find_path_to_cpp(string_view src_file) +fs::path find_path_to_src(string_view src_file) { if(fs::exists(src_file)) // found relative to CWD { @@ -172,7 +172,7 @@ fs::path find_path_to_cpp(string_view src_file) } } - // Couln't find the cpp + // Couln't find the src cerr << "File: " << src_file << " doesn't exist\n"; exit(1); } @@ -315,7 +315,7 @@ void compile_src_file() void print_usage() { - cout << "Usage: cppipe [-g] CPP_FILE [ARGUMENTS]...\n"; + cout << "Usage: cppipe [-g] FILE [ARGUMENTS]...\n"; } SrcType find_src_type(const string_view p)