Module: Archive::Tar::Minitar::Command
- Defined in:
- lib/gems/archive-tar-minitar-0.5.2/lib/archive/tar/minitar/command.rb
Defined Under Namespace
Classes: CommandCreate, CommandExtract, CommandHelp, CommandList, CommandPattern, ProgressBar
Class Method Summary collapse
-
.run(argv, input = $stdin, output = $stdout, error = $stderr) ⇒ Object
CommandPattern << CommandDelete.
Class Method Details
.run(argv, input = $stdin, output = $stdout, error = $stderr) ⇒ Object
CommandPattern << CommandDelete
779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 |
# File 'lib/gems/archive-tar-minitar-0.5.2/lib/archive/tar/minitar/command.rb', line 779 def self.run(argv, input = $stdin, output = $stdout, error = $stderr) ioe = { :input => input, :output => output, :error => error, } opts = { } if argv.include?("--version") output << "minitar \#{Archive::Tar::Minitar::VERSION}\nCopyright 2004 Mauricio Julio Ferna'ndez Pradier and Austin Ziegler\nThis is free software with ABSOLUTELY NO WARRANTY.\n\nsee http://rubyforge.org/projects/ruwiki for more information\n EOB\n end\n\n if argv.include?(\"--verbose\") or argv.include?(\"-V\")\n opts[:verbose] = true\n argv.delete(\"--verbose\")\n argv.delete(\"-V\")\n end\n\n if argv.include?(\"--progress\") or argv.include?(\"-P\")\n opts[:progress] = true\n opts[:verbose] = false\n argv.delete(\"--progress\")\n argv.delete(\"-P\")\n end\n\n command = CommandPattern[(argv.shift or \"\").downcase]\n command ||= CommandPattern[\"help\"]\n return command[argv, opts, ioe]\nend\n" |