feat: accept --global on :report subcommands

Every `:report` subcommand now recognizes `--global` as a scope selector that limits the report to globally-configured properties, including in JSON form via `--global --format json`. Previously this combination was rejected because `--global` was treated as an info flag, conflicting with `--format`. The shared `common.ParseReportArgs` helper now returns a `ReportArgs` struct exposing the parsed scope; each Go and bash report selects a global-only flag map when scope is global, and skips per-app verification.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-04-29 10:30:59 -04:00
1 parent ec70e10c5d
commit 8282981361
61 files changed
+1379 -518

No files matched your search

+12 -5
View File
@@ -8,13 +8,20 @@ import (
// ReportSingleApp is an internal function that displays the ports report for one or more apps
func ReportSingleApp(appName string, format string, infoFlag string) error {
if err := common.VerifyAppName(appName); err != nil {
return err
if appName != "--global" {
if err := common.VerifyAppName(appName); err != nil {
return err
}
}
flags := map[string]common.ReportFunc{
"--ports-map": reportPortMap,
"--ports-map-detected": reportPortMapDetected,
var flags map[string]common.ReportFunc
if appName == "--global" {
flags = map[string]common.ReportFunc{}
} else {
flags = map[string]common.ReportFunc{
"--ports-map": reportPortMap,
"--ports-map-detected": reportPortMapDetected,
}
}
flagKeys := []string{}