mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	replace the os.Stdout with stdout to adapt platform
Signed-off-by: Sun Gengze <690388648@qq.com>
This commit is contained in:
		
							parent
							
								
									135180bc4c
								
							
						
					
					
						commit
						1cb9b0745c
					
				
					 1 changed files with 6 additions and 6 deletions
				
			
		| 
						 | 
					@ -27,10 +27,10 @@ func main() {
 | 
				
			||||||
	flag.Merge(flag.CommandLine, clientFlags.FlagSet, commonFlags.FlagSet)
 | 
						flag.Merge(flag.CommandLine, clientFlags.FlagSet, commonFlags.FlagSet)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	flag.Usage = func() {
 | 
						flag.Usage = func() {
 | 
				
			||||||
		fmt.Fprint(os.Stdout, "Usage: docker [OPTIONS] COMMAND [arg...]\n"+daemonUsage+"       docker [ --help | -v | --version ]\n\n")
 | 
							fmt.Fprint(stdout, "Usage: docker [OPTIONS] COMMAND [arg...]\n"+daemonUsage+"       docker [ --help | -v | --version ]\n\n")
 | 
				
			||||||
		fmt.Fprint(os.Stdout, "A self-sufficient runtime for containers.\n\nOptions:\n")
 | 
							fmt.Fprint(stdout, "A self-sufficient runtime for containers.\n\nOptions:\n")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		flag.CommandLine.SetOutput(os.Stdout)
 | 
							flag.CommandLine.SetOutput(stdout)
 | 
				
			||||||
		flag.PrintDefaults()
 | 
							flag.PrintDefaults()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		help := "\nCommands:\n"
 | 
							help := "\nCommands:\n"
 | 
				
			||||||
| 
						 | 
					@ -40,7 +40,7 @@ func main() {
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		help += "\nRun 'docker COMMAND --help' for more information on a command."
 | 
							help += "\nRun 'docker COMMAND --help' for more information on a command."
 | 
				
			||||||
		fmt.Fprintf(os.Stdout, "%s\n", help)
 | 
							fmt.Fprintf(stdout, "%s\n", help)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	flag.Parse()
 | 
						flag.Parse()
 | 
				
			||||||
| 
						 | 
					@ -63,12 +63,12 @@ func main() {
 | 
				
			||||||
	if err := c.Run(flag.Args()...); err != nil {
 | 
						if err := c.Run(flag.Args()...); err != nil {
 | 
				
			||||||
		if sterr, ok := err.(cli.StatusError); ok {
 | 
							if sterr, ok := err.(cli.StatusError); ok {
 | 
				
			||||||
			if sterr.Status != "" {
 | 
								if sterr.Status != "" {
 | 
				
			||||||
				fmt.Fprintln(os.Stderr, sterr.Status)
 | 
									fmt.Fprintln(stderr, sterr.Status)
 | 
				
			||||||
				os.Exit(1)
 | 
									os.Exit(1)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			os.Exit(sterr.StatusCode)
 | 
								os.Exit(sterr.StatusCode)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		fmt.Fprintln(os.Stderr, err)
 | 
							fmt.Fprintln(stderr, err)
 | 
				
			||||||
		os.Exit(1)
 | 
							os.Exit(1)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue