Class: SyncIssues::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/sync_issues/command.rb

Overview

Provides the command line interface to SyncIssues

Constant Summary collapse

DOC =
"sync_issues: A tool that synchronizes a local directory with GitHub issues.\n\nUsage:\n  sync_issues [options] DIRECTORY REPOSITORY...\n  sync_issues -h | --help\n  sync_issues --version\n\nOptions:\n  -h --help       Output this help information.\n  -u --update     Only update existing issues.\n  --labels FILE   A yaml file listing labels that are to be available.\n  --no-assignees  Do not synchronize assignees.\n  --no-labels     Do not synchronize labels.\n  --reset-labels  Reset labels on a per-issue basis.\n  --version       Output the sync_issues version (\#{VERSION}).\n"

Instance Method Summary collapse

Constructor Details

#initializeCommand

Returns a new instance of Command.



28
29
30
# File 'lib/sync_issues/command.rb', line 28

def initialize
  @exit_status = 0
end

Instance Method Details

#runObject



32
33
34
35
36
37
38
39
40
41
# File 'lib/sync_issues/command.rb', line 32

def run
  handle_args(Docopt.docopt(DOC, version: VERSION))
rescue Docopt::Exit => exc
  exit_with_status(exc.message, exc.class.usage != '')
rescue TokenError => exc
  exit_with_status("#{exc.message}\nPlease see:
    https://github.com/bboe/sync_issues#sync_issuesyaml-configuration")
rescue Error, Octokit::Unauthorized => exc
  exit_with_status(exc.message)
end