C ARGument Obtainer. Alternative command line parser to getopt.
Designed to be small and easy to drop into any program without much configuration.
cargo is license under the MIT License
Documentation is available at http://cargo.readthedocs.org/en/latest
It was generated using mkdocs and can be found under the docs/ directory.
If you'd rather learn by example see examples/
The recommended way to compile and run the tests is to use the CMake project on all platforms. This will also build libraries and the examples.
Both for Windows and Linux ###########################
$ mkdir build && cd build
$ cmake .. # Add -DCARGO_DEBUG=<level> for debugging output.
$ cmake --build . # You can use 'make' also, but not with Visual Studio.
$ ctest # Run the tests.
If you'd rather compile manually without using CMake, either simply add it to your own build system, or follow the steps below.
Simply drop into your project and compile, no configuration needed.
To compile the tests simply define CARGO_TEST
. For example using gcc
:
$ gcc -DCARGO_TEST=1 cargo.c
Or on Windows using the visual studio command line:
> cl.exe /DCARGO_TEST cargo.c