Skip to content

Commit 842fa25

Browse files
committed
cmd/cue: hide the --strict global flag
Showing it to the user with a deprecated note seems odd; it's better to hide the flag entirely. We keep the deprecated text around for now because we will likely use it in the near future to make the flag give such a warning or error. The upcoming release notes will also make a mention of this. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I5d0690fb588d8fda44601ec194e0ae5525924a95 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1201708 Reviewed-by: Roger Peppe <[email protected]> Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent 2221b7f commit 842fa25

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

cmd/cue/cmd/flags.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,16 @@ func addGlobalFlags(f *pflag.FlagSet) {
7878
"simplify output")
7979
f.BoolP(string(flagIgnore), "i", false,
8080
"proceed in the presence of errors")
81-
f.Bool(string(flagStrict), false,
82-
"report errors for lossy mappings (deprecated: use \"jsonschema+strict:\" filetype instead; see cue help filetypes)")
8381
f.BoolP(string(flagVerbose), "v", false,
8482
"print information about progress")
8583
f.BoolP(string(flagAllErrors), "E", false, "print all available errors")
8684

85+
// Deprecated flags are hidden but still work for now.
86+
// TODO(mvdan): make this flag give a warning or error in early 2025.
87+
f.Bool(string(flagStrict), false,
88+
"report errors for lossy mappings (deprecated: use \"jsonschema+strict:\" filetype instead; see cue help filetypes)")
89+
f.MarkHidden(string(flagStrict))
90+
8791
f.String(string(flagCpuProfile), "", "write a CPU profile to the specified file before exiting")
8892
f.MarkHidden(string(flagCpuProfile))
8993
f.String(string(flagMemProfile), "", "write an allocation profile to the specified file before exiting")

cmd/cue/cmd/testdata/script/help_cmd.txtar

-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ Global Flags:
167167
-E, --all-errors print all available errors
168168
-i, --ignore proceed in the presence of errors
169169
-s, --simplify simplify output
170-
--strict report errors for lossy mappings (deprecated: use "jsonschema+strict:" filetype instead; see cue help filetypes)
171170
--trace trace computation
172171
-v, --verbose print information about progress
173172

@@ -182,6 +181,5 @@ Global Flags:
182181
-E, --all-errors print all available errors
183182
-i, --ignore proceed in the presence of errors
184183
-s, --simplify simplify output
185-
--strict report errors for lossy mappings (deprecated: use "jsonschema+strict:" filetype instead; see cue help filetypes)
186184
--trace trace computation
187185
-v, --verbose print information about progress

cmd/cue/cmd/testdata/script/help_cmd_flags.txtar

-1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,5 @@ Global Flags:
145145
-E, --all-errors print all available errors
146146
-i, --ignore proceed in the presence of errors
147147
-s, --simplify simplify output
148-
--strict report errors for lossy mappings (deprecated: use "jsonschema+strict:" filetype instead; see cue help filetypes)
149148
--trace trace computation
150149
-v, --verbose print information about progress

0 commit comments

Comments
 (0)