Add help testcase for envprefix + no env.
This commit is contained in:
committed by
Alec Thomas
parent
ea18c73f11
commit
5090305bcb
+3
-1
@@ -463,7 +463,8 @@ func TestEnvarAutoHelp(t *testing.T) {
|
||||
|
||||
func TestEnvarAutoHelpWithEnvPrefix(t *testing.T) {
|
||||
type Anonymous struct {
|
||||
Flag string `env:"FLAG" help:"A flag."`
|
||||
Flag string `env:"FLAG" help:"A flag."`
|
||||
Other string `help:"A different flag."`
|
||||
}
|
||||
var cli struct {
|
||||
Anonymous `envprefix:"ANON_"`
|
||||
@@ -473,6 +474,7 @@ func TestEnvarAutoHelpWithEnvPrefix(t *testing.T) {
|
||||
_, err := p.Parse([]string{"--help"})
|
||||
require.NoError(t, err)
|
||||
require.Contains(t, w.String(), "A flag ($ANON_FLAG).")
|
||||
require.Contains(t, w.String(), "A different flag.")
|
||||
}
|
||||
|
||||
func TestCustomHelpFormatter(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user