cclip
C/C++ Command Line Interface Parser
cclip
is a simple C/C++ library for parsing command line arguments. It allows you to define and parse command-line options and arguments easily in your C or C++ applications.
Installation
Github Clone
Github Submodule
Build
Build using cmake
Usage
Example
Here is an example of how to use the cclip
library to parse command-line arguments in a C++ program:
options_manager
Class
options_manager
ClassThe options_manager
class is the core of the cclip
library. It allows you to define and parse command-line options. Here are some of its key functions:
options_manager::add_option
: Add a new option with a short name, long name, description, and properties.options_manager::parse
: Parse the command line arguments.options_manager::print_help
: Print the help message.options_manager::get_help
: Get the help message as a C-style string. Remember to delete the returned string when you're done with it.options_manager::is_present
: Check if an option is present in the arguments.options_manager::get_option
: Get an option by name.
option
Struct
option
StructThe option
struct represents an individual command-line option. It contains the following fields:
short_name
: The short name of the option (e.g. -h).long_name
: The long name of the option (e.g. --help).description
: The description of the option.is_required
: Whether or not the option is required.has_argument
: Whether or not the option has an argument.argument
: The argument of the option.
Contributing
If you'd like to contribute to the cclip
library, please feel free to submit issues, pull requests, or suggestions on GitHub.
License
This project is licensed under the GNU GENERAL PUBLIC LICENSE V3 - see the LICENSE file for details.
Last updated
Was this helpful?