Sha256: 6f4ab69b5e25ad3ff0161b6d59b2dd0f8df742142f7f406d8b1b564e47b07ecb

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

require 'thor'
require 'uffizzi'

module Uffizzi
  class CLI < Thor
    require_relative 'cli/common'
    class_option :help, type: :boolean, aliases: ['-h', 'help']

    desc 'version', 'show version'
    def version
      require_relative 'version'
      Uffizzi.ui.say(Uffizzi::VERSION)
    end

    desc 'login', 'Login into Uffizzi'
    method_option :user, required: true, aliases: '-u'
    method_option :hostname, required: true
    def login
      require_relative 'cli/login'
      Login.new(options).run
    end

    desc 'logout', 'Logout from Uffizzi'
    def logout(help = nil)
      return Cli::Common.show_manual(:logout) if help || options[:help]

      require_relative 'cli/logout'
      Logout.new.run
    end

    desc 'project', 'project'
    require_relative 'cli/project'
    subcommand 'project', CLI::Project

    desc 'config', 'config'
    require_relative 'cli/config'
    subcommand 'config', CLI::Config

    desc 'preview', 'preview'
    method_option :project, required: false
    require_relative 'cli/preview'
    subcommand 'preview', CLI::Preview
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
uffizzi-cli-0.2.2 lib/uffizzi/cli.rb
uffizzi-cli-0.2.1 lib/uffizzi/cli.rb
uffizzi-cli-0.2.0 lib/uffizzi/cli.rb