Sha256: 93f290210ed83a492c7863050aa0497b02d6e4af3ddb734c738a7c914439ab4d

Contents?: true

Size: 896 Bytes

Versions: 2

Compression:

Stored size: 896 Bytes

Contents

module Pione
  module Command
    # PioneCommand is a facade command for PIONE's various functions.
    class PioneCommand < BasicCommand
      # subcommand table
      @subcommand = {}

      class << self
        attr_reader :subcommand

        # Add the subcommand.
        def add_subcommand(name, command)
          @subcommand[name] = command
        end
      end

      #
      # basic informations
      #

      option_parser_mode :order!
      command_name "pione"
      command_banner "PIONE is a rule-based workflow engine."

      #
      # options
      #

      #
      # command lifecycle: execution phase
      #

      execute :subcommand

      def execute_subcommand
        name = @argv.first
        if cmd = self.class.subcommand[name]
          cmd.run(@argv.drop(1))
        else
          abort("no such subcommand: %s" % name)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pione-0.3.2 lib/pione/command/pione-command.rb
pione-0.3.1 lib/pione/command/pione-command.rb