Skip to content

Commit 6bcf515

Browse files
author
Shlomi Noach
authored
Merge pull request #351 from github/check-flag
cli: --check-flag
2 parents d21bd3f + 9dd8d85 commit 6bcf515

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

go/cmd/gh-ost/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,13 @@ func main() {
115115
stack := flag.Bool("stack", false, "add stack trace upon error")
116116
help := flag.Bool("help", false, "Display usage")
117117
version := flag.Bool("version", false, "Print version & exit")
118+
checkFlag := flag.Bool("check-flag", false, "Check if another flag exists/supported. This allows for cross-version scripting. Exits with 0 when all additional provided flags exist, nonzero otherwise. You must provide (dummy) values for flags that require a value. Example: gh-ost --check-flag --cut-over-lock-timeout-seconds --nice-ratio 0")
119+
118120
flag.Parse()
119121

122+
if *checkFlag {
123+
return
124+
}
120125
if *help {
121126
fmt.Fprintf(os.Stderr, "Usage of gh-ost:\n")
122127
flag.PrintDefaults()

0 commit comments

Comments
 (0)