Class: HunkReviewChanges::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/hunk_review_changes/cli.rb

Overview

Command-line entry point. Two commands:

hunk-review-changes <bundle.json> [--port N] [--no-open]   serve the review UI
hunk-review-changes install [--agent ...] [--marketplace-repo ...]

serve is the default, so a bare bundle path just works (that is how the skill launches it).

Defined Under Namespace

Classes: Error

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.start(argv) ⇒ Object



20
21
22
23
24
25
# File 'lib/hunk_review_changes/cli.rb', line 20

def self.start(argv)
  new.run(argv)
rescue Bundle::Error, Error, OptionParser::ParseError => e
  warn "hunk-review-changes: #{e.message}"
  1
end

Instance Method Details

#run(argv) ⇒ Object



27
28
29
30
31
32
33
34
35
# File 'lib/hunk_review_changes/cli.rb', line 27

def run(argv)
  argv = argv.dup
  case argv.first
  when "install" then install(argv.drop(1))
  when "-v", "--version" then print_version
  when "-h", "--help", nil then print_help
  else serve(argv)
  end
end