Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit a87c583

Browse files
authored
Merge pull request #1058 from ndeloof/version
Parse --version and forward to docker/cli
2 parents 99de963 + 7a2e041 commit a87c583

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cli/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ func main() {
147147

148148
root.PersistentFlags().BoolVarP(&opts.Debug, "debug", "D", false, "Enable debug output in the logs")
149149
root.PersistentFlags().StringVarP(&opts.Host, "host", "H", "", "Daemon socket(s) to connect to")
150-
opts.AddConfigFlags(root.PersistentFlags())
151150
opts.AddContextFlags(root.PersistentFlags())
151+
opts.AddConfigFlags(root.PersistentFlags())
152152
root.Flags().BoolVarP(&opts.Version, "version", "v", false, "Print version information and quit")
153153

154154
walk(root, func(c *cobra.Command) {
@@ -157,6 +157,7 @@ func main() {
157157

158158
// populate the opts with the global flags
159159
_ = root.PersistentFlags().Parse(os.Args[1:])
160+
_ = root.Flags().Parse(os.Args[1:])
160161
if opts.Debug {
161162
logrus.SetLevel(logrus.DebugLevel)
162163
}

0 commit comments

Comments
 (0)