Sha256: e5155f8b707f5849acf7eadf9020710bc6c6e209407b0f0bea4b8b494d148e89

Contents?: true

Size: 601 Bytes

Versions: 4

Compression:

Stored size: 601 Bytes

Contents

module MagicReveal
  class Cli
    class Options
      attr_accessor(
        :command,
        :project,
      )

      def program_name
        @program_name ||= File.basename($0)
      end

      def parse args
        case args.first
        when 'new'
          if args.length != 2
            @command = :help
          else
            @command = :new
            @project = args[1]
          end
        when 'start'
          @command = :start
        when 'static'
          @command = :static
        else # including help
          @command = :help
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
magic_reveal-2.4.0.5 lib/magic_reveal/cli/options.rb
magic_reveal-2.4.0.4 lib/magic_reveal/cli/options.rb
magic_reveal-2.4.0.3 lib/magic_reveal/cli/options.rb
magic_reveal-2.4.0.2 lib/magic_reveal/cli/options.rb