-
Notifications
You must be signed in to change notification settings - Fork 8
Adding Commonly Used Options
mosop edited this page Dec 11, 2016
·
4 revisions
The Options.help method adds the -h and --help options to your command. These options can be used to print a help message.
class Command < Cli::Command
class Options
help # equivalent to on(%w(-h --help)) { command.help! }
end
endYou can change the option's name:
class Command < Cli::Command
class Options
help "--show-help"
end
endThe Options.version method adds the -v and --version options to your command. These options can be used to print a version string.
class Command < Cli::Command
class Options
version # equivalent to on(%w(-v --version)) { command.version! }
end
endYou can change the option's name:
class Command < Cli::Command
class Options
version "--show-version"
end
end