mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-10-31 12:58:14 +00:00 
			
		
		
		
	- The tools directory ideally should not contain source code - Removes double vendoring of packagages - Makes it easer to hook the build into the top-level Makefile Eventually, the plugin should be moved to the infrakit repo. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
		
			
				
	
	
		
			27 lines
		
	
	
		
			482 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			482 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| // +build windows
 | |
| 
 | |
| package cobra
 | |
| 
 | |
| import (
 | |
| 	"os"
 | |
| 	"time"
 | |
| 
 | |
| 	"github.com/inconshreveable/mousetrap"
 | |
| )
 | |
| 
 | |
| var preExecHookFn = preExecHook
 | |
| 
 | |
| // enables an information splash screen on Windows if the CLI is started from explorer.exe.
 | |
| var MousetrapHelpText string = `This is a command line tool
 | |
| 
 | |
| You need to open cmd.exe and run it from there.
 | |
| `
 | |
| 
 | |
| func preExecHook(c *Command) {
 | |
| 	if mousetrap.StartedByExplorer() {
 | |
| 		c.Print(MousetrapHelpText)
 | |
| 		time.Sleep(5 * time.Second)
 | |
| 		os.Exit(1)
 | |
| 	}
 | |
| }
 |