Sha256: 969211788c941944b845e8ba325cf661b38f92dbbaae6f28ad8e892a4181288a
Contents?: true
Size: 675 Bytes
Versions: 1
Compression:
Stored size: 675 Bytes
Contents
class CLIForge::DefaultConfiguration < CLIForge::Configuration def initialize super with_help_command with_implicit_help_flags end private # Help is one of those global commands that pretty much everyone wants def with_help_command register_command :help, CLIForge::EmbeddedCommands::Help.new(self) end # Passing a help flag to any command results in us calling the help command. def with_implicit_help_flags register_argument_filter(:help_flags) { |arguments| new_arguments = arguments - ["--help", "-h", "/?"] new_arguments.unshift("help") if new_arguments.length != arguments.length new_arguments } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cli-forge-0.1.0 | lib/cli_forge/default_configuration.rb |