[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Daniel Pittman daniel at puppetlabs.com
Tue May 10 08:13:21 UTC 2011


The following commit has been merged in the experimental branch:
commit d13a938b0abc604a7802cf41ff75a30ad6ccd192
Author: Daniel Pittman <daniel at puppetlabs.com>
Date:   Mon Apr 11 10:46:08 2011 -0700

    (#6962) Initial support for legacy applications in help.
    
    We now enumerate and print the list of legacy applications in the unadorned
    help action; this allows us a path to migrating forward smoothly while still
    providing a good user experience.
    
    Paired-With: Matt Robinson <matt at puppetlabs.com>

diff --git a/lib/puppet/faces/help.rb b/lib/puppet/faces/help.rb
index 229a0dc..c284433 100644
--- a/lib/puppet/faces/help.rb
+++ b/lib/puppet/faces/help.rb
@@ -1,6 +1,9 @@
 require 'puppet/faces'
+require 'puppet/util/command_line'
 
 Puppet::Faces.define(:help, '0.0.1') do
+  HelpSummaryFormat = '  %-18s  %s'
+
   summary "Displays help about puppet subcommands"
 
   action(:help) do
@@ -30,7 +33,18 @@ Puppet::Faces.define(:help, '0.0.1') do
         message << "Available subcommands, from Puppet Faces:"
         Puppet::Faces.faces.sort.each do |name|
           face = Puppet::Faces[name, :current]
-          message << format("  %-15s %s", face.name, face.summary)
+          message << format(HelpSummaryFormat, face.name, face.summary)
+        end
+
+        legacy = Puppet::Util::CommandLine.available_subcommands.reject do |appname|
+          Puppet::Faces.face? appname.to_sym, :current
+        end
+        unless legacy.empty? then # great victory when this is true!
+          message << ""
+          message << "Available applications, soon to be ported to Faces:"
+          legacy.sort.each do |appname|
+            message << format(HelpSummaryFormat, appname, 'REVISIT: how to summarize these?')
+          end
         end
       else
         face = Puppet::Faces[args[0].to_sym, version]
diff --git a/spec/unit/faces/help_spec.rb b/spec/unit/faces/help_spec.rb
index ad553dc..87ff679 100644
--- a/spec/unit/faces/help_spec.rb
+++ b/spec/unit/faces/help_spec.rb
@@ -61,5 +61,9 @@ describe Puppet::Faces[:help, '0.0.1'] do
       it { should have_matching_element %r{ #{name} } }
       it { should have_matching_element %r{ #{name} +#{summary}} } if summary
     end
+
+    Puppet::Util::CommandLine.available_subcommands do |name|
+      it { should have_matching_element %r{ #{name} } }
+    end
   end
 end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list