Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions pkg/app/master/cli_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package app

import (
"github.com/mintoolkit/mint/pkg/app/master/signals"
"github.com/stretchr/testify/require"
"testing"
)

func TestCLI(t *testing.T) {
signals.InitHandlers()
cli := newCLI()

runArgs := [][]string{
{"mint", "--version"},
{"mint", "-v"},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test covers -h but not --help, which is the primary behavior change described in the PR. Also, -v is the built-in alias for --version in urfave/cli, so it doesn’t validate --verbose behavior.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

{"mint", "help"},
{"mint", "-h"},
}
for _, args := range runArgs {
require.NoError(t, cli.Run(args))
}
}
7 changes: 7 additions & 0 deletions pkg/app/master/command/cliflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const (
FlagCRTIOInactivityTimeout = "crt-io-inactivity-timeout"
FlagCRTSaveInactivityTimeout = "crt-save-inactivity-timeout"
FlagCRTCopyInactivityTimeout = "crt-copy-inactivity-timeout"
FlagHelp = "help"
)

const (
Expand Down Expand Up @@ -71,6 +72,7 @@ const (
FlagCRTIOInactivityTimeoutUsage = "CRT I/O general inactivity timeout"
FlagCRTSaveInactivityTimeoutUsage = "CRT save image operation inactivity timeout (overrides the general I/O timeout)"
FlagCRTCopyInactivityTimeoutUsage = "CRT copy from container operation inactivity timeout (overrides the general I/O timeout)"
FlagHelpUsage = "Show help info"
)

// Shared command flag names
Expand Down Expand Up @@ -433,6 +435,11 @@ func GlobalFlags() []cli.Flag {
Usage: FlagCRTCopyInactivityTimeoutUsage,
EnvVars: []string{"DSLIM_CRT_COPY_INACTIVITY_TIMEOUT"},
},
&cli.BoolFlag{
Name: FlagHelp,
Aliases: []string{"h"},
Usage: FlagHelpUsage,
},
&cli.StringFlag{
Name: FlagStatePath,
Value: "",
Expand Down
Loading