From 93d20114a78193c21b5dda3b154f320f769e1787 Mon Sep 17 00:00:00 2001 From: Danny Hermes Date: Thu, 20 Aug 2020 20:28:45 -0500 Subject: [PATCH] Adding `SilenceUsage` on root command. This way usage won't be displayed on errors. H/T: https://github.com/spf13/cobra/issues/340 --- command/root.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/command/root.go b/command/root.go index 5c0aca9..f1f717f 100644 --- a/command/root.go +++ b/command/root.go @@ -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}