diff options
| author | Daniel Pittman <daniel@puppetlabs.com> | 2011-06-01 10:34:22 -0700 |
|---|---|---|
| committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-06-01 10:34:22 -0700 |
| commit | 3f47b0cce4436aa638e0b914ff8ab1c9fbf67552 (patch) | |
| tree | d4927739a0f581973673215dcf2b8be611658594 /lib/puppet/util | |
| parent | db25a02490efcafab6822d8e83a36df35a4afc01 (diff) | |
| download | puppet-3f47b0cce4436aa638e0b914ff8ab1c9fbf67552.tar.gz puppet-3f47b0cce4436aa638e0b914ff8ab1c9fbf67552.tar.xz puppet-3f47b0cce4436aa638e0b914ff8ab1c9fbf67552.zip | |
(#7717) Layout cleanup for subcommand extraction.
This transforms the layout of the code, to make it easier to work with, but
makes no functional changes. Done separately to make clearer the functional
changes vs the non-functional changes.
Diffstat (limited to 'lib/puppet/util')
| -rw-r--r-- | lib/puppet/util/command_line.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/puppet/util/command_line.rb b/lib/puppet/util/command_line.rb index 8190f8ac1..c475dacc4 100644 --- a/lib/puppet/util/command_line.rb +++ b/lib/puppet/util/command_line.rb @@ -93,13 +93,19 @@ module Puppet if zero == 'puppet' case argv.first - when nil; [ stdin.tty? ? nil : "apply", argv] # ttys get usage info - when "--help", "-h"; [nil, argv] # help should give you usage, not the help for `puppet apply` - when /^-|\.pp$|\.rb$/; ["apply", argv] - else [ argv.first, argv[1..-1] ] + when nil then + # ttys get usage info + [stdin.tty? ? nil : "apply", argv] + when "--help", "-h" then + # help should give you usage, not the help for `puppet apply` + [nil, argv] + when /^-|\.pp$|\.rb$/ then + ["apply", argv] + else + [argv.first, argv[1..-1]] end else - [ zero, argv ] + [zero, argv] end end |
