Module: Hashira::CLI::Usage

Defined in:
lib/hashira/cli/usage.rb

Constant Summary collapse

TEXT =
<<~HELP
  Usage: hashira [DIRECTORY ...] [options]

  Package coupling metrics for Ruby, via Prism. With no directory,
  auto-detects lib/<gem>.

  Options:
    --format FORMAT      text (default), json, dot, or mermaid
    --json               shorthand for --format json
    --fail-on KINDS      exit 1 if findings exist; comma-separated
                         kinds: cycles, sdp
    --ratchet            fail when edges appear that the baseline lacks
    --update-baseline    write the current edge set as the baseline
    --baseline PATH      baseline file (default: hashira_baseline.json)
    -h, --help           print this help
    --version            print the version

  Findings accepted by design can be recorded in the baseline as
    "accepted": [{"kind": "...", "package": "...", "reason": "..."}]
  — they leave reports and gates, keeping a one-line reminder each.
HELP

Class Method Summary collapse

Class Method Details

.emit(output) ⇒ Object



34
35
36
37
# File 'lib/hashira/cli/usage.rb', line 34

def emit(output)
  puts output
  0
end

.helpObject



30
# File 'lib/hashira/cli/usage.rb', line 30

def help = emit(TEXT)

.versionObject



32
# File 'lib/hashira/cli/usage.rb', line 32

def version = emit("hashira #{VERSION}")