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 (
38
38
FlagCRTIOInactivityTimeout = "crt-io-inactivity-timeout"
39
39
FlagCRTSaveInactivityTimeout = "crt-save-inactivity-timeout"
40
40
FlagCRTCopyInactivityTimeout = "crt-copy-inactivity-timeout"
41
+ FlagHelp = "help"
41
42
)
42
43
43
44
const (
@@ -71,6 +72,7 @@ const (
71
72
FlagCRTIOInactivityTimeoutUsage = "CRT I/O general inactivity timeout"
72
73
FlagCRTSaveInactivityTimeoutUsage = "CRT save image operation inactivity timeout (overrides the general I/O timeout)"
73
74
FlagCRTCopyInactivityTimeoutUsage = "CRT copy from container operation inactivity timeout (overrides the general I/O timeout)"
75
+ FlagHelpUsage = "Show help info"
74
76
)
75
77
76
78
// Shared command flag names
@@ -433,6 +435,11 @@ func GlobalFlags() []cli.Flag {
433
435
Usage : FlagCRTCopyInactivityTimeoutUsage ,
434
436
EnvVars : []string {"DSLIM_CRT_COPY_INACTIVITY_TIMEOUT" },
435
437
},
438
+ & cli.BoolFlag {
439
+ Name : FlagHelp ,
440
+ Aliases : []string {"h" },
441
+ Usage : FlagHelpUsage ,
442
+ },
436
443
& cli.StringFlag {
437
444
Name : FlagStatePath ,
438
445
Value : "" ,
You can’t perform that action at this time.
0 commit comments