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:
@@ -16,6 +16,41 @@ teardown() {
|
||||
global_teardown
|
||||
}
|
||||
|
||||
@test "(checks:report) --global --format json" {
|
||||
run /bin/bash -c "dokku checks:set --global wait-to-retire 90"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku checks:report --global --format json | jq -e ."
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku checks:report --global --format json | jq -r '.\"global-wait-to-retire\"'"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output "90"
|
||||
|
||||
run /bin/bash -c "dokku checks:report --global --format json | jq -r 'has(\"wait-to-retire\")'"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
run /bin/bash -c "dokku checks:report --global"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output_contains "global checks information"
|
||||
|
||||
run /bin/bash -c "dokku checks:set --global wait-to-retire"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(checks) checks:help" {
|
||||
run /bin/bash -c "dokku checks"
|
||||
echo "output: $output"
|
||||
|
||||
Reference in New Issue
Block a user