File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ package  app
2+ 
3+ import  (
4+ 	"github.com/mintoolkit/mint/pkg/app/master/signals" 
5+ 	"github.com/stretchr/testify/require" 
6+ 	"testing" 
7+ )
8+ 
9+ func  TestCLI (t  * testing.T ) {
10+ 	signals .InitHandlers ()
11+ 	cli  :=  newCLI ()
12+ 
13+ 	runArgs  :=  [][]string {
14+ 		{"mint" , "--version" },
15+ 		{"mint" , "-v" },
16+ 		{"mint" , "help" },
17+ 		{"mint" , "-h" },
18+ 	}
19+ 	for  _ , args  :=  range  runArgs  {
20+ 		require .NoError (t , cli .Run (args ))
21+ 	}
22+ }
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ const (
3838	FlagCRTIOInactivityTimeout    =  "crt-io-inactivity-timeout" 
3939	FlagCRTSaveInactivityTimeout  =  "crt-save-inactivity-timeout" 
4040	FlagCRTCopyInactivityTimeout  =  "crt-copy-inactivity-timeout" 
41+ 	FlagHelp                      =  "help" 
4142)
4243
4344const  (
@@ -71,6 +72,7 @@ const (
7172	FlagCRTIOInactivityTimeoutUsage    =  "CRT I/O general inactivity timeout" 
7273	FlagCRTSaveInactivityTimeoutUsage  =  "CRT save image operation inactivity timeout (overrides the general I/O timeout)" 
7374	FlagCRTCopyInactivityTimeoutUsage  =  "CRT copy from container operation inactivity timeout (overrides the general I/O timeout)" 
75+ 	FlagHelpUsage                      =  "Show help info" 
7476)
7577
7678// Shared command flag names 
@@ -433,6 +435,11 @@ func GlobalFlags() []cli.Flag {
433435			Usage :   FlagCRTCopyInactivityTimeoutUsage ,
434436			EnvVars : []string {"DSLIM_CRT_COPY_INACTIVITY_TIMEOUT" },
435437		},
438+ 		& cli.BoolFlag {
439+ 			Name :    FlagHelp ,
440+ 			Aliases : []string {"h" },
441+ 			Usage :   FlagHelpUsage ,
442+ 		},
436443		& cli.StringFlag {
437444			Name :  FlagStatePath ,
438445			Value : "" ,
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments