Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: Update dependencies and fix issue with usage message #917

Merged
merged 3 commits into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions src/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ var (
)

func Execute() {
if err := setUpGlobals(); err != nil {
fmt.Fprintf(os.Stderr, "Error: %s\n", err)
os.Exit(1)
}

if err := rootCmd.Execute(); err != nil {
os.Exit(1)
}
Expand All @@ -75,6 +70,11 @@ func Execute() {
}

func init() {
if err := setUpGlobals(); err != nil {
fmt.Fprintf(os.Stderr, "Error: %s\n", err)
os.Exit(1)
}

persistentFlags := rootCmd.PersistentFlags()

persistentFlags.BoolVarP(&rootFlags.assumeYes,
Expand All @@ -96,7 +96,9 @@ func init() {
persistentFlags.CountVarP(&rootFlags.verbose, "verbose", "v", "Set log-level to 'debug'")

rootCmd.SetHelpFunc(rootHelp)
rootCmd.SetUsageFunc(rootUsage)

usageTemplate := fmt.Sprintf("Run '%s --help' for usage.", executableBase)
rootCmd.SetUsageTemplate(usageTemplate)
}

func preRun(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -188,12 +190,6 @@ func rootRun(cmd *cobra.Command, args []string) error {
return rootRunImpl(cmd, args)
}

func rootUsage(cmd *cobra.Command) error {
err := fmt.Errorf("Run '%s --help' for usage.", executableBase)
fmt.Fprintf(os.Stderr, "%s", err)
return err
}

func migrate() error {
logrus.Debug("Migrating to newer Podman")

Expand Down
31 changes: 20 additions & 11 deletions src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@ module github.com/containers/toolbox
go 1.13

require (
github.com/HarryMichal/go-version v1.0.0
github.com/acobaugh/osrelease v0.0.0-20181218015638-a93a0a55a249
github.com/briandowns/spinner v1.10.0
github.com/HarryMichal/go-version v1.0.1
HarryMichal marked this conversation as resolved.
Show resolved Hide resolved
github.com/acobaugh/osrelease v0.1.0
github.com/bketelsen/crypt v0.0.4 // indirect
github.com/briandowns/spinner v1.17.0
github.com/docker/go-units v0.4.0
github.com/fsnotify/fsnotify v1.4.7
github.com/godbus/dbus/v5 v5.0.3
github.com/mattn/go-isatty v0.0.8
github.com/sirupsen/logrus v1.4.2
github.com/spf13/cobra v0.0.5
github.com/spf13/viper v1.3.2
github.com/fatih/color v1.13.0 // indirect
github.com/fsnotify/fsnotify v1.5.1
github.com/godbus/dbus/v5 v5.0.6
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to highlight the changes in the indirect dependencies in the commit message. There are just too many of those and they keep coming and going. It's better to only highlight our direct dependencies in the commit message, unless there's one that we really need to be careful about.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough.

github.com/magiconair/properties v1.8.5 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/sirupsen/logrus v1.8.1
github.com/smartystreets/goconvey v1.6.4 // indirect
github.com/spf13/cobra v1.3.0
github.com/spf13/viper v1.10.1
github.com/stretchr/testify v1.7.0
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9
golang.org/x/sys v0.0.0-20190422165155-953cdadca894
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
)
Loading