Sha256: f485d59634dc4a94d0cf03ef486d3341de59fd9d5aaa9418cb8214cd4c59c473

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

require 'thor'
require 'open3'

require 'git_topic/commands/list'
require 'git_topic/commands/edit'
require 'git_topic/commands/show'

module GitTopic
  # CLI command entry point
  class Cli < Thor
    default_command :list

    desc 'list', 'Show managed topics'
    def list
      command = GitTopic::Commands::List.new
      command.execute
    end

    desc 'edit [branch_name]', 'Edit topic description'
    def edit(branch_name = nil)
      command = GitTopic::Commands::Edit.new branch_name
      command.execute
    end

    desc 'show [branch_name]', 'Show topic description'
    def show(branch_name = nil)
      command = GitTopic::Commands::Show.new branch_name
      command.execute
    end

    desc 'add topic_name', 'Remember topic'
    def add(topic_name)
      puts "add #{topic_name}"
      raise 'not implemented'
    end

    desc 'start topic_name', 'Transfer topic_name to branch to implement code'
    def start(topic_name)
      puts "start #{topic_name}"
      raise 'not implemented'
    end

    desc 'publish [branch_name]', 'Create pull request using branch description'
    def publish(branch_name)
      puts "publish #{branch_name}"
      raise 'not implemented'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
git_topic-0.1.0 lib/git_topic/cli.rb