Class: Kettle::Family::CLI
- Inherits:
-
CommandKit::Command
- Object
- CommandKit::Command
- Kettle::Family::CLI
show all
- Includes:
- CommandKit::Commands, ReturningMain
- Defined in:
- lib/kettle/family/cli.rb
Defined Under Namespace
Modules: CommitOptions, ExecutionOptions, ReturningMain, SelectionOptions, SharedOptions, WorkflowOptions
Classes: AddChangelog, BaseCommand, Bex, BranchLanes, Bump, BumpVersion, Bup, Bupb, Check, CleanUnreleased, Discover, Docs, GhaShaPins, Install, Lint, Metadata, Plan, Pull, Push, Release, ReleaseState, ReportCommand, Reset, StartAt, State, Sync, Template, Test, Up, WorkflowCommand
Constant Summary
collapse
- COMMANDS =
%w[discover plan report metadata check clean-unreleased reset test lint docs template gha-sha-pins bup bupb bex install bump bump-version add-changelog release push pull sync up branch-lanes release-state state].freeze
- WORKFLOW_COMMANDS =
%w[check reset test lint docs template gha-sha-pins bup bupb bex release push pull sync up].freeze
Class Method Summary
collapse
Instance Method Summary
collapse
#main
Class Method Details
.call(argv, out: $stdout, err: $stderr) ⇒ Object
25
26
27
|
# File 'lib/kettle/family/cli.rb', line 25
def self.call(argv, out: $stdout, err: $stderr)
main(argv, stdout: out, stderr: err)
end
|
Instance Method Details
#on_unknown_command(name, _argv = []) ⇒ Object
563
564
565
566
|
# File 'lib/kettle/family/cli.rb', line 563
def on_unknown_command(name, _argv = [])
stderr.puts("kettle-family: unknown command #{name.inspect}")
1
end
|
#run(command = nil, *argv) ⇒ Object
556
557
558
559
560
561
|
# File 'lib/kettle/family/cli.rb', line 556
def run(command = nil, *argv)
return invoke(command, *argv) if command
help
0
end
|
#run_command(command, options) ⇒ Object
568
569
570
571
572
573
574
575
576
|
# File 'lib/kettle/family/cli.rb', line 568
def run_command(command, options)
report = build_report(command, options)
write_report(report, options)
stdout.puts(options[:json] ? report.to_json : report.to_text)
report.success? ? 0 : 1
rescue Error, OptionParser::ParseError => error
stderr.puts("kettle-family: #{error.message}")
1
end
|