Class: SyncIssues::Command
- Inherits:
-
Object
- Object
- SyncIssues::Command
- 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
-
#initialize ⇒ Command
constructor
A new instance of Command.
- #run ⇒ Object
Constructor Details
#initialize ⇒ Command
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
#run ⇒ Object
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., 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:: => exc exit_with_status(exc.) end |