Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse-options hidden options #52

Open
brandon1024 opened this issue Jan 11, 2020 · 0 comments
Open

parse-options hidden options #52

brandon1024 opened this issue Jan 11, 2020 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@brandon1024
Copy link
Owner

brandon1024 commented Jan 11, 2020

Right now, there's no way to define an option that won't be shown in the standard show_usage_with_options() output. This would be particularly useful to be able to do if you wanted to add options that were aliases for other options. For example:

USAGE("git chat import-key ((-f | --fingerprint) <id>) [--gpg-home <path>] ")
...
OPT_LONG_STRING("gpg-home", "path", "path to the gpg home directory", &gpg_home_dir),
OPT_STRING('f', "fingerprint", "id", "id of the public key to import", &fingerprint),
+ OPT_HIDDEN(0, "fpr", OPTION_STRING_T, &fingerprint),
OPT_STRING('k', "key", "path", "path to exported public key file", &key_path),
OPT_BOOL('h', "help", "show usage and exit", &show_help),
OPT_END()

This OPT_HIDDEN macro could have the following signature:
#define OPT_HIDDEN(S,L,T,V) { (S), (L), NULL, NULL, OPTION_HIDDEN_T | (T), (V) }

Since str_name and desc won't be needed, null is fine.

@brandon1024 brandon1024 added enhancement New feature or request good first issue Good for newcomers labels Jan 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant