-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cli): Migrate from alecthomas/kingpin to spf13/cobra.
This change migrates all of the current CLI code (and related tests) to now use cobra. All functionality should stay identical with the flags. The only changes present within the tests are the formatting of specific errors, and how they differ between kingpin/cobra. One potential breaking change that could impact users is that all `gunk help...` commands now print to stdout, even if invalid. This is not true for other errors, so it probably should not break any real world applications. This change can be linked back to spf13/cobra#1002.
- Loading branch information
Showing
10 changed files
with
330 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
gunk | ||
stderr '^usage: gunk \[' | ||
! stderr 'command not specified' | ||
! stdout . | ||
stdout 'Usage:\n gunk \[command\]' | ||
! stdout 'command not specified' | ||
! stderr . | ||
|
||
gunk version | ||
stdout '^gunk v0.*' | ||
! stderr . | ||
|
||
gunk -h | ||
stderr -count=1 '^usage: gunk \[' | ||
! stdout . | ||
stdout 'Usage:\n gunk \[command\]' | ||
! stderr . | ||
|
||
gunk --help | ||
stderr '^usage: gunk \[' | ||
! stdout . | ||
stdout 'Usage:\n gunk \[command\]' | ||
! stderr . | ||
|
||
gunk help | ||
stderr '^usage: gunk \[' | ||
! stdout . | ||
stdout 'Usage:\n gunk \[command\]' | ||
! stderr . | ||
|
||
gunk help generate | ||
stderr '^usage: gunk generate' | ||
! stdout . | ||
stdout 'Usage:\n gunk generate \[patterns\] \[flags\]' | ||
! stderr . | ||
|
||
! gunk help missing | ||
stderr 'expected command' | ||
gunk help missing | ||
stderr 'Unknown help topic \[`missing`\]' | ||
|
||
! gunk missing | ||
stderr 'expected command' | ||
stderr 'unknown command "missing"' | ||
|
||
gunk generate -h | ||
stderr '^usage: gunk generate' | ||
! stdout . | ||
stdout 'Usage:\n gunk generate \[patterns\] \[flags\]' | ||
! stderr . | ||
|
||
gunk generate --help | ||
stderr '^usage: gunk generate' | ||
! stdout . | ||
stdout 'Usage:\n gunk generate \[patterns\] \[flags\]' | ||
! stderr . | ||
|
||
! gunk generate --missing | ||
stderr 'unknown long flag' | ||
stderr 'unknown flag: --missing' | ||
! stdout . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters