Sha256: d00c4f71b8640697a6cf811c571c1deb5f87caea7471852e6db1277ce0fc3760

Contents?: true

Size: 1.46 KB

Versions: 2

Compression:

Stored size: 1.46 KB

Contents

require 'thor'
require_relative 'ggsm/version'
require_relative 'ggsm/flow/start'
require_relative 'ggsm/flow/update'
require_relative 'ggsm/flow/sync'
require_relative 'ggsm/flow/switch'
require_relative 'ggsm/flow/delete'
require_relative 'ggsm/flow/foreach'
require_relative 'ggsm/flow/finish'

module GGSM
  class Cli < Thor
    include Start
    include Update
    include Sync
    include Switch
    include Delete
    include Foreach
    include Finish

    desc 'start <branch> [<commit>] [<origin>]', 'Start to develop new feature'
    def start(branch, action='')
      start_flow(branch, action)
    end

    desc 'switch <branch>', 'Switch to branch <branch>'
    def switch(branch)
      switch_flow(branch)
    end

    desc 'update', 'Update submodule'
    def update
      update_flow
    end

    desc 'sync', 'Sync remote app and submodules'
    def sync
      sync_flow
    end

    desc 'delete <branch> [-r|--remote] [-a|--all]', 'Delete <branch>'
    option :remote, :default => false, :type => :boolean, aliases: '-r'
    option :all, :default => false, :type => :boolean, aliases: '-a'
    def delete(branch)
      remote = options[:remote]
      all = options[:all]
      delete_flow(branch, remote, all)
    end

    desc 'foreach [<commands>...]', 'Executes the git command in each module'
    def foreach(*commands)
      foreach_flow(*commands)
    end

    desc 'finish <branch>', 'Finish the feature'
    def finish(branch)
      finish_flow(branch)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ggsm-1.0.2 lib/ggsm.rb
ggsm-1.0.1 lib/ggsm.rb