Skip to content

Commit

Permalink
Updated README and demo/main.c files
Browse files Browse the repository at this point in the history
  • Loading branch information
vstan02 committed Apr 4, 2021
1 parent 98d1f4f commit 3e97981
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ CnxCli* cli = cnx_cli_init(app);
cnx_cli_add(cli, 4, (CnxOption[]) {
{ "-a, --about", "Display something", about_option, (void*)app.name },

// handlers for "-v, --version" and "-h, --help" options are
// added by default, but you can add your own handlers for them
// Handlers for "-v, --version" and "-h, --help" options are
// added by default, but you can add your own handlers for them.
{ "-v, --version", "Display version", version_option, &app },

// "--default" - handler for this option is called when are no arguments passed
// Handler for "--default" option is called when are no arguments passed.
{ "--default", "Default option", index_option, (void*)app.name },

// "*" - handler for this option is called when is passed an unknown cli option
// Handler for "*" this option is called when is passed an unknown cli option.
// By default it has the same handler as the "-h, --help" option.
{ "*", NULL, not_found_option, (void*)app.name }
});

Expand Down
9 changes: 5 additions & 4 deletions demo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ int main(int argc, const char** argv) {
cnx_cli_add(cli, 4, (CnxOption[]) {
{ "-a, --about", "Display something", about_option, (void*)app.name },

// handlers for "-v, --version" and "-h, --help" options are
// added by default, but you can add your own handlers for them
// Handlers for "-v, --version" and "-h, --help" options are
// added by default, but you can add your own handlers for them.
{ "-v, --version", "Display version", version_option, &app },

// "--default" - handler for this option is called when is no arguments passed
// Handler for "--default" option is called when are no arguments passed
{ "--default", "Default option", index_option, (void*)app.name },

// "*" - handler for this option is called when is passed an invalid cli option
// Handler for "*" this option is called when is passed an unknown cli option.
// By default it has the same handler as the "-h, --help" option.
{ "*", NULL, not_found_option, (void*)app.name }
});

Expand Down

0 comments on commit 3e97981

Please sign in to comment.