Adjust command hiding to use similar convention as hidden flags
plus breaking out "setup" portion of `App.Run` into its own method, cleaning up some bits of the help templates, and allowing for runtime opt-in of displaying template errors to stderr.
This commit is contained in:
@@ -136,10 +136,10 @@ func TestShowAppHelp_HiddenCommand(t *testing.T) {
|
||||
app.Run([]string{"app", "--help"})
|
||||
|
||||
if strings.Contains(output.String(), "secretfrob") {
|
||||
t.Fatalf("expected output to exclude \"secretfrob\"; got: %q", output.String())
|
||||
t.Errorf("expected output to exclude \"secretfrob\"; got: %q", output.String())
|
||||
}
|
||||
|
||||
if !strings.Contains(output.String(), "frobbly") {
|
||||
t.Fatalf("expected output to include \"frobbly\"; got: %q", output.String())
|
||||
t.Errorf("expected output to include \"frobbly\"; got: %q", output.String())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user