mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 03:38:03 +01:00
Recognize "--help" as valid global option
This commit is contained in:
@@ -52,7 +52,7 @@ func parseArgs(args []string) (string, []string) {
|
||||
command = args[0]
|
||||
args = args[1:]
|
||||
|
||||
if command == "-h" {
|
||||
if command == "-h" || command == "--help" {
|
||||
command = "help"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ func TestCLI_Run(t *testing.T) {
|
||||
}{
|
||||
{[]string{}, 1, helpCmd},
|
||||
{[]string{"-h"}, 0, helpCmd},
|
||||
{[]string{"--help"}, 0, helpCmd},
|
||||
{[]string{"wow", "-v"}, 0, verCmd},
|
||||
{[]string{"version"}, 0, verCmd},
|
||||
{[]string{"foo"}, 0, fooCmd},
|
||||
|
||||
Reference in New Issue
Block a user