class CmdParse::VersionCommand
The default version command.
It adds the options “-v” and “–version” to the CommandParser#main_options
but this can be changed in ::new
.
When the command is specified on the command line (or one of the above mentioned options), it shows the version of the program configured by the settings
-
command_parser.main_options.program_name
-
command_parser.main_options.version
Public Class Methods
new(add_switches: true)
click to toggle source
Create a new version command.
Options:
- add_switches
-
Specifies whether the '-v' and '–version' switches should be added to the
CommandParser#main_options
Calls superclass method
CmdParse::Command::new
# File lib/cmdparse.rb 718 def initialize(add_switches: true) 719 super('version', takes_commands: false) 720 short_desc("Show the version of the program") 721 @add_switches = add_switches 722 end