Sha256: dfcaaf58d93156b4344e8173f7bc45842a9d9b2d817c17f8c94edbd789bc9ceb

Contents?: true

Size: 826 Bytes

Versions: 2

Compression:

Stored size: 826 Bytes

Contents

module Alf
  module Command
    class Help < Alf::Command()
      include Command
      
      # Let NoSuchCommandError be passed to higher stage
      no_react_to Quickl::NoSuchCommand
      
      options do |opt|
        @dialect = :shell
        opt.on('--lispy', 
               'Display operator signatures in lispy DSL') do
          @dialect = :lispy
        end
        opt.on('--shell', 
               'Display operator signatures in shell DSL') do
          @dialect = :shell
        end
      end

      # Command execution
      def execute(args)
        sup = Quickl.super_command(self)
        sub = (args.size != 1) ? sup : Quickl.sub_command!(sup, args.first)
        doc = sub.documentation(:method => @dialect)
        puts doc
      end
      
    end # class Help
  end # module Command
end # module Alf

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alf-0.10.1 lib/alf/command/help.rb
alf-0.10.0 lib/alf/command/help.rb