Sha256: f4732189aca2023a13dc2aaea01326fdc25fbe4ce319401a5de666c0723cfe1f

Contents?: true

Size: 650 Bytes

Versions: 1

Compression:

Stored size: 650 Bytes

Contents

class Cello::Commands::Main

  class << self

    def run(args=ARGV)
      cmd = args.shift

      case cmd
      when "-h", "--help", NilClass
        Cello::Commands::Help.run
        exit 0
      when "-v", "--version", "version"
        Cello::Commands::Version.run
        exit 0
      when "-np", "--create-project", "newproject"
        Cello::Commands::CreatePage.run
        exit 0
      end

      unless system("cello #{cmd}", *args)
        if $?.exitstatus == 127 # bash 'command not found'
          puts "Unknown subcommand #{cmd.inspect}"
          Cello::Commands::Help.run
          exit 127
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cello-0.0.21 lib/cello/commands/main.rb