Skip to content

Commit

Permalink
Adding SilenceUsage on root command.
Browse files Browse the repository at this point in the history
This way usage won't be displayed on errors.

H/T: spf13/cobra#340
  • Loading branch information
Danny Hermes committed Aug 21, 2020
1 parent 502fa5a commit 93d2011
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ func MakeRootCommand(migrations *golembic.Migrations) (*cobra.Command, error) {
}

cmd := &cobra.Command{
Use: "golembic",
Short: "Manage database migrations for Go codebases",
Use: "golembic",
Short: "Manage database migrations for Go codebases",
SilenceUsage: true,
}

manager := &golembic.Manager{Sequence: migrations}
Expand Down

0 comments on commit 93d2011

Please sign in to comment.