1 Commits
Author SHA1 Message Date
clawbot a4f5d375b5 Read a path or URL named help or h as an argument (closes #198)
check / check (push) Canceled after 0s
On gen, check, freshen, fetch, list and export, a first argument of
`help` or `h` ran urfave/cli's built-in help command, so
`check help --require-signature FPR` printed help and passed. Those
commands now set urfave/cli's HideHelpCommand, which leaves out their
help command; the root keeps its own, so `mfer help` and
`mfer help check` still work. `check DIR --help` failed with
`No help topic for 'DIR'`; their CommandNotFound now prints the
command's own help, as `check --help` does.

Model: opus-5-5
2026-10-13 17:29:38 +00:00
+9 -14
View File
@@ -1860,24 +1860,20 @@ func TestCommandsReadHelpAsArgument(t *testing.T) {
} }
} }
// TestHelpBesideArgument runs each command that takes a path or URL with // TestCheckHelpBesideArgument runs check with --help or -h before and after
// --help or -h before and after a directory, and runs help on that command. // a directory, and runs help check. Each must print what check --help prints.
// Each must print what the command's own --help prints. func TestCheckHelpBesideArgument(t *testing.T) {
func TestHelpBesideArgument(t *testing.T) {
t.Parallel() t.Parallel()
for _, command := range []string{ want := testOpts([]string{testApp, cmdCheck, testFlagHelp}, afero.NewMemMapFs())
cmdGenerate, cmdCheck, cmdFreshen, cmdList, cmdExport, cmdFetch,
} {
want := testOpts([]string{testApp, command, testFlagHelp}, afero.NewMemMapFs())
require.Equal(t, 0, runCLI(want)) require.Equal(t, 0, runCLI(want))
require.Contains(t, testStdout(t, want), testApp+" "+command) require.Contains(t, testStdout(t, want), "Validate files using manifest file")
for _, args := range [][]string{ for _, args := range [][]string{
{command, testDir, testFlagHelp}, {cmdCheck, testDir, testFlagHelp},
{command, testFlagHelp, testDir}, {cmdCheck, testFlagHelp, testDir},
{command, testDir, "-h"}, {cmdCheck, testDir, "-h"},
{testCmdHelp, command}, {testCmdHelp, cmdCheck},
} { } {
t.Run(strings.Join(args, " "), func(t *testing.T) { t.Run(strings.Join(args, " "), func(t *testing.T) {
t.Parallel() t.Parallel()
@@ -1888,7 +1884,6 @@ func TestHelpBesideArgument(t *testing.T) {
}) })
} }
} }
}
func TestCheckDetectsManifestCorruption(t *testing.T) { func TestCheckDetectsManifestCorruption(t *testing.T) {
t.Parallel() t.Parallel()