fix "cscli" without arguments (#1406)
This commit is contained in:
parent
cea793fc3a
commit
b202e387cf
2 changed files with 8 additions and 1 deletions
|
@ -153,7 +153,7 @@ It is meant to allow you to manage bans, parsers/scenarios/etc, api and generall
|
|||
log.Fatalf("failed to make branch hidden : %s", err)
|
||||
}
|
||||
|
||||
if os.Args[1] != "completion" {
|
||||
if len(os.Args) > 1 && os.Args[1] != "completion" {
|
||||
cobra.OnInitialize(initConfig)
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,13 @@ declare stderr
|
|||
|
||||
#----------
|
||||
|
||||
@test "$FILE cscli - usage" {
|
||||
run -0 cscli
|
||||
assert_output --partial "Usage:"
|
||||
assert_output --partial "cscli [command]"
|
||||
assert_output --partial "Available Commands:"
|
||||
}
|
||||
|
||||
@test "$FILE cscli version" {
|
||||
run -0 cscli version
|
||||
assert_output --partial "version:"
|
||||
|
|
Loading…
Reference in a new issue