diff options
author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-11 22:04:28 -0700 |
---|---|---|
committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-12 16:12:09 -0700 |
commit | fe6d59528d18e9aa989f48d364868a5a105017a5 (patch) | |
tree | 92a26221cdd038a7adeb21311534cca290599470 /lib/puppet | |
parent | acbbd52e0e876afa62f9c6098f0f40504b993dce (diff) | |
download | puppet-fe6d59528d18e9aa989f48d364868a5a105017a5.tar.gz puppet-fe6d59528d18e9aa989f48d364868a5a105017a5.tar.xz puppet-fe6d59528d18e9aa989f48d364868a5a105017a5.zip |
(#6962) Integrate legacy subcommands into the help face.
Previously we would only emit help for a face; now we fully integrate legacy
subcommands in the sense that asking for face-level help will emit their
entire help text.
Asking for any action subsequent will raise an error: this is an annoyingly
inconsistent behaviour, but there isn't a saner definition of the change.
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/faces/help.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/puppet/faces/help.rb b/lib/puppet/faces/help.rb index 29a4a62f7..1d8abe20e 100644 --- a/lib/puppet/faces/help.rb +++ b/lib/puppet/faces/help.rb @@ -35,8 +35,16 @@ Puppet::Faces.define(:help, '0.0.1') do # Name those parameters... facename, actionname = args - face = facename ? Puppet::Faces[facename.to_sym, version] : nil - action = (face and actionname) ? face.get_action(actionname.to_sym) : nil + + if facename then + if legacy_applications.include? facename then + actionname and raise ArgumentError, "Legacy subcommands don't take actions" + return Puppet::Application[facename].help + else + face = Puppet::Faces[facename.to_sym, version] + actionname and action = face.get_action(actionname.to_sym) + end + end case args.length when 0 then |