Skip to content

Instantly share code, notes, and snippets.

@pgroves
Created October 11, 2012 18:53
Show Gist options
  • Save pgroves/3874687 to your computer and use it in GitHub Desktop.
Save pgroves/3874687 to your computer and use it in GitHub Desktop.
Generated Help printout for cliawesome demo app (navelgazer)
NavelGazer
Synopsis
navelgazer {-v|-q} {-f <filename>} {-h} {-gt} {-t|-o} {-b}
Description
This awesome demo prints out the values of it's arguments. Below are the individual options.
Options
'+' indicates option can be set in config file.
_________
+ Verbosity
How much info to print during execution
-v, --verbose
Print full config report on init, plus other info
-q, --quiet
Print errors only
____________________
Config File Location
The name of a config file to use other than the default
-f <filename>,
--config-file <filename>
__________
Print Help
-h, --help
Prints this help message
____________________
Generate Config File
-gt, --generate-config
Generates an example config file and places it at ./navelgazer.yml
_______________
+ Switch Option A
This is a pretty cool example of an option that can be one of several values. If more than one is
specified, the last one is used.
-t, --case-two
This explains how case 2 of Switch A works
-o, --case-one
This explains how case 1 of Switch A works
_______________
Switch Option B
This is a pretty cool example of an option that can be be present, or not
-b, --switch-b
This explains what happens when switchB is set. Also, this one is commandline only (can't be
set in config file)
Config File
The config file used will be the first instance of navelgazer.yml found when ascending the directories of
the local machine's filesytem, starting at the directory this command is run from.
Use --generate-config to create a template config file at './navelgazer.yml'.
Config File Only Options
These options can only be set through a config file.
______________
Value Option C
The long form documetation of option C. Notice that this is set in the config file only. It also
expects two values. The generated config file will have valid defaults set by the developer that you
can just uncomment out.
-/end help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment