Class: Minitar::CLI::Command::Help
- Inherits:
-
Minitar::CLI::Command
- Object
- Minitar::CLI::Command
- Minitar::CLI::Command::Help
- Defined in:
- lib/minitar/cli/command/help.rb
Overview
Help command. This will be replaced in a future version by one of the better-executed CLI application frameworks like GLI, after Ruby 1.8 and 1.9 support have been dropped.
Constant Summary collapse
- COMMANDS =
"The commands known to minitar are:\n\n minitar create Creates a new tarfile.\n minitar extract Extracts files from a tarfile.\n minitar list Lists files in the tarfile.\n\nAll commands accept the options --verbose and --progress, which are\nmutually exclusive. In \"minitar list\", --progress means the same as\n--verbose.\n\n--verbose, -V Performs the requested command verbosely.\n--progress, -P Shows a progress bar, if appropriate, for the action\n being performed.\n\n"- BASIC =
"This is a basic help message containing pointers to more information on\nhow to use this command-line tool. Try:\n\n minitar help commands list all 'minitar' commands\n minitar help <COMMAND> show help on <COMMAND>\n (e.g., 'minitar help create')\n"
Instance Method Summary collapse
Instance Method Details
#call(args, _opts = {}) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/minitar/cli/command/help.rb', line 37 def call(args, _opts = {}) help_on = args.shift if commander.command?(help_on) ioe[:output] << commander[help_on].help elsif help_on == "commands" ioe[:output] << COMMANDS else unless help_on.nil? || help_on.empty? ioe[:output] << "Unknown command: #{help_on}\n" end ioe[:output] << help end 0 end |
#help ⇒ Object
54 55 56 |
# File 'lib/minitar/cli/command/help.rb', line 54 def help BASIC end |
#name ⇒ Object
7 8 9 |
# File 'lib/minitar/cli/command/help.rb', line 7 def name "help" end |