Skip to content

Commit

Permalink
Fix the -h lab option
Browse files Browse the repository at this point in the history
The help describes -h as a valid option:

  Flags:
    -h, --help      help for lab

But using it fails with:

  $ lab -h
  unknown option: -h

Fix this.

Signed-off-by: Antoine Tenart <atenart@kernel.org>
  • Loading branch information
atenart authored and prarit committed Jan 21, 2021
1 parent 4241954 commit 7c2c165
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func Execute() {
if cmd.Use == RootCmd.Use && len(os.Args) > 1 {
var knownFlag bool
for _, v := range os.Args {
if v == "--help" || v == "--version" {
if v == "-h" || v == "--help" || v == "--version" {
knownFlag = true
}
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func skipInit() bool {
switch os.Args[1] {
case "--version", "version":
return true
case "--help", "help":
case "-h", "--help", "help":
return true
case "completion":
return true
Expand Down

0 comments on commit 7c2c165

Please sign in to comment.