fix(hermes): This moves one existing conditional out of runMain, reducing its cognitive complexity below the threshold. The helper receives the identical args[2:] slice, calls the same command, logs the same error text, and returns the same status codes. (incident sonar/ananke/go:S3776/AZ-IckhO1fRfbdzqD-5r)
This commit is contained in:
parent
76876ef895
commit
d469688408
@ -66,10 +66,7 @@ func runMain(logger *log.Logger, args []string) int {
|
||||
return 1
|
||||
}
|
||||
case "intent":
|
||||
if err := intentCommand(logger, args[2:]); err != nil {
|
||||
logger.Printf("intent failed: %v", err)
|
||||
return 1
|
||||
}
|
||||
return runIntentCommand(logger, args[2:])
|
||||
case "help", "-h", "--help":
|
||||
usage()
|
||||
default:
|
||||
@ -80,6 +77,14 @@ func runMain(logger *log.Logger, args []string) int {
|
||||
return 0
|
||||
}
|
||||
|
||||
func runIntentCommand(logger *log.Logger, args []string) int {
|
||||
if err := intentCommand(logger, args); err != nil {
|
||||
logger.Printf("intent failed: %v", err)
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// usage runs one orchestration or CLI step.
|
||||
// Signature: usage().
|
||||
// Why: keeps behavior explicit so startup/shutdown workflows remain maintainable as services evolve.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user