Sha256: 947fa1764ebf7e40c58bf812a56e7a50d89eaeced7df2cdcd175aa92dc5e3302

Contents?: true

Size: 827 Bytes

Versions: 12

Compression:

Stored size: 827 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", "--new-project", "newproject"
        Cello::Commands::NewProject.run
        exit 0
      when "-nP", "--new-page", "newpage"
        Cello::Commands::NewPage.run
        exit 0
      when "-d", "--debug", "debug"
        Cello::Commands::Debug.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

12 entries across 12 versions & 1 rubygems

Version Path
cello-0.0.35 lib/cello/commands/main.rb
cello-0.0.34 lib/cello/commands/main.rb
cello-0.0.33 lib/cello/commands/main.rb
cello-0.0.32 lib/cello/commands/main.rb
cello-0.0.31 lib/cello/commands/main.rb
cello-0.0.30 lib/cello/commands/main.rb
cello-0.0.29 lib/cello/commands/main.rb
cello-0.0.28 lib/cello/commands/main.rb
cello-0.0.27 lib/cello/commands/main.rb
cello-0.0.26 lib/cello/commands/main.rb
cello-0.0.25 lib/cello/commands/main.rb
cello-0.0.23 lib/cello/commands/main.rb