class Archive::Tar::Minitar::Command::CommandHelp

Public Instance Methods

call(args, opts = {}, ioe = {}) click to toggle source
    # File lib/archive/tar/minitar/command.rb
312     def call(args, opts = {}, ioe = {})
313       ioe = CommandPattern.default_ioe(ioe)
314 
315       help_on = args.shift
316 
317       if CommandPattern.command?(help_on)
318         ioe[:output] << CommandPattern[help_on].help
319       elsif help_on == "commands"
320         ioe[:output] << <<-EOH
321 The commands known to minitar are:
322 
323     minitar create          Creates a new tarfile.
324     minitar extract         Extracts files from a tarfile.
325     minitar list            Lists files in the tarfile.
326 
327 All commands accept the options --verbose and --progress, which are
328 mutually exclusive. In "minitar list", --progress means the same as
329 --verbose.
330 
331   --verbose, -V     Performs the requested command verbosely.
332   --progress, -P    Shows a progress bar, if appropriate, for the action
333                     being performed.
334 
335         EOH
336       else
337         ioe[:output] << "Unknown command: #{help_on}\n" unless help_on.nil? or help_on.empty?
338         ioe[:output] << self.help
339       end
340 
341       0
342     end
help() click to toggle source
    # File lib/archive/tar/minitar/command.rb
344     def help
345       help = <<-EOH
346 This is a basic help message containing pointers to more information on
347 how to use this command-line tool. Try:
348 
349     minitar help commands       list all 'minitar' commands
350     minitar help <COMMAND>      show help on <COMMAND>
351                                   (e.g., 'minitar help create')
352       EOH
353     end
name() click to toggle source
    # File lib/archive/tar/minitar/command.rb
308 def name
309   "help"
310 end