From 9d578c0ff66b621815c32bc73727448fed1d265c Mon Sep 17 00:00:00 2001 From: horockey Date: Tue, 6 Aug 2024 17:39:31 +0300 Subject: [PATCH 01/19] feat: multiformat flag --- flag_timestamp.go | 61 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/flag_timestamp.go b/flag_timestamp.go index d008080c1a..f56e847fa8 100644 --- a/flag_timestamp.go +++ b/flag_timestamp.go @@ -9,16 +9,16 @@ type TimestampFlag = FlagBase[time.Time, TimestampConfig, timestampValue] // TimestampConfig defines the config for timestamp flags type TimestampConfig struct { - Timezone *time.Location - Layout string + Timezone *time.Location + AvailableLayouts []string } // timestampValue wrap to satisfy golang's flag interface. type timestampValue struct { - timestamp *time.Time - hasBeenSet bool - layout string - location *time.Location + timestamp *time.Time + hasBeenSet bool + availableLayouts []string + location *time.Location } var _ ValueCreator[time.Time, TimestampConfig] = timestampValue{} @@ -28,9 +28,9 @@ var _ ValueCreator[time.Time, TimestampConfig] = timestampValue{} func (t timestampValue) Create(val time.Time, p *time.Time, c TimestampConfig) Value { *p = val return ×tampValue{ - timestamp: p, - layout: c.Layout, - location: c.Timezone, + timestamp: p, + availableLayouts: c.AvailableLayouts, + location: c.Timezone, } } @@ -53,16 +53,51 @@ func (t *timestampValue) Set(value string) error { var timestamp time.Time var err error - if t.location != nil { - timestamp, err = time.ParseInLocation(t.layout, value, t.location) - } else { - timestamp, err = time.Parse(t.layout, value) + if t.location == nil { + t.location = time.Local + } + + for _, layout := range t.availableLayouts { + var locErr error + + timestamp, locErr = time.ParseInLocation(layout, value, t.location) + // TODO: replace with errors.Join() after upgrading to go 1.20 or newer + // OR use external error wrapping, if acceptable + if locErr != nil { + if err == nil { + err = locErr + continue + } + + err = fmt.Errorf("%v\n%v", err, locErr) + continue + } + + err = nil + break } if err != nil { return err } + defaultTs, _ := time.ParseInLocation(time.TimeOnly, time.TimeOnly, timestamp.Location()) + + // If format is missing date, set it explicitly to current + if timestamp.Truncate(time.Hour*24).UnixNano() == defaultTs.Truncate(time.Hour*24).UnixNano() { + n := time.Now() + timestamp = time.Date( + n.Year(), + n.Month(), + n.Day(), + timestamp.Hour(), + timestamp.Minute(), + timestamp.Second(), + timestamp.Nanosecond(), + timestamp.Location(), + ) + } + if t.timestamp != nil { *t.timestamp = timestamp } From 568c9c58b2f776f35d9a0e60086d3e0f5eaf1bcc Mon Sep 17 00:00:00 2001 From: horockey Date: Tue, 6 Aug 2024 17:39:49 +0300 Subject: [PATCH 02/19] test: fix old tests + miltiformat test --- args_test.go | 2 +- command_test.go | 2 +- flag_test.go | 56 ++++++++++++++++++++++++++++++++++++------------- 3 files changed, 44 insertions(+), 16 deletions(-) diff --git a/args_test.go b/args_test.go index 7b0a727216..f1f16189e7 100644 --- a/args_test.go +++ b/args_test.go @@ -68,7 +68,7 @@ func TestArgumentsSubcommand(t *testing.T) { Max: 1, Destination: &tval, Config: TimestampConfig{ - Layout: time.RFC3339, + AvailableLayouts: []string{time.RFC3339}, }, }, &StringArg{ diff --git a/command_test.go b/command_test.go index 6a38816046..3b241f85a5 100644 --- a/command_test.go +++ b/command_test.go @@ -2738,7 +2738,7 @@ func TestFlagAction(t *testing.T) { &TimestampFlag{ Name: "f_timestamp", Config: TimestampConfig{ - Layout: "2006-01-02 15:04:05", + AvailableLayouts: []string{time.DateTime}, }, Action: func(_ context.Context, cmd *Command, v time.Time) error { if v.IsZero() { diff --git a/flag_test.go b/flag_test.go index 052115c332..de5c232b80 100644 --- a/flag_test.go +++ b/flag_test.go @@ -2257,25 +2257,25 @@ func TestStringMap_Serialized_Set(t *testing.T) { func TestTimestamp_set(t *testing.T) { ts := timestampValue{ - timestamp: nil, - hasBeenSet: false, - layout: "Jan 2, 2006 at 3:04pm (MST)", + timestamp: nil, + hasBeenSet: false, + availableLayouts: []string{"Jan 2, 2006 at 3:04pm (MST)"}, } time1 := "Feb 3, 2013 at 7:54pm (PST)" - require.NoError(t, ts.Set(time1), "Failed to parse time %s with layout %s", time1, ts.layout) + require.NoError(t, ts.Set(time1), "Failed to parse time %s with layouts %v", time1, ts.availableLayouts) require.True(t, ts.hasBeenSet, "hasBeenSet is not true after setting a time") ts.hasBeenSet = false - ts.layout = time.RFC3339 + ts.availableLayouts = []string{time.RFC3339} time2 := "2006-01-02T15:04:05Z" - require.NoError(t, ts.Set(time2), "Failed to parse time %s with layout %s", time2, ts.layout) + require.NoError(t, ts.Set(time2), "Failed to parse time %s with layout %v", time2, ts.availableLayouts) require.True(t, ts.hasBeenSet, "hasBeenSet is not true after setting a time") } -func TestTimestampFlagApply(t *testing.T) { +func TestTimestampFlagApply_SingleFormat(t *testing.T) { expectedResult, _ := time.Parse(time.RFC3339, "2006-01-02T15:04:05Z") - fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{Layout: time.RFC3339}} + fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{AvailableLayouts: []string{time.RFC3339}}} set := flag.NewFlagSet("test", 0) _ = fl.Apply(set) @@ -2284,9 +2284,37 @@ func TestTimestampFlagApply(t *testing.T) { assert.Equal(t, expectedResult, set.Lookup("time").Value.(flag.Getter).Get()) } +func TestTimestampFlagApply_MultipleFormats(t *testing.T) { + fl := TimestampFlag{ + Name: "time", + Aliases: []string{"t"}, + Config: TimestampConfig{ + Timezone: time.Local, + AvailableLayouts: []string{ + time.DateTime, + time.TimeOnly, + time.Kitchen, + }, + }, + } + set := flag.NewFlagSet("test", 0) + _ = fl.Apply(set) + + now := time.Now() + for timeStr, expectedRes := range map[string]time.Time{ + now.Format(time.DateTime): now.Truncate(time.Second), + now.Format(time.TimeOnly): now.Truncate(time.Second), + now.Format(time.Kitchen): now.Truncate(time.Minute), + } { + err := set.Parse([]string{"--time", timeStr}) + assert.NoError(t, err) + assert.Equal(t, expectedRes, set.Lookup("time").Value.(flag.Getter).Get()) + } +} + func TestTimestampFlagApplyValue(t *testing.T) { expectedResult, _ := time.Parse(time.RFC3339, "2006-01-02T15:04:05Z") - fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{Layout: time.RFC3339}, Value: expectedResult} + fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{AvailableLayouts: []string{time.RFC3339}}, Value: expectedResult} set := flag.NewFlagSet("test", 0) _ = fl.Apply(set) @@ -2296,7 +2324,7 @@ func TestTimestampFlagApplyValue(t *testing.T) { } func TestTimestampFlagApply_Fail_Parse_Wrong_Layout(t *testing.T) { - fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{Layout: "randomlayout"}} + fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{AvailableLayouts: []string{"randomlayout"}}} set := flag.NewFlagSet("test", 0) set.SetOutput(io.Discard) _ = fl.Apply(set) @@ -2306,7 +2334,7 @@ func TestTimestampFlagApply_Fail_Parse_Wrong_Layout(t *testing.T) { } func TestTimestampFlagApply_Fail_Parse_Wrong_Time(t *testing.T) { - fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{Layout: "Jan 2, 2006 at 3:04pm (MST)"}} + fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{AvailableLayouts: []string{"Jan 2, 2006 at 3:04pm (MST)"}}} set := flag.NewFlagSet("test", 0) set.SetOutput(io.Discard) _ = fl.Apply(set) @@ -2318,7 +2346,7 @@ func TestTimestampFlagApply_Fail_Parse_Wrong_Time(t *testing.T) { func TestTimestampFlagApply_Timezoned(t *testing.T) { pdt := time.FixedZone("PDT", -7*60*60) expectedResult, _ := time.Parse(time.RFC3339, "2006-01-02T15:04:05Z") - fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{Layout: time.ANSIC, Timezone: pdt}} + fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{AvailableLayouts: []string{time.ANSIC}, Timezone: pdt}} set := flag.NewFlagSet("test", 0) _ = fl.Apply(set) @@ -2519,7 +2547,7 @@ func TestFlagDefaultValueWithEnv(t *testing.T) { }, { name: "timestamp", - flag: &TimestampFlag{Name: "flag", Value: ts, Config: TimestampConfig{Layout: time.RFC3339}, Sources: EnvVars("tflag")}, + flag: &TimestampFlag{Name: "flag", Value: ts, Config: TimestampConfig{AvailableLayouts: []string{time.RFC3339}}, Sources: EnvVars("tflag")}, toParse: []string{"--flag", "2006-11-02T15:04:05Z"}, expect: `--flag value (default: 2005-01-02 15:04:05 +0000 UTC)` + withEnvHint([]string{"tflag"}, ""), environ: map[string]string{ @@ -2603,7 +2631,7 @@ func TestFlagValue(t *testing.T) { func TestTimestampFlagApply_WithDestination(t *testing.T) { var destination time.Time expectedResult, _ := time.Parse(time.RFC3339, "2006-01-02T15:04:05Z") - fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{Layout: time.RFC3339}, Destination: &destination} + fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{AvailableLayouts: []string{time.RFC3339}}, Destination: &destination} set := flag.NewFlagSet("test", 0) _ = fl.Apply(set) From a636c3450889ab0efde4cc6d3ef0f6ac7abe70bd Mon Sep 17 00:00:00 2001 From: horockey Date: Tue, 6 Aug 2024 18:25:59 +0300 Subject: [PATCH 03/19] test: fix tests --- command_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/command_test.go b/command_test.go index 3b241f85a5..7539c16584 100644 --- a/command_test.go +++ b/command_test.go @@ -2490,6 +2490,7 @@ func TestSetupInitializesOnlyNilWriters(t *testing.T) { } func TestFlagAction(t *testing.T) { + now := time.Now().UTC().Truncate(time.Minute) testCases := []struct { name string args []string @@ -2578,8 +2579,8 @@ func TestFlagAction(t *testing.T) { }, { name: "flag_timestamp", - args: []string{"app", "--f_timestamp", "2022-05-01 02:26:20"}, - exp: "2022-05-01T02:26:20Z ", + args: []string{"app", "--f_timestamp", now.Format(time.DateTime)}, + exp: now.UTC().Format(time.RFC3339) + " ", }, { name: "flag_timestamp_error", @@ -2738,12 +2739,14 @@ func TestFlagAction(t *testing.T) { &TimestampFlag{ Name: "f_timestamp", Config: TimestampConfig{ + Timezone: time.UTC, AvailableLayouts: []string{time.DateTime}, }, Action: func(_ context.Context, cmd *Command, v time.Time) error { if v.IsZero() { return fmt.Errorf("zero timestamp") } + _, err := cmd.Root().Writer.Write([]byte(v.Format(time.RFC3339) + " ")) return err }, From 3dad54f2adff3f4beb4a7aa1576cd2f327abf38c Mon Sep 17 00:00:00 2001 From: horockey Date: Tue, 6 Aug 2024 18:26:08 +0300 Subject: [PATCH 04/19] docs: upd gen docs --- godoc-current.txt | 4 +- makeout.txt | 2500 +++++++++++++++++++++++++++++++++++++++ testdata/godoc-v3.x.txt | 4 +- 3 files changed, 2504 insertions(+), 4 deletions(-) create mode 100644 makeout.txt diff --git a/godoc-current.txt b/godoc-current.txt index 68a439fdf1..14f9a31b97 100644 --- a/godoc-current.txt +++ b/godoc-current.txt @@ -940,8 +940,8 @@ type SuggestFlagFunc func(flags []Flag, provided string, hideHelp bool) string type TimestampArg = ArgumentBase[time.Time, TimestampConfig, timestampValue] type TimestampConfig struct { - Timezone *time.Location - Layout string + Timezone *time.Location + AvailableLayouts []string } TimestampConfig defines the config for timestamp flags diff --git a/makeout.txt b/makeout.txt new file mode 100644 index 0000000000..c536dae03a --- /dev/null +++ b/makeout.txt @@ -0,0 +1,2500 @@ +go run internal/build/build.go generate +go run internal/build/build.go vet +go run internal/build/build.go test +=== RUN TestArgumentsRootCommand +--- PASS: TestArgumentsRootCommand (0.01s) +=== RUN TestArgumentsSubcommand +--- PASS: TestArgumentsSubcommand (0.00s) +=== RUN TestArgsUsage +=== RUN TestArgsUsage/optional +=== RUN TestArgsUsage/zero_or_more +=== RUN TestArgsUsage/one +=== RUN TestArgsUsage/many +=== RUN TestArgsUsage/many2 +=== RUN TestArgsUsage/unlimited +--- PASS: TestArgsUsage (0.00s) + --- PASS: TestArgsUsage/optional (0.00s) + --- PASS: TestArgsUsage/zero_or_more (0.00s) + --- PASS: TestArgsUsage/one (0.00s) + --- PASS: TestArgsUsage/many (0.00s) + --- PASS: TestArgsUsage/many2 (0.00s) + --- PASS: TestArgsUsage/unlimited (0.00s) +=== RUN TestSingleOptionalArg +--- PASS: TestSingleOptionalArg (0.01s) +=== RUN TestUnboundedArgs +=== RUN TestUnboundedArgs/cmd_accepts_no_args +=== RUN TestUnboundedArgs/cmd_uses_given_args +=== RUN TestUnboundedArgs/cmd_uses_default_values +=== RUN TestUnboundedArgs/given_args_override_default_values +--- PASS: TestUnboundedArgs (0.01s) + --- PASS: TestUnboundedArgs/cmd_accepts_no_args (0.00s) + --- PASS: TestUnboundedArgs/cmd_uses_given_args (0.00s) + --- PASS: TestUnboundedArgs/cmd_uses_default_values (0.00s) + --- PASS: TestUnboundedArgs/given_args_override_default_values (0.00s) +=== RUN TestCommandFlagParsing +=== RUN TestCommandFlagParsing/test-cmd_-break_blah_blah +Incorrect Usage: flag provided but not defined: -break + +=== RUN TestCommandFlagParsing/test-cmd_blah_blah +=== RUN TestCommandFlagParsing/test-cmd_blah_-break +=== RUN TestCommandFlagParsing/test-cmd_blah_-help +=== RUN TestCommandFlagParsing/test-cmd_blah_-h +--- PASS: TestCommandFlagParsing (0.00s) + --- PASS: TestCommandFlagParsing/test-cmd_-break_blah_blah (0.00s) + --- PASS: TestCommandFlagParsing/test-cmd_blah_blah (0.00s) + --- PASS: TestCommandFlagParsing/test-cmd_blah_-break (0.00s) + --- PASS: TestCommandFlagParsing/test-cmd_blah_-help (0.00s) + --- PASS: TestCommandFlagParsing/test-cmd_blah_-h (0.00s) +=== RUN TestParseAndRunShortOpts +=== RUN TestParseAndRunShortOpts/test_-a +=== RUN TestParseAndRunShortOpts/test_-c_arg1_arg2 +=== RUN TestParseAndRunShortOpts/test_-f +=== RUN TestParseAndRunShortOpts/test_-ac_--fgh +=== RUN TestParseAndRunShortOpts/test_-af +=== RUN TestParseAndRunShortOpts/test_-cf +=== RUN TestParseAndRunShortOpts/test_-acf +=== RUN TestParseAndRunShortOpts/test_--acf +Incorrect Usage: flag provided but not defined: -acf + +=== RUN TestParseAndRunShortOpts/test_-invalid +Incorrect Usage: flag provided but not defined: -invalid + +=== RUN TestParseAndRunShortOpts/test_-acf_-invalid +Incorrect Usage: flag provided but not defined: -invalid + +=== RUN TestParseAndRunShortOpts/test_--invalid +Incorrect Usage: flag provided but not defined: -invalid + +=== RUN TestParseAndRunShortOpts/test_-acf_--invalid +Incorrect Usage: flag provided but not defined: -invalid + +=== RUN TestParseAndRunShortOpts/test_-acf_arg1_-invalid +=== RUN TestParseAndRunShortOpts/test_-acf_arg1_--invalid +=== RUN TestParseAndRunShortOpts/test_-acfi_not-arg_arg1_-invalid +=== RUN TestParseAndRunShortOpts/test_-i_ivalue +=== RUN TestParseAndRunShortOpts/test_-i_ivalue_arg1 +=== RUN TestParseAndRunShortOpts/test_-i +Incorrect Usage: flag needs an argument: -i + +--- PASS: TestParseAndRunShortOpts (0.02s) + --- PASS: TestParseAndRunShortOpts/test_-a (0.00s) + --- PASS: TestParseAndRunShortOpts/test_-c_arg1_arg2 (0.00s) + --- PASS: TestParseAndRunShortOpts/test_-f (0.00s) + --- PASS: TestParseAndRunShortOpts/test_-ac_--fgh (0.00s) + --- PASS: TestParseAndRunShortOpts/test_-af (0.00s) + --- PASS: TestParseAndRunShortOpts/test_-cf (0.00s) + --- PASS: TestParseAndRunShortOpts/test_-acf (0.00s) + --- PASS: TestParseAndRunShortOpts/test_--acf (0.00s) + --- PASS: TestParseAndRunShortOpts/test_-invalid (0.00s) + --- PASS: TestParseAndRunShortOpts/test_-acf_-invalid (0.00s) + --- PASS: TestParseAndRunShortOpts/test_--invalid (0.00s) + --- PASS: TestParseAndRunShortOpts/test_-acf_--invalid (0.00s) + --- PASS: TestParseAndRunShortOpts/test_-acf_arg1_-invalid (0.00s) + --- PASS: TestParseAndRunShortOpts/test_-acf_arg1_--invalid (0.00s) + --- PASS: TestParseAndRunShortOpts/test_-acfi_not-arg_arg1_-invalid (0.00s) + --- PASS: TestParseAndRunShortOpts/test_-i_ivalue (0.00s) + --- PASS: TestParseAndRunShortOpts/test_-i_ivalue_arg1 (0.00s) + --- PASS: TestParseAndRunShortOpts/test_-i (0.00s) +=== RUN TestCommand_Run_DoesNotOverwriteErrorFromBefore +--- PASS: TestCommand_Run_DoesNotOverwriteErrorFromBefore (0.00s) +=== RUN TestCommand_Run_BeforeSavesMetadata +--- PASS: TestCommand_Run_BeforeSavesMetadata (0.00s) +=== RUN TestCommand_OnUsageError_hasCommandContext +--- PASS: TestCommand_OnUsageError_hasCommandContext (0.00s) +=== RUN TestCommand_OnUsageError_WithWrongFlagValue +--- PASS: TestCommand_OnUsageError_WithWrongFlagValue (0.00s) +=== RUN TestCommand_OnUsageError_WithSubcommand +--- PASS: TestCommand_OnUsageError_WithSubcommand (0.00s) +=== RUN TestCommand_Run_SubcommandsCanUseErrWriter +--- PASS: TestCommand_Run_SubcommandsCanUseErrWriter (0.00s) +=== RUN TestCommandSkipFlagParsing +=== RUN TestCommandSkipFlagParsing/some-command_some-arg_--flag_foo +=== RUN TestCommandSkipFlagParsing/some-command_some-arg_--flag=foo +--- PASS: TestCommandSkipFlagParsing (0.00s) + --- PASS: TestCommandSkipFlagParsing/some-command_some-arg_--flag_foo (0.00s) + --- PASS: TestCommandSkipFlagParsing/some-command_some-arg_--flag=foo (0.00s) +=== RUN TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags +=== RUN TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--undefined +=== RUN TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--number +=== RUN TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--number_forty-two +=== RUN TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--number_42 +=== RUN TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--number_42_newArg +--- PASS: TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags (0.00s) + --- PASS: TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--undefined (0.00s) + --- PASS: TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--number (0.00s) + --- PASS: TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--number_forty-two (0.00s) + --- PASS: TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--number_42 (0.00s) + --- PASS: TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--number_42_newArg (0.00s) +=== RUN TestCommand_CanAddVFlagOnSubCommands +--- PASS: TestCommand_CanAddVFlagOnSubCommands (0.00s) +=== RUN TestCommand_VisibleSubcCommands +--- PASS: TestCommand_VisibleSubcCommands (0.00s) +=== RUN TestCommand_VisibleFlagCategories +--- PASS: TestCommand_VisibleFlagCategories (0.00s) +=== RUN TestCommand_RunSubcommandWithDefault +--- PASS: TestCommand_RunSubcommandWithDefault (0.00s) +=== RUN TestCommand_Run +--- PASS: TestCommand_Run (0.00s) +=== RUN TestCommand_Command +--- PASS: TestCommand_Command (0.00s) +=== RUN TestCommand_RunDefaultCommand +=== RUN TestCommand_RunDefaultCommand/command=foobar-default=foobar +NAME: + c foobar + +USAGE: + c foobar [command [command options]] + +OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommand/command=batbaz-default=foobar +NAME: + c batbaz + +USAGE: + c batbaz [command [command options]] + +OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommand/command=b-default= +NAME: + c batbaz + +USAGE: + c batbaz [command [command options]] + +OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommand/command=f-default= +NAME: + c foobar + +USAGE: + c foobar [command [command options]] + +OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommand/command=-default=foobar +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommand/command=-default= +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommand/command=_-default= +=== RUN TestCommand_RunDefaultCommand/command=bat-default=batbaz +=== RUN TestCommand_RunDefaultCommand/command=nothing-default=batbaz +=== RUN TestCommand_RunDefaultCommand/command=nothing-default= +--- PASS: TestCommand_RunDefaultCommand (0.01s) + --- PASS: TestCommand_RunDefaultCommand/command=foobar-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommand/command=batbaz-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommand/command=b-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommand/command=f-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommand/command=-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommand/command=-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommand/command=_-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommand/command=bat-default=batbaz (0.00s) + --- PASS: TestCommand_RunDefaultCommand/command=nothing-default=batbaz (0.00s) + --- PASS: TestCommand_RunDefaultCommand/command=nothing-default= (0.00s) +=== RUN TestCommand_RunDefaultCommandWithSubCommand +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=foobar-subcmd=-default=foobar +NAME: + c foobar + +USAGE: + c foobar [command [command options]] [arguments...] + +COMMANDS: + jimbob, j + carly + help, h Shows a list of commands or help for one command + +OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=foobar-subcmd=carly-default=foobar +NAME: + c foobar carly + +USAGE: + c foobar carly [command [command options]] + +OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=batbaz-subcmd=-default=foobar +NAME: + c batbaz + +USAGE: + c batbaz [command [command options]] + +OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=b-subcmd=-default= +NAME: + c batbaz + +USAGE: + c batbaz [command [command options]] + +OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=f-subcmd=-default= +NAME: + c foobar + +USAGE: + c foobar [command [command options]] [arguments...] + +COMMANDS: + jimbob, j + carly + help, h Shows a list of commands or help for one command + +OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=-default=foobar +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=-default= +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=jimbob-default=foobar +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=j-default=foobar +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=carly-default=foobar +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=jimmers-default=foobar +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=jimmers-default= +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=_-subcmd=jimmers-default=foobar +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=-default=#01 +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=_-subcmd=-default= +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=_-subcmd=j-default= +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=bat-subcmd=-default=batbaz +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=nothing-subcmd=-default=batbaz +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=nothing-subcmd=-default= +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=nothing-subcmd=j-default=batbaz +=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=nothing-subcmd=carly-default= +--- PASS: TestCommand_RunDefaultCommandWithSubCommand (0.04s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=foobar-subcmd=-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=foobar-subcmd=carly-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=batbaz-subcmd=-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=b-subcmd=-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=f-subcmd=-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=jimbob-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=j-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=carly-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=jimmers-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=jimmers-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=_-subcmd=jimmers-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=-default=#01 (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=_-subcmd=-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=_-subcmd=j-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=bat-subcmd=-default=batbaz (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=nothing-subcmd=-default=batbaz (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=nothing-subcmd=-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=nothing-subcmd=j-default=batbaz (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=nothing-subcmd=carly-default= (0.00s) +=== RUN TestCommand_RunDefaultCommandWithFlags +=== RUN TestCommand_RunDefaultCommandWithFlags/command=foobar-flag=-default=foobar +NAME: + c foobar + +USAGE: + c foobar [command [command options]] + +OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithFlags/command=foobar-flag=-c_derp-default=foobar +NAME: + c foobar + +USAGE: + c foobar [command [command options]] + +OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithFlags/command=batbaz-flag=-default=foobar +NAME: + c batbaz + +USAGE: + c batbaz [command [command options]] + +OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithFlags/command=b-flag=-default= +NAME: + c batbaz + +USAGE: + c batbaz [command [command options]] + +OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithFlags/command=f-flag=-default= +NAME: + c foobar + +USAGE: + c foobar [command [command options]] + +OPTIONS: + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=-default=foobar +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --carly value, -c value + --jimbob, -j (default: true) + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=-default= +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --carly value, -c value + --jimbob, -j (default: true) + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=-j-default=foobar +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --carly value, -c value + --jimbob, -j (default: true) + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=-j-default=foobar#01 +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --carly value, -c value + --jimbob, -j (default: true) + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=-c_derp-default=foobar +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --carly value, -c value + --jimbob, -j (default: true) + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=--carly=derp-default=foobar +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --carly value, -c value + --jimbob, -j (default: true) + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=-j-default=foobar#02 +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --carly value, -c value + --jimbob, -j (default: true) + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=-j-default= +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --carly value, -c value + --jimbob, -j (default: true) + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithFlags/command=_-flag=-j-default=foobar +=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=-default=#01 +NAME: + c - A new cli application + +USAGE: + c [global options] [command [command options]] [arguments...] + +COMMANDS: + foobar, f + batbaz, b + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --carly value, -c value + --jimbob, -j (default: true) + --help, -h show help +=== RUN TestCommand_RunDefaultCommandWithFlags/command=_-flag=-default= +=== RUN TestCommand_RunDefaultCommandWithFlags/command=_-flag=-j-default= +=== RUN TestCommand_RunDefaultCommandWithFlags/command=bat-flag=-default=batbaz +=== RUN TestCommand_RunDefaultCommandWithFlags/command=nothing-flag=-default=batbaz +=== RUN TestCommand_RunDefaultCommandWithFlags/command=nothing-flag=-default= +=== RUN TestCommand_RunDefaultCommandWithFlags/command=nothing-flag=--jimbob-default=batbaz +=== RUN TestCommand_RunDefaultCommandWithFlags/command=nothing-flag=--carly-default= +--- PASS: TestCommand_RunDefaultCommandWithFlags (0.04s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=foobar-flag=-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=foobar-flag=-c_derp-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=batbaz-flag=-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=b-flag=-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=f-flag=-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=-j-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=-j-default=foobar#01 (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=-c_derp-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=--carly=derp-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=-j-default=foobar#02 (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=-j-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=_-flag=-j-default=foobar (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=-default=#01 (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=_-flag=-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=_-flag=-j-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=bat-flag=-default=batbaz (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=nothing-flag=-default=batbaz (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=nothing-flag=-default= (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=nothing-flag=--jimbob-default=batbaz (0.00s) + --- PASS: TestCommand_RunDefaultCommandWithFlags/command=nothing-flag=--carly-default= (0.00s) +=== RUN TestCommand_FlagsFromExtPackage +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --carly value, -c value + --jimbob, -j (default: true) + + --help, -h show help +Incorrect Usage: flag provided but not defined: -epflag + +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --carly value, -c value + --jimbob, -j (default: true) + --help, -h show help +--- PASS: TestCommand_FlagsFromExtPackage (0.00s) +=== RUN TestCommand_Setup_defaultsReader +--- PASS: TestCommand_Setup_defaultsReader (0.00s) +=== RUN TestCommand_Setup_defaultsWriter +--- PASS: TestCommand_Setup_defaultsWriter (0.00s) +=== RUN TestCommand_CommandWithFlagBeforeTerminator +--- PASS: TestCommand_CommandWithFlagBeforeTerminator (0.00s) +=== RUN TestCommand_CommandWithDash +--- PASS: TestCommand_CommandWithDash (0.00s) +=== RUN TestCommand_CommandWithNoFlagBeforeTerminator +--- PASS: TestCommand_CommandWithNoFlagBeforeTerminator (0.00s) +=== RUN TestCommand_SkipFlagParsing +--- PASS: TestCommand_SkipFlagParsing (0.00s) +=== RUN TestCommand_VisibleCommands +--- PASS: TestCommand_VisibleCommands (0.00s) +=== RUN TestCommand_UseShortOptionHandling +--- PASS: TestCommand_UseShortOptionHandling (0.00s) +=== RUN TestCommand_UseShortOptionHandling_missing_value +Incorrect Usage: flag needs an argument: -n + +--- PASS: TestCommand_UseShortOptionHandling_missing_value (0.00s) +=== RUN TestCommand_UseShortOptionHandlingCommand +--- PASS: TestCommand_UseShortOptionHandlingCommand (0.00s) +=== RUN TestCommand_UseShortOptionHandlingCommand_missing_value +Incorrect Usage: flag needs an argument: -n + +--- PASS: TestCommand_UseShortOptionHandlingCommand_missing_value (0.00s) +=== RUN TestCommand_UseShortOptionHandlingSubCommand +--- PASS: TestCommand_UseShortOptionHandlingSubCommand (0.00s) +=== RUN TestCommand_UseShortOptionHandlingSubCommand_missing_value +Incorrect Usage: flag needs an argument: -n + +--- PASS: TestCommand_UseShortOptionHandlingSubCommand_missing_value (0.00s) +=== RUN TestCommand_UseShortOptionAfterSliceFlag +--- PASS: TestCommand_UseShortOptionAfterSliceFlag (0.00s) +=== RUN TestCommand_Float64Flag +--- PASS: TestCommand_Float64Flag (0.00s) +=== RUN TestCommand_ParseSliceFlags +--- PASS: TestCommand_ParseSliceFlags (0.00s) +=== RUN TestCommand_ParseSliceFlagsWithMissingValue +--- PASS: TestCommand_ParseSliceFlagsWithMissingValue (0.00s) +=== RUN TestCommand_DefaultStdin +--- PASS: TestCommand_DefaultStdin (0.00s) +=== RUN TestCommand_DefaultStdout +--- PASS: TestCommand_DefaultStdout (0.00s) +=== RUN TestCommand_SetStdin +--- PASS: TestCommand_SetStdin (0.00s) +=== RUN TestCommand_SetStdin_Subcommand +--- PASS: TestCommand_SetStdin_Subcommand (0.00s) +=== RUN TestCommand_SetStdout +--- PASS: TestCommand_SetStdout (0.00s) +=== RUN TestCommand_BeforeFunc +--- PASS: TestCommand_BeforeFunc (0.00s) +=== RUN TestCommand_BeforeAfterFuncShellCompletion + command_test.go:1408: TODO: is '--generate-shell-completion' (flag) still supported? +--- SKIP: TestCommand_BeforeAfterFuncShellCompletion (0.00s) +=== RUN TestCommand_AfterFunc +NAME: + command - A new cli application + +USAGE: + command [global options] [command [command options]] [arguments...] + +COMMANDS: + sub + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --opt value +--- PASS: TestCommand_AfterFunc (0.00s) +=== RUN TestCommandNoHelpFlag +Incorrect Usage: flag: help requested + +--- PASS: TestCommandNoHelpFlag (0.00s) +=== RUN TestRequiredFlagCommandRunBehavior +=== RUN TestRequiredFlagCommandRunBehavior/error_case_empty_input_with_required_flag_on_app +=== RUN TestRequiredFlagCommandRunBehavior/error_case_empty_input_with_required_flag_on_command +=== RUN TestRequiredFlagCommandRunBehavior/error_case_empty_input_with_required_flag_on_subcommand +=== RUN TestRequiredFlagCommandRunBehavior/valid_case_help_input_with_required_flag_on_app +=== RUN TestRequiredFlagCommandRunBehavior/valid_case_help_input_with_required_flag_on_command +=== RUN TestRequiredFlagCommandRunBehavior/valid_case_help_input_with_required_flag_on_subcommand +=== RUN TestRequiredFlagCommandRunBehavior/error_case_optional_input_with_required_flag_on_app +=== RUN TestRequiredFlagCommandRunBehavior/error_case_optional_input_with_required_flag_on_command +=== RUN TestRequiredFlagCommandRunBehavior/error_case_optional_input_with_required_flag_on_subcommand +=== RUN TestRequiredFlagCommandRunBehavior/valid_case_required_flag_input_on_app +=== RUN TestRequiredFlagCommandRunBehavior/valid_case_required_flag_input_on_command +=== RUN TestRequiredFlagCommandRunBehavior/valid_case_required_flag_input_on_subcommand +--- PASS: TestRequiredFlagCommandRunBehavior (0.03s) + --- PASS: TestRequiredFlagCommandRunBehavior/error_case_empty_input_with_required_flag_on_app (0.00s) + --- PASS: TestRequiredFlagCommandRunBehavior/error_case_empty_input_with_required_flag_on_command (0.00s) + --- PASS: TestRequiredFlagCommandRunBehavior/error_case_empty_input_with_required_flag_on_subcommand (0.00s) + --- PASS: TestRequiredFlagCommandRunBehavior/valid_case_help_input_with_required_flag_on_app (0.00s) + --- PASS: TestRequiredFlagCommandRunBehavior/valid_case_help_input_with_required_flag_on_command (0.00s) + --- PASS: TestRequiredFlagCommandRunBehavior/valid_case_help_input_with_required_flag_on_subcommand (0.00s) + --- PASS: TestRequiredFlagCommandRunBehavior/error_case_optional_input_with_required_flag_on_app (0.00s) + --- PASS: TestRequiredFlagCommandRunBehavior/error_case_optional_input_with_required_flag_on_command (0.00s) + --- PASS: TestRequiredFlagCommandRunBehavior/error_case_optional_input_with_required_flag_on_subcommand (0.00s) + --- PASS: TestRequiredFlagCommandRunBehavior/valid_case_required_flag_input_on_app (0.00s) + --- PASS: TestRequiredFlagCommandRunBehavior/valid_case_required_flag_input_on_command (0.00s) + --- PASS: TestRequiredFlagCommandRunBehavior/valid_case_required_flag_input_on_subcommand (0.00s) +=== RUN TestCommandHelpPrinter +--- PASS: TestCommandHelpPrinter (0.00s) +=== RUN TestCommand_VersionPrinter +--- PASS: TestCommand_VersionPrinter (0.00s) +=== RUN TestCommand_CommandNotFound +--- PASS: TestCommand_CommandNotFound (0.00s) +=== RUN TestCommand_OrderOfOperations +=== RUN TestCommand_OrderOfOperations/on_usage_error +=== RUN TestCommand_OrderOfOperations/shell_complete +=== RUN TestCommand_OrderOfOperations/nil_on_usage_error +Incorrect Usage: flag provided but not defined: -nope + +=== RUN TestCommand_OrderOfOperations/before_after_action_hooks +=== RUN TestCommand_OrderOfOperations/before_with_error +=== RUN TestCommand_OrderOfOperations/nil_after +=== RUN TestCommand_OrderOfOperations/after_errors +=== RUN TestCommand_OrderOfOperations/nil_commands +--- PASS: TestCommand_OrderOfOperations (0.01s) + --- PASS: TestCommand_OrderOfOperations/on_usage_error (0.00s) + --- PASS: TestCommand_OrderOfOperations/shell_complete (0.00s) + --- PASS: TestCommand_OrderOfOperations/nil_on_usage_error (0.00s) + --- PASS: TestCommand_OrderOfOperations/before_after_action_hooks (0.00s) + --- PASS: TestCommand_OrderOfOperations/before_with_error (0.00s) + --- PASS: TestCommand_OrderOfOperations/nil_after (0.00s) + --- PASS: TestCommand_OrderOfOperations/after_errors (0.00s) + --- PASS: TestCommand_OrderOfOperations/nil_commands (0.00s) +=== RUN TestCommand_Run_CommandWithSubcommandHasHelpTopic +=== RUN TestCommand_Run_CommandWithSubcommandHasHelpTopic/checking_with_flags_[foo_--help] +=== RUN TestCommand_Run_CommandWithSubcommandHasHelpTopic/checking_with_flags_[foo_-h] +=== RUN TestCommand_Run_CommandWithSubcommandHasHelpTopic/checking_with_flags_[foo_help] +--- PASS: TestCommand_Run_CommandWithSubcommandHasHelpTopic (0.01s) + --- PASS: TestCommand_Run_CommandWithSubcommandHasHelpTopic/checking_with_flags_[foo_--help] (0.00s) + --- PASS: TestCommand_Run_CommandWithSubcommandHasHelpTopic/checking_with_flags_[foo_-h] (0.00s) + --- PASS: TestCommand_Run_CommandWithSubcommandHasHelpTopic/checking_with_flags_[foo_help] (0.00s) +=== RUN TestCommand_Run_SubcommandFullPath +--- PASS: TestCommand_Run_SubcommandFullPath (0.00s) +=== RUN TestCommand_Run_Help +=== RUN TestCommand_Run_Help/checking_with_arguments_[boom_--help] +=== RUN TestCommand_Run_Help/checking_with_arguments_[boom_-h] +=== RUN TestCommand_Run_Help/checking_with_arguments_[boom_help] +=== RUN TestCommand_Run_Help/checking_with_arguments_[boom_--help]#01 +Incorrect Usage: flag: help requested + +=== RUN TestCommand_Run_Help/checking_with_arguments_[boom_-h]#01 +Incorrect Usage: flag: help requested + +=== RUN TestCommand_Run_Help/checking_with_arguments_[boom_help]#01 +--- PASS: TestCommand_Run_Help (0.01s) + --- PASS: TestCommand_Run_Help/checking_with_arguments_[boom_--help] (0.00s) + --- PASS: TestCommand_Run_Help/checking_with_arguments_[boom_-h] (0.00s) + --- PASS: TestCommand_Run_Help/checking_with_arguments_[boom_help] (0.00s) + --- PASS: TestCommand_Run_Help/checking_with_arguments_[boom_--help]#01 (0.00s) + --- PASS: TestCommand_Run_Help/checking_with_arguments_[boom_-h]#01 (0.00s) + --- PASS: TestCommand_Run_Help/checking_with_arguments_[boom_help]#01 (0.00s) +=== RUN TestCommand_Run_Version +=== RUN TestCommand_Run_Version/checking_with_arguments_[boom_--version] +=== RUN TestCommand_Run_Version/checking_with_arguments_[boom_-v] +--- PASS: TestCommand_Run_Version (0.00s) + --- PASS: TestCommand_Run_Version/checking_with_arguments_[boom_--version] (0.00s) + --- PASS: TestCommand_Run_Version/checking_with_arguments_[boom_-v] (0.00s) +=== RUN TestCommand_Run_Categories +--- PASS: TestCommand_Run_Categories (0.00s) +=== RUN TestCommand_VisibleCategories +--- PASS: TestCommand_VisibleCategories (0.00s) +=== RUN TestCommand_Run_SubcommandDoesNotOverwriteErrorFromBefore +--- PASS: TestCommand_Run_SubcommandDoesNotOverwriteErrorFromBefore (0.00s) +=== RUN TestCommand_OnUsageError_WithWrongFlagValue_ForSubcommand +--- PASS: TestCommand_OnUsageError_WithWrongFlagValue_ForSubcommand (0.00s) +=== RUN TestCustomFlagsUnused +--- PASS: TestCustomFlagsUnused (0.00s) +=== RUN TestCustomFlagsUsed +--- PASS: TestCustomFlagsUsed (0.00s) +=== RUN TestCustomHelpVersionFlags +--- PASS: TestCustomHelpVersionFlags (0.00s) +=== RUN TestHandleExitCoder_Default +--- PASS: TestHandleExitCoder_Default (0.00s) +=== RUN TestHandleExitCoder_Custom +--- PASS: TestHandleExitCoder_Custom (0.00s) +=== RUN TestShellCompletionForIncompleteFlags +--- PASS: TestShellCompletionForIncompleteFlags (0.00s) +=== RUN TestWhenExitSubCommandWithCodeThenCommandQuitUnexpectedly +--- PASS: TestWhenExitSubCommandWithCodeThenCommandQuitUnexpectedly (0.00s) +=== RUN TestSetupInitializesBothWriters +--- PASS: TestSetupInitializesBothWriters (0.00s) +=== RUN TestSetupInitializesOnlyNilWriters +--- PASS: TestSetupInitializesOnlyNilWriters (0.00s) +=== RUN TestFlagAction +=== RUN TestFlagAction/flag_string +=== RUN TestFlagAction/flag_string_error +=== RUN TestFlagAction/flag_string_slice +=== RUN TestFlagAction/flag_string_slice_error +=== RUN TestFlagAction/flag_bool +=== RUN TestFlagAction/flag_bool_error +=== RUN TestFlagAction/flag_duration +=== RUN TestFlagAction/flag_duration_error +=== RUN TestFlagAction/flag_float64 +=== RUN TestFlagAction/flag_float64_error +=== RUN TestFlagAction/flag_float64_slice +=== RUN TestFlagAction/flag_float64_slice_error +=== RUN TestFlagAction/flag_int +=== RUN TestFlagAction/flag_int_error +=== RUN TestFlagAction/flag_int_slice +=== RUN TestFlagAction/flag_int_slice_error +=== RUN TestFlagAction/flag_timestamp + command_test.go:2786: + Error Trace: /home/nrassudov/Repos/cli/command_test.go:2786 + Error: Not equal: + expected: "2022-05-01T02:26:20Z " + actual : "2022-05-01T02:26:20+03:00 " + + Diff: + --- Expected + +++ Actual + @@ -1 +1 @@ + -2022-05-01T02:26:20Z + +2022-05-01T02:26:20+03:00 + Test: TestFlagAction/flag_timestamp +=== RUN TestFlagAction/flag_timestamp_error + command_test.go:2781: + Error Trace: /home/nrassudov/Repos/cli/command_test.go:2781 + Error: An error is expected but got nil. + Test: TestFlagAction/flag_timestamp_error +=== RUN TestFlagAction/flag_uint +=== RUN TestFlagAction/flag_uint_error +=== RUN TestFlagAction/flag_no_action +=== RUN TestFlagAction/command_flag +=== RUN TestFlagAction/subCommand_flag +=== RUN TestFlagAction/mixture +=== RUN TestFlagAction/flag_string_map +=== RUN TestFlagAction/flag_string_map_error +--- FAIL: TestFlagAction (0.03s) + --- PASS: TestFlagAction/flag_string (0.00s) + --- PASS: TestFlagAction/flag_string_error (0.00s) + --- PASS: TestFlagAction/flag_string_slice (0.00s) + --- PASS: TestFlagAction/flag_string_slice_error (0.00s) + --- PASS: TestFlagAction/flag_bool (0.00s) + --- PASS: TestFlagAction/flag_bool_error (0.00s) + --- PASS: TestFlagAction/flag_duration (0.00s) + --- PASS: TestFlagAction/flag_duration_error (0.00s) + --- PASS: TestFlagAction/flag_float64 (0.00s) + --- PASS: TestFlagAction/flag_float64_error (0.00s) + --- PASS: TestFlagAction/flag_float64_slice (0.00s) + --- PASS: TestFlagAction/flag_float64_slice_error (0.00s) + --- PASS: TestFlagAction/flag_int (0.00s) + --- PASS: TestFlagAction/flag_int_error (0.00s) + --- PASS: TestFlagAction/flag_int_slice (0.00s) + --- PASS: TestFlagAction/flag_int_slice_error (0.00s) + --- FAIL: TestFlagAction/flag_timestamp (0.00s) + --- FAIL: TestFlagAction/flag_timestamp_error (0.00s) + --- PASS: TestFlagAction/flag_uint (0.00s) + --- PASS: TestFlagAction/flag_uint_error (0.00s) + --- PASS: TestFlagAction/flag_no_action (0.00s) + --- PASS: TestFlagAction/command_flag (0.00s) + --- PASS: TestFlagAction/subCommand_flag (0.00s) + --- PASS: TestFlagAction/mixture (0.00s) + --- PASS: TestFlagAction/flag_string_map (0.00s) + --- PASS: TestFlagAction/flag_string_map_error (0.00s) +=== RUN TestPersistentFlag +--- PASS: TestPersistentFlag (0.00s) +=== RUN TestPersistentFlagIsSet +--- PASS: TestPersistentFlagIsSet (0.00s) +=== RUN TestRequiredPersistentFlag +NAME: + root sub + +USAGE: + root sub [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +OPTIONS: + --help, -h show help +--- PASS: TestRequiredPersistentFlag (0.00s) +=== RUN TestFlagDuplicates +=== RUN TestFlagDuplicates/all_args_present_once +=== RUN TestFlagDuplicates/duplicate_non_slice_flag(duplicatable) +=== RUN TestFlagDuplicates/duplicate_non_slice_flag(non_duplicatable) +Incorrect Usage: invalid value "trip" for flag -sflag: cant duplicate this flag + +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --sflag value + --isflag value [ --isflag value ] + --fsflag value [ --fsflag value ] + --iflag value (default: 0) + --help, -h show help +=== RUN TestFlagDuplicates/duplicate_slice_flag(non_duplicatable) +Incorrect Usage: invalid value "3.0" for flag -fsflag: cant duplicate this flag + +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --sflag value + --isflag value [ --isflag value ] + --fsflag value [ --fsflag value ] + --iflag value (default: 0) + --help, -h show help +--- PASS: TestFlagDuplicates (0.01s) + --- PASS: TestFlagDuplicates/all_args_present_once (0.00s) + --- PASS: TestFlagDuplicates/duplicate_non_slice_flag(duplicatable) (0.00s) + --- PASS: TestFlagDuplicates/duplicate_non_slice_flag(non_duplicatable) (0.00s) + --- PASS: TestFlagDuplicates/duplicate_slice_flag(non_duplicatable) (0.00s) +=== RUN TestShorthandCommand +--- PASS: TestShorthandCommand (0.00s) +=== RUN TestCommand_Int +--- PASS: TestCommand_Int (0.00s) +=== RUN TestCommand_Uint +--- PASS: TestCommand_Uint (0.00s) +=== RUN TestCommand_Float64 +--- PASS: TestCommand_Float64 (0.00s) +=== RUN TestCommand_Duration +--- PASS: TestCommand_Duration (0.00s) +=== RUN TestCommand_Timestamp +--- PASS: TestCommand_Timestamp (0.00s) +=== RUN TestCommand_String +--- PASS: TestCommand_String (0.00s) +=== RUN TestCommand_Bool +--- PASS: TestCommand_Bool (0.00s) +=== RUN TestCommand_Value +=== RUN TestCommand_Value/flag_name +=== RUN TestCommand_Value/flag_aliases +--- PASS: TestCommand_Value (0.00s) + --- PASS: TestCommand_Value/flag_name (0.00s) + --- PASS: TestCommand_Value/flag_aliases (0.00s) +=== RUN TestCommand_Value_InvalidFlagAccessHandler +--- PASS: TestCommand_Value_InvalidFlagAccessHandler (0.00s) +=== RUN TestCommand_Args +--- PASS: TestCommand_Args (0.00s) +=== RUN TestCommand_NArg +--- PASS: TestCommand_NArg (0.00s) +=== RUN TestCommand_IsSet +--- PASS: TestCommand_IsSet (0.00s) +=== RUN TestCommand_IsSet_fromEnv +Incorrect Usage: could not parse "foobar" as float64 value from environment variable "APP_UNPARSABLE" for flag unparsable: strconv.ParseFloat: parsing "foobar": invalid syntax + +NAME: + run - A new cli application + +USAGE: + run [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --timeout value, -t value (default: 0) [$APP_TIMEOUT_SECONDS] + --password value, -p value [$APP_PASSWORD] + --unparsable value, -u value (default: 0) [$APP_UNPARSABLE] + --no-env-var value, -n value (default: 0) + --help, -h show help +--- PASS: TestCommand_IsSet_fromEnv (0.00s) +=== RUN TestCommand_NumFlags +--- PASS: TestCommand_NumFlags (0.00s) +=== RUN TestCommand_Set +--- PASS: TestCommand_Set (0.00s) +=== RUN TestCommand_Set_InvalidFlagAccessHandler +--- PASS: TestCommand_Set_InvalidFlagAccessHandler (0.00s) +=== RUN TestCommand_LocalFlagNames +--- PASS: TestCommand_LocalFlagNames (0.00s) +=== RUN TestCommand_FlagNames +--- PASS: TestCommand_FlagNames (0.00s) +=== RUN TestCommand_Lineage +--- PASS: TestCommand_Lineage (0.00s) +=== RUN TestCommand_lookupFlagSet +--- PASS: TestCommand_lookupFlagSet (0.00s) +=== RUN TestCommandAttributeAccessing +=== RUN TestCommandAttributeAccessing/empty +=== RUN TestCommandAttributeAccessing/empty_with_background_context +=== RUN TestCommandAttributeAccessing/empty_set_bool_and_present_ctx_bool +=== RUN TestCommandAttributeAccessing/present_set_bool_and_present_ctx_bool_with_background_context +=== RUN TestCommandAttributeAccessing/present_set_bool_and_present_ctx_bool +=== RUN TestCommandAttributeAccessing/present_set_bool_and_present_ctx_bool_with_background_context#01 +=== RUN TestCommandAttributeAccessing/present_set_bool_and_different_ctx_bool +=== RUN TestCommandAttributeAccessing/present_set_bool_and_different_ctx_bool_with_background_context +--- PASS: TestCommandAttributeAccessing (0.00s) + --- PASS: TestCommandAttributeAccessing/empty (0.00s) + --- PASS: TestCommandAttributeAccessing/empty_with_background_context (0.00s) + --- PASS: TestCommandAttributeAccessing/empty_set_bool_and_present_ctx_bool (0.00s) + --- PASS: TestCommandAttributeAccessing/present_set_bool_and_present_ctx_bool_with_background_context (0.00s) + --- PASS: TestCommandAttributeAccessing/present_set_bool_and_present_ctx_bool (0.00s) + --- PASS: TestCommandAttributeAccessing/present_set_bool_and_present_ctx_bool_with_background_context#01 (0.00s) + --- PASS: TestCommandAttributeAccessing/present_set_bool_and_different_ctx_bool (0.00s) + --- PASS: TestCommandAttributeAccessing/present_set_bool_and_different_ctx_bool_with_background_context (0.00s) +=== RUN TestCheckRequiredFlags +=== RUN TestCheckRequiredFlags/empty +=== RUN TestCheckRequiredFlags/optional +=== RUN TestCheckRequiredFlags/required +=== RUN TestCheckRequiredFlags/required_and_present +=== RUN TestCheckRequiredFlags/required_and_present_via_env_var +=== RUN TestCheckRequiredFlags/required_and_optional +=== RUN TestCheckRequiredFlags/required_and_optional_and_optional_present +=== RUN TestCheckRequiredFlags/required_and_optional_and_optional_present_via_env_var +=== RUN TestCheckRequiredFlags/required_and_optional_and_required_present +=== RUN TestCheckRequiredFlags/two_required +=== RUN TestCheckRequiredFlags/two_required_and_one_present +=== RUN TestCheckRequiredFlags/two_required_and_both_present +=== RUN TestCheckRequiredFlags/required_flag_with_short_name +=== RUN TestCheckRequiredFlags/required_flag_with_multiple_short_names +=== RUN TestCheckRequiredFlags/required_flag_with_short_alias_not_printed_on_error +=== RUN TestCheckRequiredFlags/required_flag_with_one_character +--- PASS: TestCheckRequiredFlags (0.00s) + --- PASS: TestCheckRequiredFlags/empty (0.00s) + --- PASS: TestCheckRequiredFlags/optional (0.00s) + --- PASS: TestCheckRequiredFlags/required (0.00s) + --- PASS: TestCheckRequiredFlags/required_and_present (0.00s) + --- PASS: TestCheckRequiredFlags/required_and_present_via_env_var (0.00s) + --- PASS: TestCheckRequiredFlags/required_and_optional (0.00s) + --- PASS: TestCheckRequiredFlags/required_and_optional_and_optional_present (0.00s) + --- PASS: TestCheckRequiredFlags/required_and_optional_and_optional_present_via_env_var (0.00s) + --- PASS: TestCheckRequiredFlags/required_and_optional_and_required_present (0.00s) + --- PASS: TestCheckRequiredFlags/two_required (0.00s) + --- PASS: TestCheckRequiredFlags/two_required_and_one_present (0.00s) + --- PASS: TestCheckRequiredFlags/two_required_and_both_present (0.00s) + --- PASS: TestCheckRequiredFlags/required_flag_with_short_name (0.00s) + --- PASS: TestCheckRequiredFlags/required_flag_with_multiple_short_names (0.00s) + --- PASS: TestCheckRequiredFlags/required_flag_with_short_alias_not_printed_on_error (0.00s) + --- PASS: TestCheckRequiredFlags/required_flag_with_one_character (0.00s) +=== RUN TestCommand_ParentCommand_Set +--- PASS: TestCommand_ParentCommand_Set (0.00s) +=== RUN TestCommandReadArgsFromStdIn +=== RUN TestCommandReadArgsFromStdIn/empty +=== RUN TestCommandReadArgsFromStdIn/empty2 +=== RUN TestCommandReadArgsFromStdIn/intflag-from-input +=== RUN TestCommandReadArgsFromStdIn/intflag-from-input2 +=== RUN TestCommandReadArgsFromStdIn/multiflag-from-input +=== RUN TestCommandReadArgsFromStdIn/end-args +=== RUN TestCommandReadArgsFromStdIn/invalid_string +=== RUN TestCommandReadArgsFromStdIn/invalid_string2 +Incorrect Usage: flag needs an argument: -if + +=== RUN TestCommandReadArgsFromStdIn/incomplete_string +--- PASS: TestCommandReadArgsFromStdIn (0.01s) + --- PASS: TestCommandReadArgsFromStdIn/empty (0.00s) + --- PASS: TestCommandReadArgsFromStdIn/empty2 (0.00s) + --- PASS: TestCommandReadArgsFromStdIn/intflag-from-input (0.00s) + --- PASS: TestCommandReadArgsFromStdIn/intflag-from-input2 (0.00s) + --- PASS: TestCommandReadArgsFromStdIn/multiflag-from-input (0.00s) + --- PASS: TestCommandReadArgsFromStdIn/end-args (0.00s) + --- PASS: TestCommandReadArgsFromStdIn/invalid_string (0.00s) + --- PASS: TestCommandReadArgsFromStdIn/invalid_string2 (0.00s) + --- PASS: TestCommandReadArgsFromStdIn/incomplete_string (0.00s) +=== RUN TestJSONExportCommand +--- PASS: TestJSONExportCommand (0.00s) +=== RUN TestCompletionDisable +--- PASS: TestCompletionDisable (0.00s) +=== RUN TestCompletionEnable +--- PASS: TestCompletionEnable (0.00s) +=== RUN TestCompletionEnableDiffCommandName +--- PASS: TestCompletionEnableDiffCommandName (0.00s) +=== RUN TestCompletionShell +=== RUN TestCompletionShell/bash +#! /bin/bash + +: ${PROG:=$(basename ${BASH_SOURCE})} + +# Macs have bash3 for which the bash-completion package doesn't include +# _init_completion. This is a minimal version of that function. +_cli_init_completion() { + COMPREPLY=() + _get_comp_words_by_ref "$@" cur prev words cword +} + +_cli_bash_autocomplete() { + if [[ "${COMP_WORDS[0]}" != "source" ]]; then + local cur opts base words + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + if declare -F _init_completion >/dev/null 2>&1; then + _init_completion -n "=:" || return + else + _cli_init_completion -n "=:" || return + fi + words=("${words[@]:0:$cword}") + if [[ "$cur" == "-"* ]]; then + requestComp="${words[*]} ${cur} --generate-shell-completion" + else + requestComp="${words[*]} --generate-shell-completion" + fi + opts=$(eval "${requestComp}" 2>/dev/null) + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} + +complete -o bashdefault -o default -o nospace -F _cli_bash_autocomplete $PROG +unset PROG +=== RUN TestCompletionShell/ps +$fn = $($MyInvocation.MyCommand.Name) +$name = $fn -replace "(.*)\.ps1$", '$1' +Register-ArgumentCompleter -Native -CommandName $name -ScriptBlock { + param($commandName, $wordToComplete, $cursorPosition) + $other = "$wordToComplete --generate-shell-completion" + Invoke-Expression $other | ForEach-Object { + [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) + } + }=== RUN TestCompletionShell/zsh +#compdef program +compdef _program program + +# Replace all occurrences of "program" in this file with the actual name of your +# CLI program. We recommend using Find+Replace feature of your editor. Let's say +# your CLI program is called "acme", then replace like so: +# * program => acme +# * _program => _acme + +_program() { + local -a opts + local cur + cur=${words[-1]} + if [[ "$cur" == "-"* ]]; then + opts=("${(@f)$(${words[@]:0:#words[@]-1} ${cur} --generate-shell-completion)}") + else + opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-shell-completion)}") + fi + + if [[ "${opts[1]}" != "" ]]; then + _describe 'values' opts + else + _files + fi +} + +# don't run the completion function when being source-ed or eval-ed +if [ "$funcstack[1]" = "_program" ]; then + _program +fi +=== RUN TestCompletionShell/fish +# generate-completion fish shell completion + +function __fish_generate-completion_no_subcommand --description 'Test if there has been any subcommand yet' + for i in (commandline -opc) + if contains -- $i help h + return 1 + end + end + return 0 +end + +complete -c generate-completion -n '__fish_generate-completion_no_subcommand' -f -l help -s h -d 'show help' +complete -c generate-completion -n '__fish_generate-completion_no_subcommand' -f -l help -s h -d 'show help' +complete -r -c generate-completion -n '__fish_generate-completion_no_subcommand' -a 'help h' -d 'Shows a list of commands or help for one command' +--- PASS: TestCompletionShell (0.00s) + --- PASS: TestCompletionShell/bash (0.00s) + --- PASS: TestCompletionShell/ps (0.00s) + --- PASS: TestCompletionShell/zsh (0.00s) + --- PASS: TestCompletionShell/fish (0.00s) +=== RUN TestCompletionSubcommand +--- PASS: TestCompletionSubcommand (0.00s) +=== RUN TestCompletionInvalidShell +--- PASS: TestCompletionInvalidShell (0.00s) +=== RUN TestHandleExitCoder_nil +--- PASS: TestHandleExitCoder_nil (0.00s) +=== RUN TestHandleExitCoder_ExitCoder +--- PASS: TestHandleExitCoder_ExitCoder (0.00s) +=== RUN TestHandleExitCoder_ErrorExitCoder +--- PASS: TestHandleExitCoder_ErrorExitCoder (0.00s) +=== RUN TestHandleExitCoder_MultiErrorWithExitCoder +--- PASS: TestHandleExitCoder_MultiErrorWithExitCoder (0.00s) +=== RUN TestHandleExitCoder_MultiErrorWithoutExitCoder +--- PASS: TestHandleExitCoder_MultiErrorWithoutExitCoder (0.00s) +=== RUN TestHandleExitCoder_ErrorWithFormat +--- PASS: TestHandleExitCoder_ErrorWithFormat (0.00s) +=== RUN TestHandleExitCoder_MultiErrorWithFormat +--- PASS: TestHandleExitCoder_MultiErrorWithFormat (0.00s) +=== RUN TestMultiErrorErrorsCopy +--- PASS: TestMultiErrorErrorsCopy (0.00s) +=== RUN TestErrRequiredFlags_Error +--- PASS: TestErrRequiredFlags_Error (0.00s) +=== RUN TestFishCompletion +--- PASS: TestFishCompletion (0.00s) +=== RUN TestBoolWithInverseBasic +=== RUN TestBoolWithInverseBasic/--no-envfalse_true_ +=== RUN TestBoolWithInverseBasic/--envtrue_true_ +=== RUN TestBoolWithInverseBasic/false_false_ +=== RUN TestBoolWithInverseBasic/--env_--no-envfalse_false_cannot_set_both_flags_`--env`_and_`--no-env` +--- PASS: TestBoolWithInverseBasic (0.00s) + --- PASS: TestBoolWithInverseBasic/--no-envfalse_true_ (0.00s) + --- PASS: TestBoolWithInverseBasic/--envtrue_true_ (0.00s) + --- PASS: TestBoolWithInverseBasic/false_false_ (0.00s) + --- PASS: TestBoolWithInverseBasic/--env_--no-envfalse_false_cannot_set_both_flags_`--env`_and_`--no-env` (0.00s) +=== RUN TestBoolWithInverseAction +=== RUN TestBoolWithInverseAction/--no-envtrue_true_ +=== RUN TestBoolWithInverseAction/--envfalse_true_ +=== RUN TestBoolWithInverseAction/false_false_ +=== RUN TestBoolWithInverseAction/--env_--no-envfalse_false_cannot_set_both_flags_`--env`_and_`--no-env` +--- PASS: TestBoolWithInverseAction (0.00s) + --- PASS: TestBoolWithInverseAction/--no-envtrue_true_ (0.00s) + --- PASS: TestBoolWithInverseAction/--envfalse_true_ (0.00s) + --- PASS: TestBoolWithInverseAction/false_false_ (0.00s) + --- PASS: TestBoolWithInverseAction/--env_--no-envfalse_false_cannot_set_both_flags_`--env`_and_`--no-env` (0.00s) +=== RUN TestBoolWithInverseAlias +=== RUN TestBoolWithInverseAlias/--no-efalse_true_ +=== RUN TestBoolWithInverseAlias/--etrue_true_ +=== RUN TestBoolWithInverseAlias/false_false_ +=== RUN TestBoolWithInverseAlias/--do-env_--no-do-envfalse_false_cannot_set_both_flags_`--env`_and_`--no-env` +--- PASS: TestBoolWithInverseAlias (0.00s) + --- PASS: TestBoolWithInverseAlias/--no-efalse_true_ (0.00s) + --- PASS: TestBoolWithInverseAlias/--etrue_true_ (0.00s) + --- PASS: TestBoolWithInverseAlias/false_false_ (0.00s) + --- PASS: TestBoolWithInverseAlias/--do-env_--no-do-envfalse_false_cannot_set_both_flags_`--env`_and_`--no-env` (0.00s) +=== RUN TestBoolWithInverseEnvVars +=== RUN TestBoolWithInverseEnvVars/false_true_ +=== RUN TestBoolWithInverseEnvVars/true_true_ +=== RUN TestBoolWithInverseEnvVars/false_true_#01 +=== RUN TestBoolWithInverseEnvVars/false_false_ +=== RUN TestBoolWithInverseEnvVars/false_false_cannot_set_both_flags_`--env`_and_`--no-env` +--- PASS: TestBoolWithInverseEnvVars (0.00s) + --- PASS: TestBoolWithInverseEnvVars/false_true_ (0.00s) + --- PASS: TestBoolWithInverseEnvVars/true_true_ (0.00s) + --- PASS: TestBoolWithInverseEnvVars/false_true_#01 (0.00s) + --- PASS: TestBoolWithInverseEnvVars/false_false_ (0.00s) + --- PASS: TestBoolWithInverseEnvVars/false_false_cannot_set_both_flags_`--env`_and_`--no-env` (0.00s) +=== RUN TestBoolWithInverseWithPrefix +=== RUN TestBoolWithInverseWithPrefix/--without-envfalse_true_ +=== RUN TestBoolWithInverseWithPrefix/--envtrue_true_ +=== RUN TestBoolWithInverseWithPrefix/false_false_ +=== RUN TestBoolWithInverseWithPrefix/--env_--without-envfalse_false_cannot_set_both_flags_`--env`_and_`--without-env` +--- PASS: TestBoolWithInverseWithPrefix (0.00s) + --- PASS: TestBoolWithInverseWithPrefix/--without-envfalse_true_ (0.00s) + --- PASS: TestBoolWithInverseWithPrefix/--envtrue_true_ (0.00s) + --- PASS: TestBoolWithInverseWithPrefix/false_false_ (0.00s) + --- PASS: TestBoolWithInverseWithPrefix/--env_--without-envfalse_false_cannot_set_both_flags_`--env`_and_`--without-env` (0.00s) +=== RUN TestBoolWithInverseRequired +=== RUN TestBoolWithInverseRequired/--no-envfalse_true_ +=== RUN TestBoolWithInverseRequired/--envtrue_true_ +=== RUN TestBoolWithInverseRequired/false_false_Required_flag_"no-env"_not_set +NAME: + prog - A new cli application + +USAGE: + prog [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +OPTIONS: + --env || --no-env + --help, -h show help +=== RUN TestBoolWithInverseRequired/--env_--no-envfalse_false_cannot_set_both_flags_`--env`_and_`--no-env` +--- PASS: TestBoolWithInverseRequired (0.00s) + --- PASS: TestBoolWithInverseRequired/--no-envfalse_true_ (0.00s) + --- PASS: TestBoolWithInverseRequired/--envtrue_true_ (0.00s) + --- PASS: TestBoolWithInverseRequired/false_false_Required_flag_"no-env"_not_set (0.00s) + --- PASS: TestBoolWithInverseRequired/--env_--no-envfalse_false_cannot_set_both_flags_`--env`_and_`--no-env` (0.00s) +=== RUN TestBoolWithInverseNames +--- PASS: TestBoolWithInverseNames (0.00s) +=== RUN TestBoolWithInverseDestination +--- PASS: TestBoolWithInverseDestination (0.00s) +=== RUN TestFlagMutuallyExclusiveFlags +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --help, -h show help + -i value (default: 0) + -s value + -t value, --ai value (default: 0) +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --help, -h show help + -i value (default: 0) + -s value + -t value, --ai value (default: 0) +NAME: + foo - A new cli application + +USAGE: + foo [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +OPTIONS: + --help, -h show help + -i value (default: 0) + -s value + -t value, --ai value (default: 0) +NAME: + foo - A new cli application + +USAGE: + foo [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +OPTIONS: + --help, -h show help + -i value (default: 0) + -s value + -t value, --ai value (default: 0) +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --help, -h show help + -i value (default: 0) + -s value + -t value, --ai value (default: 0) +NAME: + foo - A new cli application + +USAGE: + foo [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +OPTIONS: + --help, -h show help + -i value (default: 0) + -s value + -t value, --ai value (default: 0) +--- PASS: TestFlagMutuallyExclusiveFlags (0.01s) +=== RUN TestBoolFlagHelpOutput +--- PASS: TestBoolFlagHelpOutput (0.00s) +=== RUN TestBoolFlagApply_SetsAllNames +--- PASS: TestBoolFlagApply_SetsAllNames (0.00s) +=== RUN TestBoolFlagValueFromCommand +--- PASS: TestBoolFlagValueFromCommand (0.00s) +=== RUN TestBoolFlagApply_SetsCount +--- PASS: TestBoolFlagApply_SetsCount (0.00s) +=== RUN TestBoolFlagCountFromCommand +NAME: + main - A new cli application + +USAGE: + main [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --tf, -w, --huh (default: false) + --help, -h show help +NAME: + main - A new cli application + +USAGE: + main [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --tf, -w, --huh (default: false) + --help, -h show help +NAME: + main - A new cli application + +USAGE: + main [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --tf, -w, --huh (default: false) + --help, -h show help +--- PASS: TestBoolFlagCountFromCommand (0.01s) +=== RUN TestFlagsFromEnv +=== RUN TestFlagsFromEnv/BoolFlag_valid_true +=== RUN TestFlagsFromEnv/BoolFlag_valid_false +=== RUN TestFlagsFromEnv/BoolFlag_invalid +Incorrect Usage: could not parse "foobar" as bool value from environment variable "DEBUG" for flag debug: parse error + +NAME: + run - A new cli application + +USAGE: + run [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --debug (default: false) [$DEBUG] + --help, -h show help +=== RUN TestFlagsFromEnv/DurationFlag_valid +=== RUN TestFlagsFromEnv/DurationFlag_invalid +Incorrect Usage: could not parse "foobar" as time.Duration value from environment variable "TIME" for flag time: time: invalid duration "foobar" + +NAME: + run - A new cli application + +USAGE: + run [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --time value (default: 0s) [$TIME] + --help, -h show help +=== RUN TestFlagsFromEnv/Float64Flag_valid +=== RUN TestFlagsFromEnv/Float64Flag_valid_from_int +=== RUN TestFlagsFromEnv/Float64Flag_invalid +Incorrect Usage: could not parse "foobar" as float64 value from environment variable "SECONDS" for flag seconds: strconv.ParseFloat: parsing "foobar": invalid syntax + +NAME: + run - A new cli application + +USAGE: + run [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --seconds value (default: 0) [$SECONDS] + --help, -h show help +=== RUN TestFlagsFromEnv/IntFlag_valid +=== RUN TestFlagsFromEnv/IntFlag_invalid_from_float +Incorrect Usage: could not parse "1.2" as int64 value from environment variable "SECONDS" for flag seconds: strconv.ParseInt: parsing "1.2": invalid syntax + +NAME: + run - A new cli application + +USAGE: + run [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --seconds value (default: 0) [$SECONDS] + --help, -h show help +=== RUN TestFlagsFromEnv/IntFlag_invalid +Incorrect Usage: could not parse "foobar" as int64 value from environment variable "SECONDS" for flag seconds: strconv.ParseInt: parsing "foobar": invalid syntax + +NAME: + run - A new cli application + +USAGE: + run [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --seconds value (default: 0) [$SECONDS] + --help, -h show help +=== RUN TestFlagsFromEnv/IntFlag_valid_from_hex +=== RUN TestFlagsFromEnv/IntFlag_invalid_from_octal +Incorrect Usage: could not parse "08" as int64 value from environment variable "SECONDS" for flag seconds: strconv.ParseInt: parsing "08": invalid syntax + +NAME: + run - A new cli application + +USAGE: + run [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --seconds value (default: 0) [$SECONDS] + --help, -h show help +=== RUN TestFlagsFromEnv/Float64SliceFlag_valid +=== RUN TestFlagsFromEnv/Float64SliceFlag_invalid +Incorrect Usage: could not parse "foobar" as []float64 value from environment variable "SECONDS" for flag seconds: strconv.ParseFloat: parsing "foobar": invalid syntax + +NAME: + run - A new cli application + +USAGE: + run [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --seconds value [ --seconds value ] [$SECONDS] + --help, -h show help +=== RUN TestFlagsFromEnv/IntSliceFlag_valid +=== RUN TestFlagsFromEnv/IntSliceFlag_invalid_from_float +Incorrect Usage: could not parse "1.2,2" as []int64 value from environment variable "SECONDS" for flag seconds: strconv.ParseInt: parsing "1.2": invalid syntax + +NAME: + run - A new cli application + +USAGE: + run [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --seconds value [ --seconds value ] [$SECONDS] + --help, -h show help +=== RUN TestFlagsFromEnv/IntSliceFlag_invalid +Incorrect Usage: could not parse "foobar" as []int64 value from environment variable "SECONDS" for flag seconds: strconv.ParseInt: parsing "foobar": invalid syntax + +NAME: + run - A new cli application + +USAGE: + run [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --seconds value [ --seconds value ] [$SECONDS] + --help, -h show help +=== RUN TestFlagsFromEnv/UintSliceFlag_valid +=== RUN TestFlagsFromEnv/UintSliceFlag_invalid_with_float +Incorrect Usage: could not parse "1.2,2" as []uint64 value from environment variable "SECONDS" for flag seconds: strconv.ParseUint: parsing "1.2": invalid syntax + +NAME: + run - A new cli application + +USAGE: + run [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --seconds value [ --seconds value ] [$SECONDS] + --help, -h show help +=== RUN TestFlagsFromEnv/UintSliceFlag_invalid +Incorrect Usage: could not parse "foobar" as []uint64 value from environment variable "SECONDS" for flag seconds: strconv.ParseUint: parsing "foobar": invalid syntax + +NAME: + run - A new cli application + +USAGE: + run [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --seconds value [ --seconds value ] [$SECONDS] + --help, -h show help +=== RUN TestFlagsFromEnv/StringFlag_valid +=== RUN TestFlagsFromEnv/StringFlag_valid_with_TrimSpace +=== RUN TestFlagsFromEnv/StringSliceFlag_valid +=== RUN TestFlagsFromEnv/StringSliceFlag_valid_with_TrimSpace +=== RUN TestFlagsFromEnv/StringMapFlag_valid +=== RUN TestFlagsFromEnv/StringMapFlag_valid_with_TrimSpace +=== RUN TestFlagsFromEnv/UintFlag_valid +=== RUN TestFlagsFromEnv/UintFlag_valid_leading_zero +=== RUN TestFlagsFromEnv/UintFlag_valid_from_octal +=== RUN TestFlagsFromEnv/UintFlag_valid_from_hex +=== RUN TestFlagsFromEnv/UintFlag_invalid_octal +Incorrect Usage: could not parse "08" as uint64 value from environment variable "SECONDS" for flag seconds: strconv.ParseUint: parsing "08": invalid syntax + +NAME: + run - A new cli application + +USAGE: + run [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --seconds value (default: 0) [$SECONDS] + --help, -h show help +=== RUN TestFlagsFromEnv/UintFlag_invalid_float +Incorrect Usage: could not parse "1.2" as uint64 value from environment variable "SECONDS" for flag seconds: strconv.ParseUint: parsing "1.2": invalid syntax + +NAME: + run - A new cli application + +USAGE: + run [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --seconds value (default: 0) [$SECONDS] + --help, -h show help +=== RUN TestFlagsFromEnv/UintFlag_invalid +Incorrect Usage: could not parse "foobar" as uint64 value from environment variable "SECONDS" for flag seconds: strconv.ParseUint: parsing "foobar": invalid syntax + +NAME: + run - A new cli application + +USAGE: + run [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --seconds value (default: 0) [$SECONDS] + --help, -h show help +--- PASS: TestFlagsFromEnv (0.04s) + --- PASS: TestFlagsFromEnv/BoolFlag_valid_true (0.00s) + --- PASS: TestFlagsFromEnv/BoolFlag_valid_false (0.00s) + --- PASS: TestFlagsFromEnv/BoolFlag_invalid (0.00s) + --- PASS: TestFlagsFromEnv/DurationFlag_valid (0.00s) + --- PASS: TestFlagsFromEnv/DurationFlag_invalid (0.00s) + --- PASS: TestFlagsFromEnv/Float64Flag_valid (0.00s) + --- PASS: TestFlagsFromEnv/Float64Flag_valid_from_int (0.00s) + --- PASS: TestFlagsFromEnv/Float64Flag_invalid (0.00s) + --- PASS: TestFlagsFromEnv/IntFlag_valid (0.00s) + --- PASS: TestFlagsFromEnv/IntFlag_invalid_from_float (0.00s) + --- PASS: TestFlagsFromEnv/IntFlag_invalid (0.00s) + --- PASS: TestFlagsFromEnv/IntFlag_valid_from_hex (0.00s) + --- PASS: TestFlagsFromEnv/IntFlag_invalid_from_octal (0.00s) + --- PASS: TestFlagsFromEnv/Float64SliceFlag_valid (0.00s) + --- PASS: TestFlagsFromEnv/Float64SliceFlag_invalid (0.00s) + --- PASS: TestFlagsFromEnv/IntSliceFlag_valid (0.00s) + --- PASS: TestFlagsFromEnv/IntSliceFlag_invalid_from_float (0.00s) + --- PASS: TestFlagsFromEnv/IntSliceFlag_invalid (0.00s) + --- PASS: TestFlagsFromEnv/UintSliceFlag_valid (0.00s) + --- PASS: TestFlagsFromEnv/UintSliceFlag_invalid_with_float (0.00s) + --- PASS: TestFlagsFromEnv/UintSliceFlag_invalid (0.00s) + --- PASS: TestFlagsFromEnv/StringFlag_valid (0.00s) + --- PASS: TestFlagsFromEnv/StringFlag_valid_with_TrimSpace (0.00s) + --- PASS: TestFlagsFromEnv/StringSliceFlag_valid (0.00s) + --- PASS: TestFlagsFromEnv/StringSliceFlag_valid_with_TrimSpace (0.00s) + --- PASS: TestFlagsFromEnv/StringMapFlag_valid (0.00s) + --- PASS: TestFlagsFromEnv/StringMapFlag_valid_with_TrimSpace (0.00s) + --- PASS: TestFlagsFromEnv/UintFlag_valid (0.00s) + --- PASS: TestFlagsFromEnv/UintFlag_valid_leading_zero (0.00s) + --- PASS: TestFlagsFromEnv/UintFlag_valid_from_octal (0.00s) + --- PASS: TestFlagsFromEnv/UintFlag_valid_from_hex (0.00s) + --- PASS: TestFlagsFromEnv/UintFlag_invalid_octal (0.00s) + --- PASS: TestFlagsFromEnv/UintFlag_invalid_float (0.00s) + --- PASS: TestFlagsFromEnv/UintFlag_invalid (0.00s) +=== RUN TestFlagStringifying +=== RUN TestFlagStringifying/bool-flag +=== RUN TestFlagStringifying/bool-flag-with-default-text +=== RUN TestFlagStringifying/duration-flag +=== RUN TestFlagStringifying/duration-flag-with-default-text +=== RUN TestFlagStringifying/float64-flag +=== RUN TestFlagStringifying/float64-flag-with-default-text +=== RUN TestFlagStringifying/float64-slice-flag +=== RUN TestFlagStringifying/float64-slice-flag-with-default-text +=== RUN TestFlagStringifying/int-flag +=== RUN TestFlagStringifying/int-flag-with-default-text +=== RUN TestFlagStringifying/int-slice-flag +=== RUN TestFlagStringifying/int-slice-flag-with-default-text +=== RUN TestFlagStringifying/uint-slice-flag +=== RUN TestFlagStringifying/uint-slice-flag-with-default-text +=== RUN TestFlagStringifying/int64-flag +=== RUN TestFlagStringifying/int64-flag-with-default-text +=== RUN TestFlagStringifying/uint64-slice-flag +=== RUN TestFlagStringifying/uint64-slice-flag-with-default-text +=== RUN TestFlagStringifying/string-flag +=== RUN TestFlagStringifying/string-flag-with-default-text +=== RUN TestFlagStringifying/string-slice-flag +=== RUN TestFlagStringifying/string-slice-flag-with-default-text +=== RUN TestFlagStringifying/timestamp-flag +=== RUN TestFlagStringifying/timestamp-flag-with-default-text +=== RUN TestFlagStringifying/uint-flag +=== RUN TestFlagStringifying/uint-flag-with-default-text +=== RUN TestFlagStringifying/uint64-flag +=== RUN TestFlagStringifying/uint64-flag-with-default-text +=== RUN TestFlagStringifying/nodoc-flag +--- PASS: TestFlagStringifying (0.00s) + --- PASS: TestFlagStringifying/bool-flag (0.00s) + --- PASS: TestFlagStringifying/bool-flag-with-default-text (0.00s) + --- PASS: TestFlagStringifying/duration-flag (0.00s) + --- PASS: TestFlagStringifying/duration-flag-with-default-text (0.00s) + --- PASS: TestFlagStringifying/float64-flag (0.00s) + --- PASS: TestFlagStringifying/float64-flag-with-default-text (0.00s) + --- PASS: TestFlagStringifying/float64-slice-flag (0.00s) + --- PASS: TestFlagStringifying/float64-slice-flag-with-default-text (0.00s) + --- PASS: TestFlagStringifying/int-flag (0.00s) + --- PASS: TestFlagStringifying/int-flag-with-default-text (0.00s) + --- PASS: TestFlagStringifying/int-slice-flag (0.00s) + --- PASS: TestFlagStringifying/int-slice-flag-with-default-text (0.00s) + --- PASS: TestFlagStringifying/uint-slice-flag (0.00s) + --- PASS: TestFlagStringifying/uint-slice-flag-with-default-text (0.00s) + --- PASS: TestFlagStringifying/int64-flag (0.00s) + --- PASS: TestFlagStringifying/int64-flag-with-default-text (0.00s) + --- PASS: TestFlagStringifying/uint64-slice-flag (0.00s) + --- PASS: TestFlagStringifying/uint64-slice-flag-with-default-text (0.00s) + --- PASS: TestFlagStringifying/string-flag (0.00s) + --- PASS: TestFlagStringifying/string-flag-with-default-text (0.00s) + --- PASS: TestFlagStringifying/string-slice-flag (0.00s) + --- PASS: TestFlagStringifying/string-slice-flag-with-default-text (0.00s) + --- PASS: TestFlagStringifying/timestamp-flag (0.00s) + --- PASS: TestFlagStringifying/timestamp-flag-with-default-text (0.00s) + --- PASS: TestFlagStringifying/uint-flag (0.00s) + --- PASS: TestFlagStringifying/uint-flag-with-default-text (0.00s) + --- PASS: TestFlagStringifying/uint64-flag (0.00s) + --- PASS: TestFlagStringifying/uint64-flag-with-default-text (0.00s) + --- PASS: TestFlagStringifying/nodoc-flag (0.00s) +=== RUN TestStringFlagHelpOutput +--- PASS: TestStringFlagHelpOutput (0.00s) +=== RUN TestStringFlagDefaultText +--- PASS: TestStringFlagDefaultText (0.00s) +=== RUN TestStringFlagWithEnvVarHelpOutput +--- PASS: TestStringFlagWithEnvVarHelpOutput (0.00s) +=== RUN TestStringFlagApply_SetsAllNames +--- PASS: TestStringFlagApply_SetsAllNames (0.00s) +=== RUN TestStringFlagValueFromCommand +--- PASS: TestStringFlagValueFromCommand (0.00s) +=== RUN TestStringSliceFlagHelpOutput +--- PASS: TestStringSliceFlagHelpOutput (0.00s) +=== RUN TestStringSliceFlagWithEnvVarHelpOutput +--- PASS: TestStringSliceFlagWithEnvVarHelpOutput (0.00s) +=== RUN TestStringSliceFlagApply_SetsAllNames +--- PASS: TestStringSliceFlagApply_SetsAllNames (0.00s) +=== RUN TestStringSliceFlagApply_UsesEnvValues_noDefault +--- PASS: TestStringSliceFlagApply_UsesEnvValues_noDefault (0.00s) +=== RUN TestStringSliceFlagApply_UsesEnvValues_withDefault +--- PASS: TestStringSliceFlagApply_UsesEnvValues_withDefault (0.00s) +=== RUN TestStringSliceFlagApply_DefaultValueWithDestination +--- PASS: TestStringSliceFlagApply_DefaultValueWithDestination (0.00s) +=== RUN TestStringSliceFlagValueFromCommand +--- PASS: TestStringSliceFlagValueFromCommand (0.00s) +=== RUN TestIntFlagHelpOutput +--- PASS: TestIntFlagHelpOutput (0.00s) +=== RUN TestIntFlagWithEnvVarHelpOutput +--- PASS: TestIntFlagWithEnvVarHelpOutput (0.00s) +=== RUN TestIntFlagApply_SetsAllNames +--- PASS: TestIntFlagApply_SetsAllNames (0.00s) +=== RUN TestIntFlagValueFromCommand +--- PASS: TestIntFlagValueFromCommand (0.00s) +=== RUN TestUintFlagHelpOutput +--- PASS: TestUintFlagHelpOutput (0.00s) +=== RUN TestUintFlagWithEnvVarHelpOutput +--- PASS: TestUintFlagWithEnvVarHelpOutput (0.00s) +=== RUN TestUintFlagValueFromCommand +--- PASS: TestUintFlagValueFromCommand (0.00s) +=== RUN TestUint64FlagHelpOutput +--- PASS: TestUint64FlagHelpOutput (0.00s) +=== RUN TestUint64FlagWithEnvVarHelpOutput +--- PASS: TestUint64FlagWithEnvVarHelpOutput (0.00s) +=== RUN TestUint64FlagValueFromCommand +--- PASS: TestUint64FlagValueFromCommand (0.00s) +=== RUN TestDurationFlagHelpOutput +--- PASS: TestDurationFlagHelpOutput (0.00s) +=== RUN TestDurationFlagWithEnvVarHelpOutput +--- PASS: TestDurationFlagWithEnvVarHelpOutput (0.00s) +=== RUN TestDurationFlagApply_SetsAllNames +--- PASS: TestDurationFlagApply_SetsAllNames (0.00s) +=== RUN TestDurationFlagValueFromCommand +--- PASS: TestDurationFlagValueFromCommand (0.00s) +=== RUN TestIntSliceFlagHelpOutput +--- PASS: TestIntSliceFlagHelpOutput (0.00s) +=== RUN TestIntSliceFlagWithEnvVarHelpOutput +--- PASS: TestIntSliceFlagWithEnvVarHelpOutput (0.00s) +=== RUN TestIntSliceFlagApply_SetsAllNames +--- PASS: TestIntSliceFlagApply_SetsAllNames (0.00s) +=== RUN TestIntSliceFlagApply_UsesEnvValues_noDefault +--- PASS: TestIntSliceFlagApply_UsesEnvValues_noDefault (0.00s) +=== RUN TestIntSliceFlagApply_UsesEnvValues_withDefault +--- PASS: TestIntSliceFlagApply_UsesEnvValues_withDefault (0.00s) +=== RUN TestIntSliceFlagApply_DefaultValueWithDestination +--- PASS: TestIntSliceFlagApply_DefaultValueWithDestination (0.00s) +=== RUN TestIntSliceFlagApply_ParentContext +--- PASS: TestIntSliceFlagApply_ParentContext (0.00s) +=== RUN TestIntSliceFlag_SetFromParentCommand +--- PASS: TestIntSliceFlag_SetFromParentCommand (0.00s) +=== RUN TestIntSliceFlagValueFromCommand +--- PASS: TestIntSliceFlagValueFromCommand (0.00s) +=== RUN TestUintSliceFlagHelpOutput +=== RUN TestUintSliceFlagHelpOutput/heads +=== RUN TestUintSliceFlagHelpOutput/H +=== RUN TestUintSliceFlagHelpOutput/heads#01 +--- PASS: TestUintSliceFlagHelpOutput (0.00s) + --- PASS: TestUintSliceFlagHelpOutput/heads (0.00s) + --- PASS: TestUintSliceFlagHelpOutput/H (0.00s) + --- PASS: TestUintSliceFlagHelpOutput/heads#01 (0.00s) +=== RUN TestUintSliceFlagWithEnvVarHelpOutput +--- PASS: TestUintSliceFlagWithEnvVarHelpOutput (0.00s) +=== RUN TestUintSliceFlagApply_SetsAllNames +--- PASS: TestUintSliceFlagApply_SetsAllNames (0.00s) +=== RUN TestUintSliceFlagApply_UsesEnvValues_noDefault +--- PASS: TestUintSliceFlagApply_UsesEnvValues_noDefault (0.00s) +=== RUN TestUintSliceFlagApply_UsesEnvValues_withDefault +--- PASS: TestUintSliceFlagApply_UsesEnvValues_withDefault (0.00s) +=== RUN TestUintSliceFlagApply_DefaultValueWithDestination +--- PASS: TestUintSliceFlagApply_DefaultValueWithDestination (0.00s) +=== RUN TestUintSliceFlagApply_ParentContext +--- PASS: TestUintSliceFlagApply_ParentContext (0.00s) +=== RUN TestUintSliceFlag_SetFromParentCommand +--- PASS: TestUintSliceFlag_SetFromParentCommand (0.00s) +=== RUN TestUintSliceFlag_ReturnNil +--- PASS: TestUintSliceFlag_ReturnNil (0.00s) +=== RUN TestUint64SliceFlagHelpOutput +--- PASS: TestUint64SliceFlagHelpOutput (0.00s) +=== RUN TestUint64SliceFlagWithEnvVarHelpOutput +--- PASS: TestUint64SliceFlagWithEnvVarHelpOutput (0.00s) +=== RUN TestUint64SliceFlagApply_SetsAllNames +--- PASS: TestUint64SliceFlagApply_SetsAllNames (0.00s) +=== RUN TestUint64SliceFlagApply_UsesEnvValues_noDefault +--- PASS: TestUint64SliceFlagApply_UsesEnvValues_noDefault (0.00s) +=== RUN TestUint64SliceFlagApply_UsesEnvValues_withDefault +--- PASS: TestUint64SliceFlagApply_UsesEnvValues_withDefault (0.00s) +=== RUN TestUint64SliceFlagApply_DefaultValueWithDestination +--- PASS: TestUint64SliceFlagApply_DefaultValueWithDestination (0.00s) +=== RUN TestUint64SliceFlagApply_ParentCommand +--- PASS: TestUint64SliceFlagApply_ParentCommand (0.00s) +=== RUN TestUint64SliceFlag_SetFromParentCommand +--- PASS: TestUint64SliceFlag_SetFromParentCommand (0.00s) +=== RUN TestUint64SliceFlag_ReturnNil +--- PASS: TestUint64SliceFlag_ReturnNil (0.00s) +=== RUN TestFloat64FlagHelpOutput +--- PASS: TestFloat64FlagHelpOutput (0.00s) +=== RUN TestFloat64FlagWithEnvVarHelpOutput +--- PASS: TestFloat64FlagWithEnvVarHelpOutput (0.00s) +=== RUN TestFloat64FlagApply_SetsAllNames +--- PASS: TestFloat64FlagApply_SetsAllNames (0.00s) +=== RUN TestFloat64FlagValueFromCommand +--- PASS: TestFloat64FlagValueFromCommand (0.00s) +=== RUN TestFloat64SliceFlagHelpOutput +--- PASS: TestFloat64SliceFlagHelpOutput (0.00s) +=== RUN TestFloat64SliceFlagWithEnvVarHelpOutput +--- PASS: TestFloat64SliceFlagWithEnvVarHelpOutput (0.00s) +=== RUN TestFloat64SliceFlagApply_SetsAllNames +--- PASS: TestFloat64SliceFlagApply_SetsAllNames (0.00s) +=== RUN TestFloat64SliceFlagApply_UsesEnvValues_noDefault +--- PASS: TestFloat64SliceFlagApply_UsesEnvValues_noDefault (0.00s) +=== RUN TestFloat64SliceFlagApply_UsesEnvValues_withDefault +--- PASS: TestFloat64SliceFlagApply_UsesEnvValues_withDefault (0.00s) +=== RUN TestFloat64SliceFlagApply_DefaultValueWithDestination +--- PASS: TestFloat64SliceFlagApply_DefaultValueWithDestination (0.00s) +=== RUN TestFloat64SliceFlagValueFromCommand +--- PASS: TestFloat64SliceFlagValueFromCommand (0.00s) +=== RUN TestFloat64SliceFlagApply_ParentCommand +--- PASS: TestFloat64SliceFlagApply_ParentCommand (0.00s) +=== RUN TestParseMultiString +--- PASS: TestParseMultiString (0.00s) +=== RUN TestParseDestinationString +--- PASS: TestParseDestinationString (0.00s) +=== RUN TestParseMultiStringFromEnv +--- PASS: TestParseMultiStringFromEnv (0.00s) +=== RUN TestParseMultiStringFromEnvCascade +--- PASS: TestParseMultiStringFromEnvCascade (0.00s) +=== RUN TestParseMultiStringSlice +--- PASS: TestParseMultiStringSlice (0.00s) +=== RUN TestParseMultiStringSliceWithDefaults +--- PASS: TestParseMultiStringSliceWithDefaults (0.00s) +=== RUN TestParseMultiStringSliceWithDestination +--- PASS: TestParseMultiStringSliceWithDestination (0.00s) +=== RUN TestParseMultiStringSliceWithDestinationAndEnv +--- PASS: TestParseMultiStringSliceWithDestinationAndEnv (0.00s) +=== RUN TestParseMultiFloat64SliceWithDestinationAndEnv +--- PASS: TestParseMultiFloat64SliceWithDestinationAndEnv (0.00s) +=== RUN TestParseMultiIntSliceWithDestinationAndEnv +--- PASS: TestParseMultiIntSliceWithDestinationAndEnv (0.00s) +=== RUN TestParseMultiStringSliceWithDefaultsUnset +--- PASS: TestParseMultiStringSliceWithDefaultsUnset (0.00s) +=== RUN TestParseMultiStringSliceFromEnv +--- PASS: TestParseMultiStringSliceFromEnv (0.00s) +=== RUN TestParseMultiStringSliceFromEnvWithDefaults +--- PASS: TestParseMultiStringSliceFromEnvWithDefaults (0.00s) +=== RUN TestParseMultiStringSliceFromEnvCascade +--- PASS: TestParseMultiStringSliceFromEnvCascade (0.00s) +=== RUN TestParseMultiStringSliceFromEnvCascadeWithDefaults +--- PASS: TestParseMultiStringSliceFromEnvCascadeWithDefaults (0.00s) +=== RUN TestParseMultiStringSliceFromEnvWithDestination +--- PASS: TestParseMultiStringSliceFromEnvWithDestination (0.00s) +=== RUN TestParseMultiInt +--- PASS: TestParseMultiInt (0.00s) +=== RUN TestParseDestinationInt +--- PASS: TestParseDestinationInt (0.00s) +=== RUN TestParseMultiIntFromEnv +--- PASS: TestParseMultiIntFromEnv (0.00s) +=== RUN TestParseMultiIntFromEnvCascade +--- PASS: TestParseMultiIntFromEnvCascade (0.00s) +=== RUN TestParseMultiIntSlice +--- PASS: TestParseMultiIntSlice (0.00s) +=== RUN TestParseMultiIntSliceWithDefaults +--- PASS: TestParseMultiIntSliceWithDefaults (0.00s) +=== RUN TestParseMultiIntSliceWithDefaultsUnset +--- PASS: TestParseMultiIntSliceWithDefaultsUnset (0.00s) +=== RUN TestParseMultiIntSliceFromEnv +--- PASS: TestParseMultiIntSliceFromEnv (0.00s) +=== RUN TestParseMultiIntSliceFromEnvWithDefaults +--- PASS: TestParseMultiIntSliceFromEnvWithDefaults (0.00s) +=== RUN TestParseMultiIntSliceFromEnvCascade +--- PASS: TestParseMultiIntSliceFromEnvCascade (0.00s) +=== RUN TestParseMultiFloat64 +--- PASS: TestParseMultiFloat64 (0.00s) +=== RUN TestParseDestinationFloat64 +--- PASS: TestParseDestinationFloat64 (0.00s) +=== RUN TestParseMultiFloat64FromEnv +--- PASS: TestParseMultiFloat64FromEnv (0.00s) +=== RUN TestParseMultiFloat64FromEnvCascade +--- PASS: TestParseMultiFloat64FromEnvCascade (0.00s) +=== RUN TestParseMultiFloat64SliceFromEnv +--- PASS: TestParseMultiFloat64SliceFromEnv (0.00s) +=== RUN TestParseMultiFloat64SliceFromEnvCascade +--- PASS: TestParseMultiFloat64SliceFromEnvCascade (0.00s) +=== RUN TestParseMultiBool +--- PASS: TestParseMultiBool (0.00s) +=== RUN TestParseBoolShortOptionHandle +--- PASS: TestParseBoolShortOptionHandle (0.00s) +=== RUN TestParseDestinationBool +--- PASS: TestParseDestinationBool (0.00s) +=== RUN TestParseMultiBoolFromEnv +--- PASS: TestParseMultiBoolFromEnv (0.00s) +=== RUN TestParseMultiBoolFromEnvCascade +--- PASS: TestParseMultiBoolFromEnvCascade (0.00s) +=== RUN TestParseBoolFromEnv +=== RUN TestParseBoolFromEnv/""_false +=== RUN TestParseBoolFromEnv/"1"_true +=== RUN TestParseBoolFromEnv/"false"_false +=== RUN TestParseBoolFromEnv/"true"_true +--- PASS: TestParseBoolFromEnv (0.00s) + --- PASS: TestParseBoolFromEnv/""_false (0.00s) + --- PASS: TestParseBoolFromEnv/"1"_true (0.00s) + --- PASS: TestParseBoolFromEnv/"false"_false (0.00s) + --- PASS: TestParseBoolFromEnv/"true"_true (0.00s) +=== RUN TestParseMultiBoolT +--- PASS: TestParseMultiBoolT (0.00s) +=== RUN TestStringSlice_Serialized_Set +--- PASS: TestStringSlice_Serialized_Set (0.00s) +=== RUN TestIntSlice_Serialized_Set +--- PASS: TestIntSlice_Serialized_Set (0.00s) +=== RUN TestUintSlice_Serialized_Set +--- PASS: TestUintSlice_Serialized_Set (0.00s) +=== RUN TestUint64Slice_Serialized_Set +--- PASS: TestUint64Slice_Serialized_Set (0.00s) +=== RUN TestStringMap_Serialized_Set +--- PASS: TestStringMap_Serialized_Set (0.00s) +=== RUN TestTimestamp_set +--- PASS: TestTimestamp_set (0.00s) +=== RUN TestTimestampFlagApply_SingleFormat +--- PASS: TestTimestampFlagApply_SingleFormat (0.00s) +=== RUN TestTimestampFlagApply_MultipleFormats +--- PASS: TestTimestampFlagApply_MultipleFormats (0.00s) +=== RUN TestTimestampFlagApplyValue +--- PASS: TestTimestampFlagApplyValue (0.00s) +=== RUN TestTimestampFlagApply_Fail_Parse_Wrong_Layout +--- PASS: TestTimestampFlagApply_Fail_Parse_Wrong_Layout (0.00s) +=== RUN TestTimestampFlagApply_Fail_Parse_Wrong_Time +--- PASS: TestTimestampFlagApply_Fail_Parse_Wrong_Time (0.00s) +=== RUN TestTimestampFlagApply_Timezoned +--- PASS: TestTimestampFlagApply_Timezoned (0.00s) +=== RUN TestTimestampFlagValueFromCommand +--- PASS: TestTimestampFlagValueFromCommand (0.00s) +=== RUN TestFlagDefaultValue +--- PASS: TestFlagDefaultValue (0.00s) +=== RUN TestFlagDefaultValueWithEnv +--- PASS: TestFlagDefaultValueWithEnv (0.00s) +=== RUN TestFlagValue +=== RUN TestFlagValue/stringSlice +=== RUN TestFlagValue/float64Slice +=== RUN TestFlagValue/intSlice +=== RUN TestFlagValue/uintSlice +=== RUN TestFlagValue/stringMap +--- PASS: TestFlagValue (0.00s) + --- PASS: TestFlagValue/stringSlice (0.00s) + --- PASS: TestFlagValue/float64Slice (0.00s) + --- PASS: TestFlagValue/intSlice (0.00s) + --- PASS: TestFlagValue/uintSlice (0.00s) + --- PASS: TestFlagValue/stringMap (0.00s) +=== RUN TestTimestampFlagApply_WithDestination +--- PASS: TestTimestampFlagApply_WithDestination (0.00s) +=== RUN TestSliceShortOptionHandle +--- PASS: TestSliceShortOptionHandle (0.00s) +=== RUN TestCustomizedSliceFlagSeparator +--- PASS: TestCustomizedSliceFlagSeparator (0.00s) +=== RUN TestFlagSplitMultiValues_Disabled +--- PASS: TestFlagSplitMultiValues_Disabled (0.00s) +=== RUN TestStringMapFlagHelpOutput +--- PASS: TestStringMapFlagHelpOutput (0.00s) +=== RUN TestStringMapFlagWithEnvVarHelpOutput +--- PASS: TestStringMapFlagWithEnvVarHelpOutput (0.00s) +=== RUN TestStringMapFlagApply_SetsAllNames +--- PASS: TestStringMapFlagApply_SetsAllNames (0.00s) +=== RUN TestStringMapFlagApply_UsesEnvValues_noDefault +--- PASS: TestStringMapFlagApply_UsesEnvValues_noDefault (0.00s) +=== RUN TestStringMapFlagApply_UsesEnvValues_withDefault +--- PASS: TestStringMapFlagApply_UsesEnvValues_withDefault (0.00s) +=== RUN TestStringMapFlagApply_DefaultValueWithDestination +--- PASS: TestStringMapFlagApply_DefaultValueWithDestination (0.00s) +=== RUN TestStringMapFlagValueFromCommand +--- PASS: TestStringMapFlagValueFromCommand (0.00s) +=== RUN TestStringMapFlagApply_Error +invalid value "aaa" for flag -goat: item "aaa" is missing separator "=" +Usage of test: + -goat value + (default map[]) +--- PASS: TestStringMapFlagApply_Error (0.00s) +=== RUN TestFlagDefaultValidation +Incorrect Usage: Value 2 not in range [3,10] or [20,24] + +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --if value (default: 2) + --help, -h show help +--- PASS: TestFlagDefaultValidation (0.00s) +=== RUN TestFlagValidation +Incorrect Usage: invalid value "2" for flag -it: Value 2 not in range [3,10]U[20,24] + +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --it value (default: 5) + --help, -h show help +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --it value (default: 5) + --help, -h show help +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --it value (default: 5) + --help, -h show help +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --it value (default: 5) + --help, -h show help +Incorrect Usage: invalid value "15" for flag -it: Value 15 not in range [3,10]U[20,24] + +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --it value (default: 5) + --help, -h show help +Incorrect Usage: invalid value "19" for flag -it: Value 19 not in range [3,10]U[20,24] + +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --it value (default: 5) + --help, -h show help +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --it value (default: 5) + --help, -h show help +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --it value (default: 5) + --help, -h show help +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --it value (default: 5) + --help, -h show help +Incorrect Usage: invalid value "27" for flag -it: Value 27 not in range [3,10]U[20,24] + +NAME: + foo - A new cli application + +USAGE: + foo [global options] [command [command options]] [arguments...] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --it value (default: 5) + --help, -h show help +--- PASS: TestFlagValidation (0.02s) +=== RUN Test_ShowAppHelp_NoAuthor +--- PASS: Test_ShowAppHelp_NoAuthor (0.00s) +=== RUN Test_ShowAppHelp_NoVersion +--- PASS: Test_ShowAppHelp_NoVersion (0.00s) +=== RUN Test_ShowAppHelp_HideVersion +--- PASS: Test_ShowAppHelp_HideVersion (0.00s) +=== RUN Test_ShowAppHelp_MultiLineDescription +--- PASS: Test_ShowAppHelp_MultiLineDescription (0.00s) +=== RUN Test_Help_RequiredFlagsNoDefault +--- PASS: Test_Help_RequiredFlagsNoDefault (0.00s) +=== RUN Test_Help_Custom_Flags +--- PASS: Test_Help_Custom_Flags (0.00s) +=== RUN Test_Help_Nil_Flags +--- PASS: Test_Help_Nil_Flags (0.00s) +=== RUN Test_Version_Custom_Flags +--- PASS: Test_Version_Custom_Flags (0.00s) +=== RUN Test_helpCommand_Action_ErrorIfNoTopic +--- PASS: Test_helpCommand_Action_ErrorIfNoTopic (0.00s) +=== RUN Test_helpCommand_InHelpOutput +--- PASS: Test_helpCommand_InHelpOutput (0.00s) +=== RUN TestHelpCommand_FullName +=== RUN TestHelpCommand_FullName/app_help's_FullName +=== RUN TestHelpCommand_FullName/app_help's_FullName_via_flag +=== RUN TestHelpCommand_FullName/cmd_help's_FullName +=== RUN TestHelpCommand_FullName/cmd_help's_FullName_via_flag +=== RUN TestHelpCommand_FullName/subcmd_help's_FullName +=== RUN TestHelpCommand_FullName/subcmd_help's_FullName_via_flag +--- PASS: TestHelpCommand_FullName (0.01s) + --- PASS: TestHelpCommand_FullName/app_help's_FullName (0.00s) + --- PASS: TestHelpCommand_FullName/app_help's_FullName_via_flag (0.00s) + --- SKIP: TestHelpCommand_FullName/cmd_help's_FullName (0.00s) + --- SKIP: TestHelpCommand_FullName/cmd_help's_FullName_via_flag (0.00s) + --- PASS: TestHelpCommand_FullName/subcmd_help's_FullName (0.00s) + --- PASS: TestHelpCommand_FullName/subcmd_help's_FullName_via_flag (0.00s) +=== RUN Test_helpCommand_HideHelpCommand +--- PASS: Test_helpCommand_HideHelpCommand (0.00s) +=== RUN Test_helpCommand_HideHelpFlag +Incorrect Usage: flag: help requested + +--- PASS: Test_helpCommand_HideHelpFlag (0.00s) +=== RUN Test_helpSubcommand_Action_ErrorIfNoTopic +--- PASS: Test_helpSubcommand_Action_ErrorIfNoTopic (0.00s) +=== RUN TestShowAppHelp_CommandAliases +--- PASS: TestShowAppHelp_CommandAliases (0.00s) +=== RUN TestShowCommandHelp_AppendHelp +=== RUN TestShowCommandHelp_AppendHelp/with_HideHelp +=== RUN TestShowCommandHelp_AppendHelp/with_HideHelpCommand +=== RUN TestShowCommandHelp_AppendHelp/with_Subcommand +=== RUN TestShowCommandHelp_AppendHelp/without_Subcommand +--- PASS: TestShowCommandHelp_AppendHelp (0.01s) + --- PASS: TestShowCommandHelp_AppendHelp/with_HideHelp (0.00s) + --- PASS: TestShowCommandHelp_AppendHelp/with_HideHelpCommand (0.00s) + --- PASS: TestShowCommandHelp_AppendHelp/with_Subcommand (0.00s) + --- PASS: TestShowCommandHelp_AppendHelp/without_Subcommand (0.00s) +=== RUN TestShowCommandHelp_HelpPrinter +=== RUN TestShowCommandHelp_HelpPrinter/no-command +--- PASS: TestShowCommandHelp_HelpPrinter (0.00s) + --- PASS: TestShowCommandHelp_HelpPrinter/no-command (0.00s) +=== RUN TestShowCommandHelp_HelpPrinterCustom +=== RUN TestShowCommandHelp_HelpPrinterCustom/no_command + help_test.go:553: cmd.Run(ctx, [my-app help]) +=== RUN TestShowCommandHelp_HelpPrinterCustom/standard_command + help_test.go:553: cmd.Run(ctx, [my-app help my-command]) +=== RUN TestShowCommandHelp_HelpPrinterCustom/custom_template_command + help_test.go:553: cmd.Run(ctx, [my-app help my-command]) +--- PASS: TestShowCommandHelp_HelpPrinterCustom (0.00s) + --- PASS: TestShowCommandHelp_HelpPrinterCustom/no_command (0.00s) + --- PASS: TestShowCommandHelp_HelpPrinterCustom/standard_command (0.00s) + --- PASS: TestShowCommandHelp_HelpPrinterCustom/custom_template_command (0.00s) +=== RUN TestShowCommandHelp_CommandAliases +--- PASS: TestShowCommandHelp_CommandAliases (0.00s) +=== RUN TestShowSubcommandHelp_CommandAliases +--- PASS: TestShowSubcommandHelp_CommandAliases (0.00s) +=== RUN TestShowCommandHelp_Customtemplate +--- PASS: TestShowCommandHelp_Customtemplate (0.00s) +=== RUN TestShowSubcommandHelp_CommandUsageText +--- PASS: TestShowSubcommandHelp_CommandUsageText (0.00s) +=== RUN TestShowSubcommandHelp_MultiLine_CommandUsageText +--- PASS: TestShowSubcommandHelp_MultiLine_CommandUsageText (0.00s) +=== RUN TestShowSubcommandHelp_GlobalOptions +--- PASS: TestShowSubcommandHelp_GlobalOptions (0.00s) +=== RUN TestShowSubcommandHelp_SubcommandUsageText +--- PASS: TestShowSubcommandHelp_SubcommandUsageText (0.00s) +=== RUN TestShowSubcommandHelp_MultiLine_SubcommandUsageText +--- PASS: TestShowSubcommandHelp_MultiLine_SubcommandUsageText (0.00s) +=== RUN TestShowAppHelp_HiddenCommand +--- PASS: TestShowAppHelp_HiddenCommand (0.00s) +=== RUN TestShowAppHelp_HelpPrinter +=== RUN TestShowAppHelp_HelpPrinter/standard-command +=== RUN TestShowAppHelp_HelpPrinter/custom-template-command +--- PASS: TestShowAppHelp_HelpPrinter (0.00s) + --- PASS: TestShowAppHelp_HelpPrinter/standard-command (0.00s) + --- PASS: TestShowAppHelp_HelpPrinter/custom-template-command (0.00s) +=== RUN TestShowAppHelp_HelpPrinterCustom +=== RUN TestShowAppHelp_HelpPrinterCustom/standard-command +=== RUN TestShowAppHelp_HelpPrinterCustom/custom-template-command +--- PASS: TestShowAppHelp_HelpPrinterCustom (0.00s) + --- PASS: TestShowAppHelp_HelpPrinterCustom/standard-command (0.00s) + --- PASS: TestShowAppHelp_HelpPrinterCustom/custom-template-command (0.00s) +=== RUN TestShowAppHelp_CustomAppTemplate +--- PASS: TestShowAppHelp_CustomAppTemplate (0.00s) +=== RUN TestShowAppHelp_UsageText +--- PASS: TestShowAppHelp_UsageText (0.00s) +=== RUN TestShowAppHelp_MultiLine_UsageText +--- PASS: TestShowAppHelp_MultiLine_UsageText (0.00s) +=== RUN TestShowAppHelp_CommandMultiLine_UsageText +--- PASS: TestShowAppHelp_CommandMultiLine_UsageText (0.00s) +=== RUN TestHideHelpCommand +--- PASS: TestHideHelpCommand (0.00s) +=== RUN TestHideHelpCommand_False +--- PASS: TestHideHelpCommand_False (0.00s) +=== RUN TestHideHelpCommand_WithHideHelp +Incorrect Usage: flag: help requested + +--- PASS: TestHideHelpCommand_WithHideHelp (0.00s) +=== RUN TestHideHelpCommand_WithSubcommands +NAME: + cli.test - A new cli application + +USAGE: + cli.test [global options] [command [command options]] [arguments...] + +COMMANDS: + nully + +GLOBAL OPTIONS: + --help, -h show help +--- PASS: TestHideHelpCommand_WithSubcommands (0.00s) +=== RUN TestDefaultCompleteWithFlags +=== RUN TestDefaultCompleteWithFlags/empty +=== RUN TestDefaultCompleteWithFlags/typical-flag-suggestion +=== RUN TestDefaultCompleteWithFlags/typical-command-suggestion +=== RUN TestDefaultCompleteWithFlags/autocomplete-with-spaces +=== RUN TestDefaultCompleteWithFlags/zsh-autocomplete-with-flag-descriptions +=== RUN TestDefaultCompleteWithFlags/zsh-autocomplete-with-empty-flag-descriptions +--- PASS: TestDefaultCompleteWithFlags (0.00s) + --- PASS: TestDefaultCompleteWithFlags/empty (0.00s) + --- PASS: TestDefaultCompleteWithFlags/typical-flag-suggestion (0.00s) + --- PASS: TestDefaultCompleteWithFlags/typical-command-suggestion (0.00s) + --- PASS: TestDefaultCompleteWithFlags/autocomplete-with-spaces (0.00s) + --- PASS: TestDefaultCompleteWithFlags/zsh-autocomplete-with-flag-descriptions (0.00s) + --- PASS: TestDefaultCompleteWithFlags/zsh-autocomplete-with-empty-flag-descriptions (0.00s) +=== RUN TestMutuallyExclusiveFlags +--- PASS: TestMutuallyExclusiveFlags (0.00s) +=== RUN TestWrap +--- PASS: TestWrap (0.00s) +=== RUN TestWrappedHelp +--- PASS: TestWrappedHelp (0.00s) +=== RUN TestWrappedCommandHelp +--- PASS: TestWrappedCommandHelp (0.00s) +=== RUN TestWrappedSubcommandHelp +--- PASS: TestWrappedSubcommandHelp (0.00s) +=== RUN TestWrappedHelpSubcommand +--- PASS: TestWrappedHelpSubcommand (0.00s) +=== RUN TestCategorizedHelp +--- PASS: TestCategorizedHelp (0.00s) +=== RUN Test_checkShellCompleteFlag +=== PAUSE Test_checkShellCompleteFlag +=== RUN TestLexicographicLess +--- PASS: TestLexicographicLess (0.00s) +=== RUN TestJaroWinkler +--- PASS: TestJaroWinkler (0.00s) +=== RUN TestSuggestFlag +--- PASS: TestSuggestFlag (0.00s) +=== RUN TestSuggestFlagHideHelp +--- PASS: TestSuggestFlagHideHelp (0.00s) +=== RUN TestSuggestFlagFromError +--- PASS: TestSuggestFlagFromError (0.00s) +=== RUN TestSuggestFlagFromErrorWrongError +--- PASS: TestSuggestFlagFromErrorWrongError (0.00s) +=== RUN TestSuggestFlagFromErrorWrongCommand +--- PASS: TestSuggestFlagFromErrorWrongCommand (0.00s) +=== RUN TestSuggestFlagFromErrorNoSuggestion +--- PASS: TestSuggestFlagFromErrorNoSuggestion (0.00s) +=== RUN TestSuggestCommand +--- PASS: TestSuggestCommand (0.00s) +=== RUN TestEnvVarValueSource +=== RUN TestEnvVarValueSource/implements_ValueSource +=== RUN TestEnvVarValueSource/implements_ValueSource/not_found +=== RUN TestEnvVarValueSource/implements_ValueSource/found +=== RUN TestEnvVarValueSource/implements_fmt.Stringer +=== RUN TestEnvVarValueSource/implements_fmt.GoStringer +--- PASS: TestEnvVarValueSource (0.00s) + --- PASS: TestEnvVarValueSource/implements_ValueSource (0.00s) + --- PASS: TestEnvVarValueSource/implements_ValueSource/not_found (0.00s) + --- PASS: TestEnvVarValueSource/implements_ValueSource/found (0.00s) + --- PASS: TestEnvVarValueSource/implements_fmt.Stringer (0.00s) + --- PASS: TestEnvVarValueSource/implements_fmt.GoStringer (0.00s) +=== RUN TestEnvVars +--- PASS: TestEnvVars (0.00s) +=== RUN TestFileValueSource +=== RUN TestFileValueSource/implements_ValueSource +=== RUN TestFileValueSource/implements_ValueSource/not_found +=== RUN TestFileValueSource/implements_ValueSource/found +=== RUN TestFileValueSource/implements_fmt.Stringer +=== RUN TestFileValueSource/implements_fmt.GoStringer +--- PASS: TestFileValueSource (0.00s) + --- PASS: TestFileValueSource/implements_ValueSource (0.00s) + --- PASS: TestFileValueSource/implements_ValueSource/not_found (0.00s) + --- PASS: TestFileValueSource/implements_ValueSource/found (0.00s) + --- PASS: TestFileValueSource/implements_fmt.Stringer (0.00s) + --- PASS: TestFileValueSource/implements_fmt.GoStringer (0.00s) +=== RUN TestFilePaths +--- PASS: TestFilePaths (0.00s) +=== RUN TestValueSourceChainEnvKeys +--- PASS: TestValueSourceChainEnvKeys (0.00s) +=== RUN TestValueSourceChain +=== RUN TestValueSourceChain/implements_ValueSource +=== RUN TestValueSourceChain/implements_fmt.GoStringer +=== RUN TestValueSourceChain/implements_fmt.Stringer +--- PASS: TestValueSourceChain (0.00s) + --- PASS: TestValueSourceChain/implements_ValueSource (0.00s) + --- PASS: TestValueSourceChain/implements_fmt.GoStringer (0.00s) + --- PASS: TestValueSourceChain/implements_fmt.Stringer (0.00s) +=== CONT Test_checkShellCompleteFlag +=== RUN Test_checkShellCompleteFlag/disable-shell-completion +=== PAUSE Test_checkShellCompleteFlag/disable-shell-completion +=== RUN Test_checkShellCompleteFlag/child-disable-shell-completion +=== PAUSE Test_checkShellCompleteFlag/child-disable-shell-completion +=== RUN Test_checkShellCompleteFlag/last_argument_isn't_--generate-shell-completion +=== PAUSE Test_checkShellCompleteFlag/last_argument_isn't_--generate-shell-completion +=== RUN Test_checkShellCompleteFlag/arguments_include_double_dash +=== PAUSE Test_checkShellCompleteFlag/arguments_include_double_dash +=== RUN Test_checkShellCompleteFlag/shell_completion +=== PAUSE Test_checkShellCompleteFlag/shell_completion +=== CONT Test_checkShellCompleteFlag/disable-shell-completion +=== CONT Test_checkShellCompleteFlag/shell_completion +=== CONT Test_checkShellCompleteFlag/arguments_include_double_dash +=== CONT Test_checkShellCompleteFlag/last_argument_isn't_--generate-shell-completion +=== CONT Test_checkShellCompleteFlag/child-disable-shell-completion +--- PASS: Test_checkShellCompleteFlag (0.00s) + --- PASS: Test_checkShellCompleteFlag/disable-shell-completion (0.00s) + --- PASS: Test_checkShellCompleteFlag/shell_completion (0.00s) + --- PASS: Test_checkShellCompleteFlag/arguments_include_double_dash (0.00s) + --- PASS: Test_checkShellCompleteFlag/last_argument_isn't_--generate-shell-completion (0.00s) + --- PASS: Test_checkShellCompleteFlag/child-disable-shell-completion (0.00s) +=== RUN ExampleCommand_Run +--- PASS: ExampleCommand_Run (0.00s) +=== RUN ExampleCommand_Run_subcommand +--- PASS: ExampleCommand_Run_subcommand (0.00s) +=== RUN ExampleCommand_Run_appHelp +--- PASS: ExampleCommand_Run_appHelp (0.00s) +=== RUN ExampleCommand_Run_commandHelp +--- PASS: ExampleCommand_Run_commandHelp (0.00s) +=== RUN ExampleCommand_Run_noAction +--- PASS: ExampleCommand_Run_noAction (0.00s) +=== RUN ExampleCommand_Run_subcommandNoAction +--- PASS: ExampleCommand_Run_subcommandNoAction (0.00s) +=== RUN ExampleCommand_Run_shellComplete_bash_withShortFlag +--- PASS: ExampleCommand_Run_shellComplete_bash_withShortFlag (0.00s) +=== RUN ExampleCommand_Run_shellComplete_bash_withLongFlag +--- PASS: ExampleCommand_Run_shellComplete_bash_withLongFlag (0.00s) +=== RUN ExampleCommand_Run_shellComplete_bash_withMultipleLongFlag +--- PASS: ExampleCommand_Run_shellComplete_bash_withMultipleLongFlag (0.00s) +=== RUN ExampleCommand_Run_shellComplete_bash +--- PASS: ExampleCommand_Run_shellComplete_bash (0.00s) +=== RUN ExampleCommand_Run_shellComplete_zsh +--- PASS: ExampleCommand_Run_shellComplete_zsh (0.00s) +=== RUN ExampleCommand_Run_sliceValues +--- PASS: ExampleCommand_Run_sliceValues (0.00s) +=== RUN ExampleCommand_Run_mapValues +--- PASS: ExampleCommand_Run_mapValues (0.00s) +=== RUN ExampleBoolWithInverseFlag +--- PASS: ExampleBoolWithInverseFlag (0.00s) +=== RUN ExampleCommand_Suggest +--- PASS: ExampleCommand_Suggest (0.00s) +=== RUN ExampleCommand_Suggest_command +--- PASS: ExampleCommand_Suggest_command (0.00s) +FAIL +coverage: 91.5% of statements +FAIL github.com/urfave/cli/v3 0.628s +FAIL diff --git a/testdata/godoc-v3.x.txt b/testdata/godoc-v3.x.txt index 68a439fdf1..14f9a31b97 100644 --- a/testdata/godoc-v3.x.txt +++ b/testdata/godoc-v3.x.txt @@ -940,8 +940,8 @@ type SuggestFlagFunc func(flags []Flag, provided string, hideHelp bool) string type TimestampArg = ArgumentBase[time.Time, TimestampConfig, timestampValue] type TimestampConfig struct { - Timezone *time.Location - Layout string + Timezone *time.Location + AvailableLayouts []string } TimestampConfig defines the config for timestamp flags From ae10de3a70c261196be7f7f9c1f91b1af3478105 Mon Sep 17 00:00:00 2001 From: horockey Date: Wed, 7 Aug 2024 09:58:40 +0300 Subject: [PATCH 05/19] style: fix staticcheck naming --- flag_timestamp.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flag_timestamp.go b/flag_timestamp.go index f56e847fa8..dd0105910a 100644 --- a/flag_timestamp.go +++ b/flag_timestamp.go @@ -81,10 +81,10 @@ func (t *timestampValue) Set(value string) error { return err } - defaultTs, _ := time.ParseInLocation(time.TimeOnly, time.TimeOnly, timestamp.Location()) + defaultTS, _ := time.ParseInLocation(time.TimeOnly, time.TimeOnly, timestamp.Location()) // If format is missing date, set it explicitly to current - if timestamp.Truncate(time.Hour*24).UnixNano() == defaultTs.Truncate(time.Hour*24).UnixNano() { + if timestamp.Truncate(time.Hour*24).UnixNano() == defaultTS.Truncate(time.Hour*24).UnixNano() { n := time.Now() timestamp = time.Date( n.Year(), From 3195a339436ba8f0e7b15003d211201eb3eb7ee6 Mon Sep 17 00:00:00 2001 From: horockey Date: Wed, 7 Aug 2024 09:58:55 +0300 Subject: [PATCH 06/19] chore: rm temp file --- makeout.txt | 2500 --------------------------------------------------- 1 file changed, 2500 deletions(-) delete mode 100644 makeout.txt diff --git a/makeout.txt b/makeout.txt deleted file mode 100644 index c536dae03a..0000000000 --- a/makeout.txt +++ /dev/null @@ -1,2500 +0,0 @@ -go run internal/build/build.go generate -go run internal/build/build.go vet -go run internal/build/build.go test -=== RUN TestArgumentsRootCommand ---- PASS: TestArgumentsRootCommand (0.01s) -=== RUN TestArgumentsSubcommand ---- PASS: TestArgumentsSubcommand (0.00s) -=== RUN TestArgsUsage -=== RUN TestArgsUsage/optional -=== RUN TestArgsUsage/zero_or_more -=== RUN TestArgsUsage/one -=== RUN TestArgsUsage/many -=== RUN TestArgsUsage/many2 -=== RUN TestArgsUsage/unlimited ---- PASS: TestArgsUsage (0.00s) - --- PASS: TestArgsUsage/optional (0.00s) - --- PASS: TestArgsUsage/zero_or_more (0.00s) - --- PASS: TestArgsUsage/one (0.00s) - --- PASS: TestArgsUsage/many (0.00s) - --- PASS: TestArgsUsage/many2 (0.00s) - --- PASS: TestArgsUsage/unlimited (0.00s) -=== RUN TestSingleOptionalArg ---- PASS: TestSingleOptionalArg (0.01s) -=== RUN TestUnboundedArgs -=== RUN TestUnboundedArgs/cmd_accepts_no_args -=== RUN TestUnboundedArgs/cmd_uses_given_args -=== RUN TestUnboundedArgs/cmd_uses_default_values -=== RUN TestUnboundedArgs/given_args_override_default_values ---- PASS: TestUnboundedArgs (0.01s) - --- PASS: TestUnboundedArgs/cmd_accepts_no_args (0.00s) - --- PASS: TestUnboundedArgs/cmd_uses_given_args (0.00s) - --- PASS: TestUnboundedArgs/cmd_uses_default_values (0.00s) - --- PASS: TestUnboundedArgs/given_args_override_default_values (0.00s) -=== RUN TestCommandFlagParsing -=== RUN TestCommandFlagParsing/test-cmd_-break_blah_blah -Incorrect Usage: flag provided but not defined: -break - -=== RUN TestCommandFlagParsing/test-cmd_blah_blah -=== RUN TestCommandFlagParsing/test-cmd_blah_-break -=== RUN TestCommandFlagParsing/test-cmd_blah_-help -=== RUN TestCommandFlagParsing/test-cmd_blah_-h ---- PASS: TestCommandFlagParsing (0.00s) - --- PASS: TestCommandFlagParsing/test-cmd_-break_blah_blah (0.00s) - --- PASS: TestCommandFlagParsing/test-cmd_blah_blah (0.00s) - --- PASS: TestCommandFlagParsing/test-cmd_blah_-break (0.00s) - --- PASS: TestCommandFlagParsing/test-cmd_blah_-help (0.00s) - --- PASS: TestCommandFlagParsing/test-cmd_blah_-h (0.00s) -=== RUN TestParseAndRunShortOpts -=== RUN TestParseAndRunShortOpts/test_-a -=== RUN TestParseAndRunShortOpts/test_-c_arg1_arg2 -=== RUN TestParseAndRunShortOpts/test_-f -=== RUN TestParseAndRunShortOpts/test_-ac_--fgh -=== RUN TestParseAndRunShortOpts/test_-af -=== RUN TestParseAndRunShortOpts/test_-cf -=== RUN TestParseAndRunShortOpts/test_-acf -=== RUN TestParseAndRunShortOpts/test_--acf -Incorrect Usage: flag provided but not defined: -acf - -=== RUN TestParseAndRunShortOpts/test_-invalid -Incorrect Usage: flag provided but not defined: -invalid - -=== RUN TestParseAndRunShortOpts/test_-acf_-invalid -Incorrect Usage: flag provided but not defined: -invalid - -=== RUN TestParseAndRunShortOpts/test_--invalid -Incorrect Usage: flag provided but not defined: -invalid - -=== RUN TestParseAndRunShortOpts/test_-acf_--invalid -Incorrect Usage: flag provided but not defined: -invalid - -=== RUN TestParseAndRunShortOpts/test_-acf_arg1_-invalid -=== RUN TestParseAndRunShortOpts/test_-acf_arg1_--invalid -=== RUN TestParseAndRunShortOpts/test_-acfi_not-arg_arg1_-invalid -=== RUN TestParseAndRunShortOpts/test_-i_ivalue -=== RUN TestParseAndRunShortOpts/test_-i_ivalue_arg1 -=== RUN TestParseAndRunShortOpts/test_-i -Incorrect Usage: flag needs an argument: -i - ---- PASS: TestParseAndRunShortOpts (0.02s) - --- PASS: TestParseAndRunShortOpts/test_-a (0.00s) - --- PASS: TestParseAndRunShortOpts/test_-c_arg1_arg2 (0.00s) - --- PASS: TestParseAndRunShortOpts/test_-f (0.00s) - --- PASS: TestParseAndRunShortOpts/test_-ac_--fgh (0.00s) - --- PASS: TestParseAndRunShortOpts/test_-af (0.00s) - --- PASS: TestParseAndRunShortOpts/test_-cf (0.00s) - --- PASS: TestParseAndRunShortOpts/test_-acf (0.00s) - --- PASS: TestParseAndRunShortOpts/test_--acf (0.00s) - --- PASS: TestParseAndRunShortOpts/test_-invalid (0.00s) - --- PASS: TestParseAndRunShortOpts/test_-acf_-invalid (0.00s) - --- PASS: TestParseAndRunShortOpts/test_--invalid (0.00s) - --- PASS: TestParseAndRunShortOpts/test_-acf_--invalid (0.00s) - --- PASS: TestParseAndRunShortOpts/test_-acf_arg1_-invalid (0.00s) - --- PASS: TestParseAndRunShortOpts/test_-acf_arg1_--invalid (0.00s) - --- PASS: TestParseAndRunShortOpts/test_-acfi_not-arg_arg1_-invalid (0.00s) - --- PASS: TestParseAndRunShortOpts/test_-i_ivalue (0.00s) - --- PASS: TestParseAndRunShortOpts/test_-i_ivalue_arg1 (0.00s) - --- PASS: TestParseAndRunShortOpts/test_-i (0.00s) -=== RUN TestCommand_Run_DoesNotOverwriteErrorFromBefore ---- PASS: TestCommand_Run_DoesNotOverwriteErrorFromBefore (0.00s) -=== RUN TestCommand_Run_BeforeSavesMetadata ---- PASS: TestCommand_Run_BeforeSavesMetadata (0.00s) -=== RUN TestCommand_OnUsageError_hasCommandContext ---- PASS: TestCommand_OnUsageError_hasCommandContext (0.00s) -=== RUN TestCommand_OnUsageError_WithWrongFlagValue ---- PASS: TestCommand_OnUsageError_WithWrongFlagValue (0.00s) -=== RUN TestCommand_OnUsageError_WithSubcommand ---- PASS: TestCommand_OnUsageError_WithSubcommand (0.00s) -=== RUN TestCommand_Run_SubcommandsCanUseErrWriter ---- PASS: TestCommand_Run_SubcommandsCanUseErrWriter (0.00s) -=== RUN TestCommandSkipFlagParsing -=== RUN TestCommandSkipFlagParsing/some-command_some-arg_--flag_foo -=== RUN TestCommandSkipFlagParsing/some-command_some-arg_--flag=foo ---- PASS: TestCommandSkipFlagParsing (0.00s) - --- PASS: TestCommandSkipFlagParsing/some-command_some-arg_--flag_foo (0.00s) - --- PASS: TestCommandSkipFlagParsing/some-command_some-arg_--flag=foo (0.00s) -=== RUN TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags -=== RUN TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--undefined -=== RUN TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--number -=== RUN TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--number_forty-two -=== RUN TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--number_42 -=== RUN TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--number_42_newArg ---- PASS: TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags (0.00s) - --- PASS: TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--undefined (0.00s) - --- PASS: TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--number (0.00s) - --- PASS: TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--number_forty-two (0.00s) - --- PASS: TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--number_42 (0.00s) - --- PASS: TestCommand_Run_CustomShellCompleteAcceptsMalformedFlags/--number_42_newArg (0.00s) -=== RUN TestCommand_CanAddVFlagOnSubCommands ---- PASS: TestCommand_CanAddVFlagOnSubCommands (0.00s) -=== RUN TestCommand_VisibleSubcCommands ---- PASS: TestCommand_VisibleSubcCommands (0.00s) -=== RUN TestCommand_VisibleFlagCategories ---- PASS: TestCommand_VisibleFlagCategories (0.00s) -=== RUN TestCommand_RunSubcommandWithDefault ---- PASS: TestCommand_RunSubcommandWithDefault (0.00s) -=== RUN TestCommand_Run ---- PASS: TestCommand_Run (0.00s) -=== RUN TestCommand_Command ---- PASS: TestCommand_Command (0.00s) -=== RUN TestCommand_RunDefaultCommand -=== RUN TestCommand_RunDefaultCommand/command=foobar-default=foobar -NAME: - c foobar - -USAGE: - c foobar [command [command options]] - -OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommand/command=batbaz-default=foobar -NAME: - c batbaz - -USAGE: - c batbaz [command [command options]] - -OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommand/command=b-default= -NAME: - c batbaz - -USAGE: - c batbaz [command [command options]] - -OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommand/command=f-default= -NAME: - c foobar - -USAGE: - c foobar [command [command options]] - -OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommand/command=-default=foobar -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommand/command=-default= -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommand/command=_-default= -=== RUN TestCommand_RunDefaultCommand/command=bat-default=batbaz -=== RUN TestCommand_RunDefaultCommand/command=nothing-default=batbaz -=== RUN TestCommand_RunDefaultCommand/command=nothing-default= ---- PASS: TestCommand_RunDefaultCommand (0.01s) - --- PASS: TestCommand_RunDefaultCommand/command=foobar-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommand/command=batbaz-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommand/command=b-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommand/command=f-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommand/command=-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommand/command=-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommand/command=_-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommand/command=bat-default=batbaz (0.00s) - --- PASS: TestCommand_RunDefaultCommand/command=nothing-default=batbaz (0.00s) - --- PASS: TestCommand_RunDefaultCommand/command=nothing-default= (0.00s) -=== RUN TestCommand_RunDefaultCommandWithSubCommand -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=foobar-subcmd=-default=foobar -NAME: - c foobar - -USAGE: - c foobar [command [command options]] [arguments...] - -COMMANDS: - jimbob, j - carly - help, h Shows a list of commands or help for one command - -OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=foobar-subcmd=carly-default=foobar -NAME: - c foobar carly - -USAGE: - c foobar carly [command [command options]] - -OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=batbaz-subcmd=-default=foobar -NAME: - c batbaz - -USAGE: - c batbaz [command [command options]] - -OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=b-subcmd=-default= -NAME: - c batbaz - -USAGE: - c batbaz [command [command options]] - -OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=f-subcmd=-default= -NAME: - c foobar - -USAGE: - c foobar [command [command options]] [arguments...] - -COMMANDS: - jimbob, j - carly - help, h Shows a list of commands or help for one command - -OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=-default=foobar -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=-default= -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=jimbob-default=foobar -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=j-default=foobar -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=carly-default=foobar -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=jimmers-default=foobar -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=jimmers-default= -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=_-subcmd=jimmers-default=foobar -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=-default=#01 -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=_-subcmd=-default= -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=_-subcmd=j-default= -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=bat-subcmd=-default=batbaz -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=nothing-subcmd=-default=batbaz -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=nothing-subcmd=-default= -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=nothing-subcmd=j-default=batbaz -=== RUN TestCommand_RunDefaultCommandWithSubCommand/command=nothing-subcmd=carly-default= ---- PASS: TestCommand_RunDefaultCommandWithSubCommand (0.04s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=foobar-subcmd=-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=foobar-subcmd=carly-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=batbaz-subcmd=-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=b-subcmd=-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=f-subcmd=-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=jimbob-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=j-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=carly-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=jimmers-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=jimmers-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=_-subcmd=jimmers-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=-subcmd=-default=#01 (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=_-subcmd=-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=_-subcmd=j-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=bat-subcmd=-default=batbaz (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=nothing-subcmd=-default=batbaz (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=nothing-subcmd=-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=nothing-subcmd=j-default=batbaz (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithSubCommand/command=nothing-subcmd=carly-default= (0.00s) -=== RUN TestCommand_RunDefaultCommandWithFlags -=== RUN TestCommand_RunDefaultCommandWithFlags/command=foobar-flag=-default=foobar -NAME: - c foobar - -USAGE: - c foobar [command [command options]] - -OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithFlags/command=foobar-flag=-c_derp-default=foobar -NAME: - c foobar - -USAGE: - c foobar [command [command options]] - -OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithFlags/command=batbaz-flag=-default=foobar -NAME: - c batbaz - -USAGE: - c batbaz [command [command options]] - -OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithFlags/command=b-flag=-default= -NAME: - c batbaz - -USAGE: - c batbaz [command [command options]] - -OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithFlags/command=f-flag=-default= -NAME: - c foobar - -USAGE: - c foobar [command [command options]] - -OPTIONS: - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=-default=foobar -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --carly value, -c value - --jimbob, -j (default: true) - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=-default= -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --carly value, -c value - --jimbob, -j (default: true) - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=-j-default=foobar -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --carly value, -c value - --jimbob, -j (default: true) - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=-j-default=foobar#01 -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --carly value, -c value - --jimbob, -j (default: true) - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=-c_derp-default=foobar -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --carly value, -c value - --jimbob, -j (default: true) - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=--carly=derp-default=foobar -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --carly value, -c value - --jimbob, -j (default: true) - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=-j-default=foobar#02 -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --carly value, -c value - --jimbob, -j (default: true) - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=-j-default= -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --carly value, -c value - --jimbob, -j (default: true) - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithFlags/command=_-flag=-j-default=foobar -=== RUN TestCommand_RunDefaultCommandWithFlags/command=-flag=-default=#01 -NAME: - c - A new cli application - -USAGE: - c [global options] [command [command options]] [arguments...] - -COMMANDS: - foobar, f - batbaz, b - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --carly value, -c value - --jimbob, -j (default: true) - --help, -h show help -=== RUN TestCommand_RunDefaultCommandWithFlags/command=_-flag=-default= -=== RUN TestCommand_RunDefaultCommandWithFlags/command=_-flag=-j-default= -=== RUN TestCommand_RunDefaultCommandWithFlags/command=bat-flag=-default=batbaz -=== RUN TestCommand_RunDefaultCommandWithFlags/command=nothing-flag=-default=batbaz -=== RUN TestCommand_RunDefaultCommandWithFlags/command=nothing-flag=-default= -=== RUN TestCommand_RunDefaultCommandWithFlags/command=nothing-flag=--jimbob-default=batbaz -=== RUN TestCommand_RunDefaultCommandWithFlags/command=nothing-flag=--carly-default= ---- PASS: TestCommand_RunDefaultCommandWithFlags (0.04s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=foobar-flag=-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=foobar-flag=-c_derp-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=batbaz-flag=-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=b-flag=-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=f-flag=-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=-j-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=-j-default=foobar#01 (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=-c_derp-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=--carly=derp-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=-j-default=foobar#02 (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=-j-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=_-flag=-j-default=foobar (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=-flag=-default=#01 (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=_-flag=-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=_-flag=-j-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=bat-flag=-default=batbaz (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=nothing-flag=-default=batbaz (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=nothing-flag=-default= (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=nothing-flag=--jimbob-default=batbaz (0.00s) - --- PASS: TestCommand_RunDefaultCommandWithFlags/command=nothing-flag=--carly-default= (0.00s) -=== RUN TestCommand_FlagsFromExtPackage -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --carly value, -c value - --jimbob, -j (default: true) - - --help, -h show help -Incorrect Usage: flag provided but not defined: -epflag - -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --carly value, -c value - --jimbob, -j (default: true) - --help, -h show help ---- PASS: TestCommand_FlagsFromExtPackage (0.00s) -=== RUN TestCommand_Setup_defaultsReader ---- PASS: TestCommand_Setup_defaultsReader (0.00s) -=== RUN TestCommand_Setup_defaultsWriter ---- PASS: TestCommand_Setup_defaultsWriter (0.00s) -=== RUN TestCommand_CommandWithFlagBeforeTerminator ---- PASS: TestCommand_CommandWithFlagBeforeTerminator (0.00s) -=== RUN TestCommand_CommandWithDash ---- PASS: TestCommand_CommandWithDash (0.00s) -=== RUN TestCommand_CommandWithNoFlagBeforeTerminator ---- PASS: TestCommand_CommandWithNoFlagBeforeTerminator (0.00s) -=== RUN TestCommand_SkipFlagParsing ---- PASS: TestCommand_SkipFlagParsing (0.00s) -=== RUN TestCommand_VisibleCommands ---- PASS: TestCommand_VisibleCommands (0.00s) -=== RUN TestCommand_UseShortOptionHandling ---- PASS: TestCommand_UseShortOptionHandling (0.00s) -=== RUN TestCommand_UseShortOptionHandling_missing_value -Incorrect Usage: flag needs an argument: -n - ---- PASS: TestCommand_UseShortOptionHandling_missing_value (0.00s) -=== RUN TestCommand_UseShortOptionHandlingCommand ---- PASS: TestCommand_UseShortOptionHandlingCommand (0.00s) -=== RUN TestCommand_UseShortOptionHandlingCommand_missing_value -Incorrect Usage: flag needs an argument: -n - ---- PASS: TestCommand_UseShortOptionHandlingCommand_missing_value (0.00s) -=== RUN TestCommand_UseShortOptionHandlingSubCommand ---- PASS: TestCommand_UseShortOptionHandlingSubCommand (0.00s) -=== RUN TestCommand_UseShortOptionHandlingSubCommand_missing_value -Incorrect Usage: flag needs an argument: -n - ---- PASS: TestCommand_UseShortOptionHandlingSubCommand_missing_value (0.00s) -=== RUN TestCommand_UseShortOptionAfterSliceFlag ---- PASS: TestCommand_UseShortOptionAfterSliceFlag (0.00s) -=== RUN TestCommand_Float64Flag ---- PASS: TestCommand_Float64Flag (0.00s) -=== RUN TestCommand_ParseSliceFlags ---- PASS: TestCommand_ParseSliceFlags (0.00s) -=== RUN TestCommand_ParseSliceFlagsWithMissingValue ---- PASS: TestCommand_ParseSliceFlagsWithMissingValue (0.00s) -=== RUN TestCommand_DefaultStdin ---- PASS: TestCommand_DefaultStdin (0.00s) -=== RUN TestCommand_DefaultStdout ---- PASS: TestCommand_DefaultStdout (0.00s) -=== RUN TestCommand_SetStdin ---- PASS: TestCommand_SetStdin (0.00s) -=== RUN TestCommand_SetStdin_Subcommand ---- PASS: TestCommand_SetStdin_Subcommand (0.00s) -=== RUN TestCommand_SetStdout ---- PASS: TestCommand_SetStdout (0.00s) -=== RUN TestCommand_BeforeFunc ---- PASS: TestCommand_BeforeFunc (0.00s) -=== RUN TestCommand_BeforeAfterFuncShellCompletion - command_test.go:1408: TODO: is '--generate-shell-completion' (flag) still supported? ---- SKIP: TestCommand_BeforeAfterFuncShellCompletion (0.00s) -=== RUN TestCommand_AfterFunc -NAME: - command - A new cli application - -USAGE: - command [global options] [command [command options]] [arguments...] - -COMMANDS: - sub - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --opt value ---- PASS: TestCommand_AfterFunc (0.00s) -=== RUN TestCommandNoHelpFlag -Incorrect Usage: flag: help requested - ---- PASS: TestCommandNoHelpFlag (0.00s) -=== RUN TestRequiredFlagCommandRunBehavior -=== RUN TestRequiredFlagCommandRunBehavior/error_case_empty_input_with_required_flag_on_app -=== RUN TestRequiredFlagCommandRunBehavior/error_case_empty_input_with_required_flag_on_command -=== RUN TestRequiredFlagCommandRunBehavior/error_case_empty_input_with_required_flag_on_subcommand -=== RUN TestRequiredFlagCommandRunBehavior/valid_case_help_input_with_required_flag_on_app -=== RUN TestRequiredFlagCommandRunBehavior/valid_case_help_input_with_required_flag_on_command -=== RUN TestRequiredFlagCommandRunBehavior/valid_case_help_input_with_required_flag_on_subcommand -=== RUN TestRequiredFlagCommandRunBehavior/error_case_optional_input_with_required_flag_on_app -=== RUN TestRequiredFlagCommandRunBehavior/error_case_optional_input_with_required_flag_on_command -=== RUN TestRequiredFlagCommandRunBehavior/error_case_optional_input_with_required_flag_on_subcommand -=== RUN TestRequiredFlagCommandRunBehavior/valid_case_required_flag_input_on_app -=== RUN TestRequiredFlagCommandRunBehavior/valid_case_required_flag_input_on_command -=== RUN TestRequiredFlagCommandRunBehavior/valid_case_required_flag_input_on_subcommand ---- PASS: TestRequiredFlagCommandRunBehavior (0.03s) - --- PASS: TestRequiredFlagCommandRunBehavior/error_case_empty_input_with_required_flag_on_app (0.00s) - --- PASS: TestRequiredFlagCommandRunBehavior/error_case_empty_input_with_required_flag_on_command (0.00s) - --- PASS: TestRequiredFlagCommandRunBehavior/error_case_empty_input_with_required_flag_on_subcommand (0.00s) - --- PASS: TestRequiredFlagCommandRunBehavior/valid_case_help_input_with_required_flag_on_app (0.00s) - --- PASS: TestRequiredFlagCommandRunBehavior/valid_case_help_input_with_required_flag_on_command (0.00s) - --- PASS: TestRequiredFlagCommandRunBehavior/valid_case_help_input_with_required_flag_on_subcommand (0.00s) - --- PASS: TestRequiredFlagCommandRunBehavior/error_case_optional_input_with_required_flag_on_app (0.00s) - --- PASS: TestRequiredFlagCommandRunBehavior/error_case_optional_input_with_required_flag_on_command (0.00s) - --- PASS: TestRequiredFlagCommandRunBehavior/error_case_optional_input_with_required_flag_on_subcommand (0.00s) - --- PASS: TestRequiredFlagCommandRunBehavior/valid_case_required_flag_input_on_app (0.00s) - --- PASS: TestRequiredFlagCommandRunBehavior/valid_case_required_flag_input_on_command (0.00s) - --- PASS: TestRequiredFlagCommandRunBehavior/valid_case_required_flag_input_on_subcommand (0.00s) -=== RUN TestCommandHelpPrinter ---- PASS: TestCommandHelpPrinter (0.00s) -=== RUN TestCommand_VersionPrinter ---- PASS: TestCommand_VersionPrinter (0.00s) -=== RUN TestCommand_CommandNotFound ---- PASS: TestCommand_CommandNotFound (0.00s) -=== RUN TestCommand_OrderOfOperations -=== RUN TestCommand_OrderOfOperations/on_usage_error -=== RUN TestCommand_OrderOfOperations/shell_complete -=== RUN TestCommand_OrderOfOperations/nil_on_usage_error -Incorrect Usage: flag provided but not defined: -nope - -=== RUN TestCommand_OrderOfOperations/before_after_action_hooks -=== RUN TestCommand_OrderOfOperations/before_with_error -=== RUN TestCommand_OrderOfOperations/nil_after -=== RUN TestCommand_OrderOfOperations/after_errors -=== RUN TestCommand_OrderOfOperations/nil_commands ---- PASS: TestCommand_OrderOfOperations (0.01s) - --- PASS: TestCommand_OrderOfOperations/on_usage_error (0.00s) - --- PASS: TestCommand_OrderOfOperations/shell_complete (0.00s) - --- PASS: TestCommand_OrderOfOperations/nil_on_usage_error (0.00s) - --- PASS: TestCommand_OrderOfOperations/before_after_action_hooks (0.00s) - --- PASS: TestCommand_OrderOfOperations/before_with_error (0.00s) - --- PASS: TestCommand_OrderOfOperations/nil_after (0.00s) - --- PASS: TestCommand_OrderOfOperations/after_errors (0.00s) - --- PASS: TestCommand_OrderOfOperations/nil_commands (0.00s) -=== RUN TestCommand_Run_CommandWithSubcommandHasHelpTopic -=== RUN TestCommand_Run_CommandWithSubcommandHasHelpTopic/checking_with_flags_[foo_--help] -=== RUN TestCommand_Run_CommandWithSubcommandHasHelpTopic/checking_with_flags_[foo_-h] -=== RUN TestCommand_Run_CommandWithSubcommandHasHelpTopic/checking_with_flags_[foo_help] ---- PASS: TestCommand_Run_CommandWithSubcommandHasHelpTopic (0.01s) - --- PASS: TestCommand_Run_CommandWithSubcommandHasHelpTopic/checking_with_flags_[foo_--help] (0.00s) - --- PASS: TestCommand_Run_CommandWithSubcommandHasHelpTopic/checking_with_flags_[foo_-h] (0.00s) - --- PASS: TestCommand_Run_CommandWithSubcommandHasHelpTopic/checking_with_flags_[foo_help] (0.00s) -=== RUN TestCommand_Run_SubcommandFullPath ---- PASS: TestCommand_Run_SubcommandFullPath (0.00s) -=== RUN TestCommand_Run_Help -=== RUN TestCommand_Run_Help/checking_with_arguments_[boom_--help] -=== RUN TestCommand_Run_Help/checking_with_arguments_[boom_-h] -=== RUN TestCommand_Run_Help/checking_with_arguments_[boom_help] -=== RUN TestCommand_Run_Help/checking_with_arguments_[boom_--help]#01 -Incorrect Usage: flag: help requested - -=== RUN TestCommand_Run_Help/checking_with_arguments_[boom_-h]#01 -Incorrect Usage: flag: help requested - -=== RUN TestCommand_Run_Help/checking_with_arguments_[boom_help]#01 ---- PASS: TestCommand_Run_Help (0.01s) - --- PASS: TestCommand_Run_Help/checking_with_arguments_[boom_--help] (0.00s) - --- PASS: TestCommand_Run_Help/checking_with_arguments_[boom_-h] (0.00s) - --- PASS: TestCommand_Run_Help/checking_with_arguments_[boom_help] (0.00s) - --- PASS: TestCommand_Run_Help/checking_with_arguments_[boom_--help]#01 (0.00s) - --- PASS: TestCommand_Run_Help/checking_with_arguments_[boom_-h]#01 (0.00s) - --- PASS: TestCommand_Run_Help/checking_with_arguments_[boom_help]#01 (0.00s) -=== RUN TestCommand_Run_Version -=== RUN TestCommand_Run_Version/checking_with_arguments_[boom_--version] -=== RUN TestCommand_Run_Version/checking_with_arguments_[boom_-v] ---- PASS: TestCommand_Run_Version (0.00s) - --- PASS: TestCommand_Run_Version/checking_with_arguments_[boom_--version] (0.00s) - --- PASS: TestCommand_Run_Version/checking_with_arguments_[boom_-v] (0.00s) -=== RUN TestCommand_Run_Categories ---- PASS: TestCommand_Run_Categories (0.00s) -=== RUN TestCommand_VisibleCategories ---- PASS: TestCommand_VisibleCategories (0.00s) -=== RUN TestCommand_Run_SubcommandDoesNotOverwriteErrorFromBefore ---- PASS: TestCommand_Run_SubcommandDoesNotOverwriteErrorFromBefore (0.00s) -=== RUN TestCommand_OnUsageError_WithWrongFlagValue_ForSubcommand ---- PASS: TestCommand_OnUsageError_WithWrongFlagValue_ForSubcommand (0.00s) -=== RUN TestCustomFlagsUnused ---- PASS: TestCustomFlagsUnused (0.00s) -=== RUN TestCustomFlagsUsed ---- PASS: TestCustomFlagsUsed (0.00s) -=== RUN TestCustomHelpVersionFlags ---- PASS: TestCustomHelpVersionFlags (0.00s) -=== RUN TestHandleExitCoder_Default ---- PASS: TestHandleExitCoder_Default (0.00s) -=== RUN TestHandleExitCoder_Custom ---- PASS: TestHandleExitCoder_Custom (0.00s) -=== RUN TestShellCompletionForIncompleteFlags ---- PASS: TestShellCompletionForIncompleteFlags (0.00s) -=== RUN TestWhenExitSubCommandWithCodeThenCommandQuitUnexpectedly ---- PASS: TestWhenExitSubCommandWithCodeThenCommandQuitUnexpectedly (0.00s) -=== RUN TestSetupInitializesBothWriters ---- PASS: TestSetupInitializesBothWriters (0.00s) -=== RUN TestSetupInitializesOnlyNilWriters ---- PASS: TestSetupInitializesOnlyNilWriters (0.00s) -=== RUN TestFlagAction -=== RUN TestFlagAction/flag_string -=== RUN TestFlagAction/flag_string_error -=== RUN TestFlagAction/flag_string_slice -=== RUN TestFlagAction/flag_string_slice_error -=== RUN TestFlagAction/flag_bool -=== RUN TestFlagAction/flag_bool_error -=== RUN TestFlagAction/flag_duration -=== RUN TestFlagAction/flag_duration_error -=== RUN TestFlagAction/flag_float64 -=== RUN TestFlagAction/flag_float64_error -=== RUN TestFlagAction/flag_float64_slice -=== RUN TestFlagAction/flag_float64_slice_error -=== RUN TestFlagAction/flag_int -=== RUN TestFlagAction/flag_int_error -=== RUN TestFlagAction/flag_int_slice -=== RUN TestFlagAction/flag_int_slice_error -=== RUN TestFlagAction/flag_timestamp - command_test.go:2786: - Error Trace: /home/nrassudov/Repos/cli/command_test.go:2786 - Error: Not equal: - expected: "2022-05-01T02:26:20Z " - actual : "2022-05-01T02:26:20+03:00 " - - Diff: - --- Expected - +++ Actual - @@ -1 +1 @@ - -2022-05-01T02:26:20Z - +2022-05-01T02:26:20+03:00 - Test: TestFlagAction/flag_timestamp -=== RUN TestFlagAction/flag_timestamp_error - command_test.go:2781: - Error Trace: /home/nrassudov/Repos/cli/command_test.go:2781 - Error: An error is expected but got nil. - Test: TestFlagAction/flag_timestamp_error -=== RUN TestFlagAction/flag_uint -=== RUN TestFlagAction/flag_uint_error -=== RUN TestFlagAction/flag_no_action -=== RUN TestFlagAction/command_flag -=== RUN TestFlagAction/subCommand_flag -=== RUN TestFlagAction/mixture -=== RUN TestFlagAction/flag_string_map -=== RUN TestFlagAction/flag_string_map_error ---- FAIL: TestFlagAction (0.03s) - --- PASS: TestFlagAction/flag_string (0.00s) - --- PASS: TestFlagAction/flag_string_error (0.00s) - --- PASS: TestFlagAction/flag_string_slice (0.00s) - --- PASS: TestFlagAction/flag_string_slice_error (0.00s) - --- PASS: TestFlagAction/flag_bool (0.00s) - --- PASS: TestFlagAction/flag_bool_error (0.00s) - --- PASS: TestFlagAction/flag_duration (0.00s) - --- PASS: TestFlagAction/flag_duration_error (0.00s) - --- PASS: TestFlagAction/flag_float64 (0.00s) - --- PASS: TestFlagAction/flag_float64_error (0.00s) - --- PASS: TestFlagAction/flag_float64_slice (0.00s) - --- PASS: TestFlagAction/flag_float64_slice_error (0.00s) - --- PASS: TestFlagAction/flag_int (0.00s) - --- PASS: TestFlagAction/flag_int_error (0.00s) - --- PASS: TestFlagAction/flag_int_slice (0.00s) - --- PASS: TestFlagAction/flag_int_slice_error (0.00s) - --- FAIL: TestFlagAction/flag_timestamp (0.00s) - --- FAIL: TestFlagAction/flag_timestamp_error (0.00s) - --- PASS: TestFlagAction/flag_uint (0.00s) - --- PASS: TestFlagAction/flag_uint_error (0.00s) - --- PASS: TestFlagAction/flag_no_action (0.00s) - --- PASS: TestFlagAction/command_flag (0.00s) - --- PASS: TestFlagAction/subCommand_flag (0.00s) - --- PASS: TestFlagAction/mixture (0.00s) - --- PASS: TestFlagAction/flag_string_map (0.00s) - --- PASS: TestFlagAction/flag_string_map_error (0.00s) -=== RUN TestPersistentFlag ---- PASS: TestPersistentFlag (0.00s) -=== RUN TestPersistentFlagIsSet ---- PASS: TestPersistentFlagIsSet (0.00s) -=== RUN TestRequiredPersistentFlag -NAME: - root sub - -USAGE: - root sub [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -OPTIONS: - --help, -h show help ---- PASS: TestRequiredPersistentFlag (0.00s) -=== RUN TestFlagDuplicates -=== RUN TestFlagDuplicates/all_args_present_once -=== RUN TestFlagDuplicates/duplicate_non_slice_flag(duplicatable) -=== RUN TestFlagDuplicates/duplicate_non_slice_flag(non_duplicatable) -Incorrect Usage: invalid value "trip" for flag -sflag: cant duplicate this flag - -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --sflag value - --isflag value [ --isflag value ] - --fsflag value [ --fsflag value ] - --iflag value (default: 0) - --help, -h show help -=== RUN TestFlagDuplicates/duplicate_slice_flag(non_duplicatable) -Incorrect Usage: invalid value "3.0" for flag -fsflag: cant duplicate this flag - -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --sflag value - --isflag value [ --isflag value ] - --fsflag value [ --fsflag value ] - --iflag value (default: 0) - --help, -h show help ---- PASS: TestFlagDuplicates (0.01s) - --- PASS: TestFlagDuplicates/all_args_present_once (0.00s) - --- PASS: TestFlagDuplicates/duplicate_non_slice_flag(duplicatable) (0.00s) - --- PASS: TestFlagDuplicates/duplicate_non_slice_flag(non_duplicatable) (0.00s) - --- PASS: TestFlagDuplicates/duplicate_slice_flag(non_duplicatable) (0.00s) -=== RUN TestShorthandCommand ---- PASS: TestShorthandCommand (0.00s) -=== RUN TestCommand_Int ---- PASS: TestCommand_Int (0.00s) -=== RUN TestCommand_Uint ---- PASS: TestCommand_Uint (0.00s) -=== RUN TestCommand_Float64 ---- PASS: TestCommand_Float64 (0.00s) -=== RUN TestCommand_Duration ---- PASS: TestCommand_Duration (0.00s) -=== RUN TestCommand_Timestamp ---- PASS: TestCommand_Timestamp (0.00s) -=== RUN TestCommand_String ---- PASS: TestCommand_String (0.00s) -=== RUN TestCommand_Bool ---- PASS: TestCommand_Bool (0.00s) -=== RUN TestCommand_Value -=== RUN TestCommand_Value/flag_name -=== RUN TestCommand_Value/flag_aliases ---- PASS: TestCommand_Value (0.00s) - --- PASS: TestCommand_Value/flag_name (0.00s) - --- PASS: TestCommand_Value/flag_aliases (0.00s) -=== RUN TestCommand_Value_InvalidFlagAccessHandler ---- PASS: TestCommand_Value_InvalidFlagAccessHandler (0.00s) -=== RUN TestCommand_Args ---- PASS: TestCommand_Args (0.00s) -=== RUN TestCommand_NArg ---- PASS: TestCommand_NArg (0.00s) -=== RUN TestCommand_IsSet ---- PASS: TestCommand_IsSet (0.00s) -=== RUN TestCommand_IsSet_fromEnv -Incorrect Usage: could not parse "foobar" as float64 value from environment variable "APP_UNPARSABLE" for flag unparsable: strconv.ParseFloat: parsing "foobar": invalid syntax - -NAME: - run - A new cli application - -USAGE: - run [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --timeout value, -t value (default: 0) [$APP_TIMEOUT_SECONDS] - --password value, -p value [$APP_PASSWORD] - --unparsable value, -u value (default: 0) [$APP_UNPARSABLE] - --no-env-var value, -n value (default: 0) - --help, -h show help ---- PASS: TestCommand_IsSet_fromEnv (0.00s) -=== RUN TestCommand_NumFlags ---- PASS: TestCommand_NumFlags (0.00s) -=== RUN TestCommand_Set ---- PASS: TestCommand_Set (0.00s) -=== RUN TestCommand_Set_InvalidFlagAccessHandler ---- PASS: TestCommand_Set_InvalidFlagAccessHandler (0.00s) -=== RUN TestCommand_LocalFlagNames ---- PASS: TestCommand_LocalFlagNames (0.00s) -=== RUN TestCommand_FlagNames ---- PASS: TestCommand_FlagNames (0.00s) -=== RUN TestCommand_Lineage ---- PASS: TestCommand_Lineage (0.00s) -=== RUN TestCommand_lookupFlagSet ---- PASS: TestCommand_lookupFlagSet (0.00s) -=== RUN TestCommandAttributeAccessing -=== RUN TestCommandAttributeAccessing/empty -=== RUN TestCommandAttributeAccessing/empty_with_background_context -=== RUN TestCommandAttributeAccessing/empty_set_bool_and_present_ctx_bool -=== RUN TestCommandAttributeAccessing/present_set_bool_and_present_ctx_bool_with_background_context -=== RUN TestCommandAttributeAccessing/present_set_bool_and_present_ctx_bool -=== RUN TestCommandAttributeAccessing/present_set_bool_and_present_ctx_bool_with_background_context#01 -=== RUN TestCommandAttributeAccessing/present_set_bool_and_different_ctx_bool -=== RUN TestCommandAttributeAccessing/present_set_bool_and_different_ctx_bool_with_background_context ---- PASS: TestCommandAttributeAccessing (0.00s) - --- PASS: TestCommandAttributeAccessing/empty (0.00s) - --- PASS: TestCommandAttributeAccessing/empty_with_background_context (0.00s) - --- PASS: TestCommandAttributeAccessing/empty_set_bool_and_present_ctx_bool (0.00s) - --- PASS: TestCommandAttributeAccessing/present_set_bool_and_present_ctx_bool_with_background_context (0.00s) - --- PASS: TestCommandAttributeAccessing/present_set_bool_and_present_ctx_bool (0.00s) - --- PASS: TestCommandAttributeAccessing/present_set_bool_and_present_ctx_bool_with_background_context#01 (0.00s) - --- PASS: TestCommandAttributeAccessing/present_set_bool_and_different_ctx_bool (0.00s) - --- PASS: TestCommandAttributeAccessing/present_set_bool_and_different_ctx_bool_with_background_context (0.00s) -=== RUN TestCheckRequiredFlags -=== RUN TestCheckRequiredFlags/empty -=== RUN TestCheckRequiredFlags/optional -=== RUN TestCheckRequiredFlags/required -=== RUN TestCheckRequiredFlags/required_and_present -=== RUN TestCheckRequiredFlags/required_and_present_via_env_var -=== RUN TestCheckRequiredFlags/required_and_optional -=== RUN TestCheckRequiredFlags/required_and_optional_and_optional_present -=== RUN TestCheckRequiredFlags/required_and_optional_and_optional_present_via_env_var -=== RUN TestCheckRequiredFlags/required_and_optional_and_required_present -=== RUN TestCheckRequiredFlags/two_required -=== RUN TestCheckRequiredFlags/two_required_and_one_present -=== RUN TestCheckRequiredFlags/two_required_and_both_present -=== RUN TestCheckRequiredFlags/required_flag_with_short_name -=== RUN TestCheckRequiredFlags/required_flag_with_multiple_short_names -=== RUN TestCheckRequiredFlags/required_flag_with_short_alias_not_printed_on_error -=== RUN TestCheckRequiredFlags/required_flag_with_one_character ---- PASS: TestCheckRequiredFlags (0.00s) - --- PASS: TestCheckRequiredFlags/empty (0.00s) - --- PASS: TestCheckRequiredFlags/optional (0.00s) - --- PASS: TestCheckRequiredFlags/required (0.00s) - --- PASS: TestCheckRequiredFlags/required_and_present (0.00s) - --- PASS: TestCheckRequiredFlags/required_and_present_via_env_var (0.00s) - --- PASS: TestCheckRequiredFlags/required_and_optional (0.00s) - --- PASS: TestCheckRequiredFlags/required_and_optional_and_optional_present (0.00s) - --- PASS: TestCheckRequiredFlags/required_and_optional_and_optional_present_via_env_var (0.00s) - --- PASS: TestCheckRequiredFlags/required_and_optional_and_required_present (0.00s) - --- PASS: TestCheckRequiredFlags/two_required (0.00s) - --- PASS: TestCheckRequiredFlags/two_required_and_one_present (0.00s) - --- PASS: TestCheckRequiredFlags/two_required_and_both_present (0.00s) - --- PASS: TestCheckRequiredFlags/required_flag_with_short_name (0.00s) - --- PASS: TestCheckRequiredFlags/required_flag_with_multiple_short_names (0.00s) - --- PASS: TestCheckRequiredFlags/required_flag_with_short_alias_not_printed_on_error (0.00s) - --- PASS: TestCheckRequiredFlags/required_flag_with_one_character (0.00s) -=== RUN TestCommand_ParentCommand_Set ---- PASS: TestCommand_ParentCommand_Set (0.00s) -=== RUN TestCommandReadArgsFromStdIn -=== RUN TestCommandReadArgsFromStdIn/empty -=== RUN TestCommandReadArgsFromStdIn/empty2 -=== RUN TestCommandReadArgsFromStdIn/intflag-from-input -=== RUN TestCommandReadArgsFromStdIn/intflag-from-input2 -=== RUN TestCommandReadArgsFromStdIn/multiflag-from-input -=== RUN TestCommandReadArgsFromStdIn/end-args -=== RUN TestCommandReadArgsFromStdIn/invalid_string -=== RUN TestCommandReadArgsFromStdIn/invalid_string2 -Incorrect Usage: flag needs an argument: -if - -=== RUN TestCommandReadArgsFromStdIn/incomplete_string ---- PASS: TestCommandReadArgsFromStdIn (0.01s) - --- PASS: TestCommandReadArgsFromStdIn/empty (0.00s) - --- PASS: TestCommandReadArgsFromStdIn/empty2 (0.00s) - --- PASS: TestCommandReadArgsFromStdIn/intflag-from-input (0.00s) - --- PASS: TestCommandReadArgsFromStdIn/intflag-from-input2 (0.00s) - --- PASS: TestCommandReadArgsFromStdIn/multiflag-from-input (0.00s) - --- PASS: TestCommandReadArgsFromStdIn/end-args (0.00s) - --- PASS: TestCommandReadArgsFromStdIn/invalid_string (0.00s) - --- PASS: TestCommandReadArgsFromStdIn/invalid_string2 (0.00s) - --- PASS: TestCommandReadArgsFromStdIn/incomplete_string (0.00s) -=== RUN TestJSONExportCommand ---- PASS: TestJSONExportCommand (0.00s) -=== RUN TestCompletionDisable ---- PASS: TestCompletionDisable (0.00s) -=== RUN TestCompletionEnable ---- PASS: TestCompletionEnable (0.00s) -=== RUN TestCompletionEnableDiffCommandName ---- PASS: TestCompletionEnableDiffCommandName (0.00s) -=== RUN TestCompletionShell -=== RUN TestCompletionShell/bash -#! /bin/bash - -: ${PROG:=$(basename ${BASH_SOURCE})} - -# Macs have bash3 for which the bash-completion package doesn't include -# _init_completion. This is a minimal version of that function. -_cli_init_completion() { - COMPREPLY=() - _get_comp_words_by_ref "$@" cur prev words cword -} - -_cli_bash_autocomplete() { - if [[ "${COMP_WORDS[0]}" != "source" ]]; then - local cur opts base words - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - if declare -F _init_completion >/dev/null 2>&1; then - _init_completion -n "=:" || return - else - _cli_init_completion -n "=:" || return - fi - words=("${words[@]:0:$cword}") - if [[ "$cur" == "-"* ]]; then - requestComp="${words[*]} ${cur} --generate-shell-completion" - else - requestComp="${words[*]} --generate-shell-completion" - fi - opts=$(eval "${requestComp}" 2>/dev/null) - COMPREPLY=($(compgen -W "${opts}" -- ${cur})) - return 0 - fi -} - -complete -o bashdefault -o default -o nospace -F _cli_bash_autocomplete $PROG -unset PROG -=== RUN TestCompletionShell/ps -$fn = $($MyInvocation.MyCommand.Name) -$name = $fn -replace "(.*)\.ps1$", '$1' -Register-ArgumentCompleter -Native -CommandName $name -ScriptBlock { - param($commandName, $wordToComplete, $cursorPosition) - $other = "$wordToComplete --generate-shell-completion" - Invoke-Expression $other | ForEach-Object { - [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) - } - }=== RUN TestCompletionShell/zsh -#compdef program -compdef _program program - -# Replace all occurrences of "program" in this file with the actual name of your -# CLI program. We recommend using Find+Replace feature of your editor. Let's say -# your CLI program is called "acme", then replace like so: -# * program => acme -# * _program => _acme - -_program() { - local -a opts - local cur - cur=${words[-1]} - if [[ "$cur" == "-"* ]]; then - opts=("${(@f)$(${words[@]:0:#words[@]-1} ${cur} --generate-shell-completion)}") - else - opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-shell-completion)}") - fi - - if [[ "${opts[1]}" != "" ]]; then - _describe 'values' opts - else - _files - fi -} - -# don't run the completion function when being source-ed or eval-ed -if [ "$funcstack[1]" = "_program" ]; then - _program -fi -=== RUN TestCompletionShell/fish -# generate-completion fish shell completion - -function __fish_generate-completion_no_subcommand --description 'Test if there has been any subcommand yet' - for i in (commandline -opc) - if contains -- $i help h - return 1 - end - end - return 0 -end - -complete -c generate-completion -n '__fish_generate-completion_no_subcommand' -f -l help -s h -d 'show help' -complete -c generate-completion -n '__fish_generate-completion_no_subcommand' -f -l help -s h -d 'show help' -complete -r -c generate-completion -n '__fish_generate-completion_no_subcommand' -a 'help h' -d 'Shows a list of commands or help for one command' ---- PASS: TestCompletionShell (0.00s) - --- PASS: TestCompletionShell/bash (0.00s) - --- PASS: TestCompletionShell/ps (0.00s) - --- PASS: TestCompletionShell/zsh (0.00s) - --- PASS: TestCompletionShell/fish (0.00s) -=== RUN TestCompletionSubcommand ---- PASS: TestCompletionSubcommand (0.00s) -=== RUN TestCompletionInvalidShell ---- PASS: TestCompletionInvalidShell (0.00s) -=== RUN TestHandleExitCoder_nil ---- PASS: TestHandleExitCoder_nil (0.00s) -=== RUN TestHandleExitCoder_ExitCoder ---- PASS: TestHandleExitCoder_ExitCoder (0.00s) -=== RUN TestHandleExitCoder_ErrorExitCoder ---- PASS: TestHandleExitCoder_ErrorExitCoder (0.00s) -=== RUN TestHandleExitCoder_MultiErrorWithExitCoder ---- PASS: TestHandleExitCoder_MultiErrorWithExitCoder (0.00s) -=== RUN TestHandleExitCoder_MultiErrorWithoutExitCoder ---- PASS: TestHandleExitCoder_MultiErrorWithoutExitCoder (0.00s) -=== RUN TestHandleExitCoder_ErrorWithFormat ---- PASS: TestHandleExitCoder_ErrorWithFormat (0.00s) -=== RUN TestHandleExitCoder_MultiErrorWithFormat ---- PASS: TestHandleExitCoder_MultiErrorWithFormat (0.00s) -=== RUN TestMultiErrorErrorsCopy ---- PASS: TestMultiErrorErrorsCopy (0.00s) -=== RUN TestErrRequiredFlags_Error ---- PASS: TestErrRequiredFlags_Error (0.00s) -=== RUN TestFishCompletion ---- PASS: TestFishCompletion (0.00s) -=== RUN TestBoolWithInverseBasic -=== RUN TestBoolWithInverseBasic/--no-envfalse_true_ -=== RUN TestBoolWithInverseBasic/--envtrue_true_ -=== RUN TestBoolWithInverseBasic/false_false_ -=== RUN TestBoolWithInverseBasic/--env_--no-envfalse_false_cannot_set_both_flags_`--env`_and_`--no-env` ---- PASS: TestBoolWithInverseBasic (0.00s) - --- PASS: TestBoolWithInverseBasic/--no-envfalse_true_ (0.00s) - --- PASS: TestBoolWithInverseBasic/--envtrue_true_ (0.00s) - --- PASS: TestBoolWithInverseBasic/false_false_ (0.00s) - --- PASS: TestBoolWithInverseBasic/--env_--no-envfalse_false_cannot_set_both_flags_`--env`_and_`--no-env` (0.00s) -=== RUN TestBoolWithInverseAction -=== RUN TestBoolWithInverseAction/--no-envtrue_true_ -=== RUN TestBoolWithInverseAction/--envfalse_true_ -=== RUN TestBoolWithInverseAction/false_false_ -=== RUN TestBoolWithInverseAction/--env_--no-envfalse_false_cannot_set_both_flags_`--env`_and_`--no-env` ---- PASS: TestBoolWithInverseAction (0.00s) - --- PASS: TestBoolWithInverseAction/--no-envtrue_true_ (0.00s) - --- PASS: TestBoolWithInverseAction/--envfalse_true_ (0.00s) - --- PASS: TestBoolWithInverseAction/false_false_ (0.00s) - --- PASS: TestBoolWithInverseAction/--env_--no-envfalse_false_cannot_set_both_flags_`--env`_and_`--no-env` (0.00s) -=== RUN TestBoolWithInverseAlias -=== RUN TestBoolWithInverseAlias/--no-efalse_true_ -=== RUN TestBoolWithInverseAlias/--etrue_true_ -=== RUN TestBoolWithInverseAlias/false_false_ -=== RUN TestBoolWithInverseAlias/--do-env_--no-do-envfalse_false_cannot_set_both_flags_`--env`_and_`--no-env` ---- PASS: TestBoolWithInverseAlias (0.00s) - --- PASS: TestBoolWithInverseAlias/--no-efalse_true_ (0.00s) - --- PASS: TestBoolWithInverseAlias/--etrue_true_ (0.00s) - --- PASS: TestBoolWithInverseAlias/false_false_ (0.00s) - --- PASS: TestBoolWithInverseAlias/--do-env_--no-do-envfalse_false_cannot_set_both_flags_`--env`_and_`--no-env` (0.00s) -=== RUN TestBoolWithInverseEnvVars -=== RUN TestBoolWithInverseEnvVars/false_true_ -=== RUN TestBoolWithInverseEnvVars/true_true_ -=== RUN TestBoolWithInverseEnvVars/false_true_#01 -=== RUN TestBoolWithInverseEnvVars/false_false_ -=== RUN TestBoolWithInverseEnvVars/false_false_cannot_set_both_flags_`--env`_and_`--no-env` ---- PASS: TestBoolWithInverseEnvVars (0.00s) - --- PASS: TestBoolWithInverseEnvVars/false_true_ (0.00s) - --- PASS: TestBoolWithInverseEnvVars/true_true_ (0.00s) - --- PASS: TestBoolWithInverseEnvVars/false_true_#01 (0.00s) - --- PASS: TestBoolWithInverseEnvVars/false_false_ (0.00s) - --- PASS: TestBoolWithInverseEnvVars/false_false_cannot_set_both_flags_`--env`_and_`--no-env` (0.00s) -=== RUN TestBoolWithInverseWithPrefix -=== RUN TestBoolWithInverseWithPrefix/--without-envfalse_true_ -=== RUN TestBoolWithInverseWithPrefix/--envtrue_true_ -=== RUN TestBoolWithInverseWithPrefix/false_false_ -=== RUN TestBoolWithInverseWithPrefix/--env_--without-envfalse_false_cannot_set_both_flags_`--env`_and_`--without-env` ---- PASS: TestBoolWithInverseWithPrefix (0.00s) - --- PASS: TestBoolWithInverseWithPrefix/--without-envfalse_true_ (0.00s) - --- PASS: TestBoolWithInverseWithPrefix/--envtrue_true_ (0.00s) - --- PASS: TestBoolWithInverseWithPrefix/false_false_ (0.00s) - --- PASS: TestBoolWithInverseWithPrefix/--env_--without-envfalse_false_cannot_set_both_flags_`--env`_and_`--without-env` (0.00s) -=== RUN TestBoolWithInverseRequired -=== RUN TestBoolWithInverseRequired/--no-envfalse_true_ -=== RUN TestBoolWithInverseRequired/--envtrue_true_ -=== RUN TestBoolWithInverseRequired/false_false_Required_flag_"no-env"_not_set -NAME: - prog - A new cli application - -USAGE: - prog [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -OPTIONS: - --env || --no-env - --help, -h show help -=== RUN TestBoolWithInverseRequired/--env_--no-envfalse_false_cannot_set_both_flags_`--env`_and_`--no-env` ---- PASS: TestBoolWithInverseRequired (0.00s) - --- PASS: TestBoolWithInverseRequired/--no-envfalse_true_ (0.00s) - --- PASS: TestBoolWithInverseRequired/--envtrue_true_ (0.00s) - --- PASS: TestBoolWithInverseRequired/false_false_Required_flag_"no-env"_not_set (0.00s) - --- PASS: TestBoolWithInverseRequired/--env_--no-envfalse_false_cannot_set_both_flags_`--env`_and_`--no-env` (0.00s) -=== RUN TestBoolWithInverseNames ---- PASS: TestBoolWithInverseNames (0.00s) -=== RUN TestBoolWithInverseDestination ---- PASS: TestBoolWithInverseDestination (0.00s) -=== RUN TestFlagMutuallyExclusiveFlags -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --help, -h show help - -i value (default: 0) - -s value - -t value, --ai value (default: 0) -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --help, -h show help - -i value (default: 0) - -s value - -t value, --ai value (default: 0) -NAME: - foo - A new cli application - -USAGE: - foo [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -OPTIONS: - --help, -h show help - -i value (default: 0) - -s value - -t value, --ai value (default: 0) -NAME: - foo - A new cli application - -USAGE: - foo [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -OPTIONS: - --help, -h show help - -i value (default: 0) - -s value - -t value, --ai value (default: 0) -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --help, -h show help - -i value (default: 0) - -s value - -t value, --ai value (default: 0) -NAME: - foo - A new cli application - -USAGE: - foo [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -OPTIONS: - --help, -h show help - -i value (default: 0) - -s value - -t value, --ai value (default: 0) ---- PASS: TestFlagMutuallyExclusiveFlags (0.01s) -=== RUN TestBoolFlagHelpOutput ---- PASS: TestBoolFlagHelpOutput (0.00s) -=== RUN TestBoolFlagApply_SetsAllNames ---- PASS: TestBoolFlagApply_SetsAllNames (0.00s) -=== RUN TestBoolFlagValueFromCommand ---- PASS: TestBoolFlagValueFromCommand (0.00s) -=== RUN TestBoolFlagApply_SetsCount ---- PASS: TestBoolFlagApply_SetsCount (0.00s) -=== RUN TestBoolFlagCountFromCommand -NAME: - main - A new cli application - -USAGE: - main [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --tf, -w, --huh (default: false) - --help, -h show help -NAME: - main - A new cli application - -USAGE: - main [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --tf, -w, --huh (default: false) - --help, -h show help -NAME: - main - A new cli application - -USAGE: - main [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --tf, -w, --huh (default: false) - --help, -h show help ---- PASS: TestBoolFlagCountFromCommand (0.01s) -=== RUN TestFlagsFromEnv -=== RUN TestFlagsFromEnv/BoolFlag_valid_true -=== RUN TestFlagsFromEnv/BoolFlag_valid_false -=== RUN TestFlagsFromEnv/BoolFlag_invalid -Incorrect Usage: could not parse "foobar" as bool value from environment variable "DEBUG" for flag debug: parse error - -NAME: - run - A new cli application - -USAGE: - run [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --debug (default: false) [$DEBUG] - --help, -h show help -=== RUN TestFlagsFromEnv/DurationFlag_valid -=== RUN TestFlagsFromEnv/DurationFlag_invalid -Incorrect Usage: could not parse "foobar" as time.Duration value from environment variable "TIME" for flag time: time: invalid duration "foobar" - -NAME: - run - A new cli application - -USAGE: - run [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --time value (default: 0s) [$TIME] - --help, -h show help -=== RUN TestFlagsFromEnv/Float64Flag_valid -=== RUN TestFlagsFromEnv/Float64Flag_valid_from_int -=== RUN TestFlagsFromEnv/Float64Flag_invalid -Incorrect Usage: could not parse "foobar" as float64 value from environment variable "SECONDS" for flag seconds: strconv.ParseFloat: parsing "foobar": invalid syntax - -NAME: - run - A new cli application - -USAGE: - run [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --seconds value (default: 0) [$SECONDS] - --help, -h show help -=== RUN TestFlagsFromEnv/IntFlag_valid -=== RUN TestFlagsFromEnv/IntFlag_invalid_from_float -Incorrect Usage: could not parse "1.2" as int64 value from environment variable "SECONDS" for flag seconds: strconv.ParseInt: parsing "1.2": invalid syntax - -NAME: - run - A new cli application - -USAGE: - run [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --seconds value (default: 0) [$SECONDS] - --help, -h show help -=== RUN TestFlagsFromEnv/IntFlag_invalid -Incorrect Usage: could not parse "foobar" as int64 value from environment variable "SECONDS" for flag seconds: strconv.ParseInt: parsing "foobar": invalid syntax - -NAME: - run - A new cli application - -USAGE: - run [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --seconds value (default: 0) [$SECONDS] - --help, -h show help -=== RUN TestFlagsFromEnv/IntFlag_valid_from_hex -=== RUN TestFlagsFromEnv/IntFlag_invalid_from_octal -Incorrect Usage: could not parse "08" as int64 value from environment variable "SECONDS" for flag seconds: strconv.ParseInt: parsing "08": invalid syntax - -NAME: - run - A new cli application - -USAGE: - run [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --seconds value (default: 0) [$SECONDS] - --help, -h show help -=== RUN TestFlagsFromEnv/Float64SliceFlag_valid -=== RUN TestFlagsFromEnv/Float64SliceFlag_invalid -Incorrect Usage: could not parse "foobar" as []float64 value from environment variable "SECONDS" for flag seconds: strconv.ParseFloat: parsing "foobar": invalid syntax - -NAME: - run - A new cli application - -USAGE: - run [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --seconds value [ --seconds value ] [$SECONDS] - --help, -h show help -=== RUN TestFlagsFromEnv/IntSliceFlag_valid -=== RUN TestFlagsFromEnv/IntSliceFlag_invalid_from_float -Incorrect Usage: could not parse "1.2,2" as []int64 value from environment variable "SECONDS" for flag seconds: strconv.ParseInt: parsing "1.2": invalid syntax - -NAME: - run - A new cli application - -USAGE: - run [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --seconds value [ --seconds value ] [$SECONDS] - --help, -h show help -=== RUN TestFlagsFromEnv/IntSliceFlag_invalid -Incorrect Usage: could not parse "foobar" as []int64 value from environment variable "SECONDS" for flag seconds: strconv.ParseInt: parsing "foobar": invalid syntax - -NAME: - run - A new cli application - -USAGE: - run [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --seconds value [ --seconds value ] [$SECONDS] - --help, -h show help -=== RUN TestFlagsFromEnv/UintSliceFlag_valid -=== RUN TestFlagsFromEnv/UintSliceFlag_invalid_with_float -Incorrect Usage: could not parse "1.2,2" as []uint64 value from environment variable "SECONDS" for flag seconds: strconv.ParseUint: parsing "1.2": invalid syntax - -NAME: - run - A new cli application - -USAGE: - run [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --seconds value [ --seconds value ] [$SECONDS] - --help, -h show help -=== RUN TestFlagsFromEnv/UintSliceFlag_invalid -Incorrect Usage: could not parse "foobar" as []uint64 value from environment variable "SECONDS" for flag seconds: strconv.ParseUint: parsing "foobar": invalid syntax - -NAME: - run - A new cli application - -USAGE: - run [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --seconds value [ --seconds value ] [$SECONDS] - --help, -h show help -=== RUN TestFlagsFromEnv/StringFlag_valid -=== RUN TestFlagsFromEnv/StringFlag_valid_with_TrimSpace -=== RUN TestFlagsFromEnv/StringSliceFlag_valid -=== RUN TestFlagsFromEnv/StringSliceFlag_valid_with_TrimSpace -=== RUN TestFlagsFromEnv/StringMapFlag_valid -=== RUN TestFlagsFromEnv/StringMapFlag_valid_with_TrimSpace -=== RUN TestFlagsFromEnv/UintFlag_valid -=== RUN TestFlagsFromEnv/UintFlag_valid_leading_zero -=== RUN TestFlagsFromEnv/UintFlag_valid_from_octal -=== RUN TestFlagsFromEnv/UintFlag_valid_from_hex -=== RUN TestFlagsFromEnv/UintFlag_invalid_octal -Incorrect Usage: could not parse "08" as uint64 value from environment variable "SECONDS" for flag seconds: strconv.ParseUint: parsing "08": invalid syntax - -NAME: - run - A new cli application - -USAGE: - run [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --seconds value (default: 0) [$SECONDS] - --help, -h show help -=== RUN TestFlagsFromEnv/UintFlag_invalid_float -Incorrect Usage: could not parse "1.2" as uint64 value from environment variable "SECONDS" for flag seconds: strconv.ParseUint: parsing "1.2": invalid syntax - -NAME: - run - A new cli application - -USAGE: - run [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --seconds value (default: 0) [$SECONDS] - --help, -h show help -=== RUN TestFlagsFromEnv/UintFlag_invalid -Incorrect Usage: could not parse "foobar" as uint64 value from environment variable "SECONDS" for flag seconds: strconv.ParseUint: parsing "foobar": invalid syntax - -NAME: - run - A new cli application - -USAGE: - run [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --seconds value (default: 0) [$SECONDS] - --help, -h show help ---- PASS: TestFlagsFromEnv (0.04s) - --- PASS: TestFlagsFromEnv/BoolFlag_valid_true (0.00s) - --- PASS: TestFlagsFromEnv/BoolFlag_valid_false (0.00s) - --- PASS: TestFlagsFromEnv/BoolFlag_invalid (0.00s) - --- PASS: TestFlagsFromEnv/DurationFlag_valid (0.00s) - --- PASS: TestFlagsFromEnv/DurationFlag_invalid (0.00s) - --- PASS: TestFlagsFromEnv/Float64Flag_valid (0.00s) - --- PASS: TestFlagsFromEnv/Float64Flag_valid_from_int (0.00s) - --- PASS: TestFlagsFromEnv/Float64Flag_invalid (0.00s) - --- PASS: TestFlagsFromEnv/IntFlag_valid (0.00s) - --- PASS: TestFlagsFromEnv/IntFlag_invalid_from_float (0.00s) - --- PASS: TestFlagsFromEnv/IntFlag_invalid (0.00s) - --- PASS: TestFlagsFromEnv/IntFlag_valid_from_hex (0.00s) - --- PASS: TestFlagsFromEnv/IntFlag_invalid_from_octal (0.00s) - --- PASS: TestFlagsFromEnv/Float64SliceFlag_valid (0.00s) - --- PASS: TestFlagsFromEnv/Float64SliceFlag_invalid (0.00s) - --- PASS: TestFlagsFromEnv/IntSliceFlag_valid (0.00s) - --- PASS: TestFlagsFromEnv/IntSliceFlag_invalid_from_float (0.00s) - --- PASS: TestFlagsFromEnv/IntSliceFlag_invalid (0.00s) - --- PASS: TestFlagsFromEnv/UintSliceFlag_valid (0.00s) - --- PASS: TestFlagsFromEnv/UintSliceFlag_invalid_with_float (0.00s) - --- PASS: TestFlagsFromEnv/UintSliceFlag_invalid (0.00s) - --- PASS: TestFlagsFromEnv/StringFlag_valid (0.00s) - --- PASS: TestFlagsFromEnv/StringFlag_valid_with_TrimSpace (0.00s) - --- PASS: TestFlagsFromEnv/StringSliceFlag_valid (0.00s) - --- PASS: TestFlagsFromEnv/StringSliceFlag_valid_with_TrimSpace (0.00s) - --- PASS: TestFlagsFromEnv/StringMapFlag_valid (0.00s) - --- PASS: TestFlagsFromEnv/StringMapFlag_valid_with_TrimSpace (0.00s) - --- PASS: TestFlagsFromEnv/UintFlag_valid (0.00s) - --- PASS: TestFlagsFromEnv/UintFlag_valid_leading_zero (0.00s) - --- PASS: TestFlagsFromEnv/UintFlag_valid_from_octal (0.00s) - --- PASS: TestFlagsFromEnv/UintFlag_valid_from_hex (0.00s) - --- PASS: TestFlagsFromEnv/UintFlag_invalid_octal (0.00s) - --- PASS: TestFlagsFromEnv/UintFlag_invalid_float (0.00s) - --- PASS: TestFlagsFromEnv/UintFlag_invalid (0.00s) -=== RUN TestFlagStringifying -=== RUN TestFlagStringifying/bool-flag -=== RUN TestFlagStringifying/bool-flag-with-default-text -=== RUN TestFlagStringifying/duration-flag -=== RUN TestFlagStringifying/duration-flag-with-default-text -=== RUN TestFlagStringifying/float64-flag -=== RUN TestFlagStringifying/float64-flag-with-default-text -=== RUN TestFlagStringifying/float64-slice-flag -=== RUN TestFlagStringifying/float64-slice-flag-with-default-text -=== RUN TestFlagStringifying/int-flag -=== RUN TestFlagStringifying/int-flag-with-default-text -=== RUN TestFlagStringifying/int-slice-flag -=== RUN TestFlagStringifying/int-slice-flag-with-default-text -=== RUN TestFlagStringifying/uint-slice-flag -=== RUN TestFlagStringifying/uint-slice-flag-with-default-text -=== RUN TestFlagStringifying/int64-flag -=== RUN TestFlagStringifying/int64-flag-with-default-text -=== RUN TestFlagStringifying/uint64-slice-flag -=== RUN TestFlagStringifying/uint64-slice-flag-with-default-text -=== RUN TestFlagStringifying/string-flag -=== RUN TestFlagStringifying/string-flag-with-default-text -=== RUN TestFlagStringifying/string-slice-flag -=== RUN TestFlagStringifying/string-slice-flag-with-default-text -=== RUN TestFlagStringifying/timestamp-flag -=== RUN TestFlagStringifying/timestamp-flag-with-default-text -=== RUN TestFlagStringifying/uint-flag -=== RUN TestFlagStringifying/uint-flag-with-default-text -=== RUN TestFlagStringifying/uint64-flag -=== RUN TestFlagStringifying/uint64-flag-with-default-text -=== RUN TestFlagStringifying/nodoc-flag ---- PASS: TestFlagStringifying (0.00s) - --- PASS: TestFlagStringifying/bool-flag (0.00s) - --- PASS: TestFlagStringifying/bool-flag-with-default-text (0.00s) - --- PASS: TestFlagStringifying/duration-flag (0.00s) - --- PASS: TestFlagStringifying/duration-flag-with-default-text (0.00s) - --- PASS: TestFlagStringifying/float64-flag (0.00s) - --- PASS: TestFlagStringifying/float64-flag-with-default-text (0.00s) - --- PASS: TestFlagStringifying/float64-slice-flag (0.00s) - --- PASS: TestFlagStringifying/float64-slice-flag-with-default-text (0.00s) - --- PASS: TestFlagStringifying/int-flag (0.00s) - --- PASS: TestFlagStringifying/int-flag-with-default-text (0.00s) - --- PASS: TestFlagStringifying/int-slice-flag (0.00s) - --- PASS: TestFlagStringifying/int-slice-flag-with-default-text (0.00s) - --- PASS: TestFlagStringifying/uint-slice-flag (0.00s) - --- PASS: TestFlagStringifying/uint-slice-flag-with-default-text (0.00s) - --- PASS: TestFlagStringifying/int64-flag (0.00s) - --- PASS: TestFlagStringifying/int64-flag-with-default-text (0.00s) - --- PASS: TestFlagStringifying/uint64-slice-flag (0.00s) - --- PASS: TestFlagStringifying/uint64-slice-flag-with-default-text (0.00s) - --- PASS: TestFlagStringifying/string-flag (0.00s) - --- PASS: TestFlagStringifying/string-flag-with-default-text (0.00s) - --- PASS: TestFlagStringifying/string-slice-flag (0.00s) - --- PASS: TestFlagStringifying/string-slice-flag-with-default-text (0.00s) - --- PASS: TestFlagStringifying/timestamp-flag (0.00s) - --- PASS: TestFlagStringifying/timestamp-flag-with-default-text (0.00s) - --- PASS: TestFlagStringifying/uint-flag (0.00s) - --- PASS: TestFlagStringifying/uint-flag-with-default-text (0.00s) - --- PASS: TestFlagStringifying/uint64-flag (0.00s) - --- PASS: TestFlagStringifying/uint64-flag-with-default-text (0.00s) - --- PASS: TestFlagStringifying/nodoc-flag (0.00s) -=== RUN TestStringFlagHelpOutput ---- PASS: TestStringFlagHelpOutput (0.00s) -=== RUN TestStringFlagDefaultText ---- PASS: TestStringFlagDefaultText (0.00s) -=== RUN TestStringFlagWithEnvVarHelpOutput ---- PASS: TestStringFlagWithEnvVarHelpOutput (0.00s) -=== RUN TestStringFlagApply_SetsAllNames ---- PASS: TestStringFlagApply_SetsAllNames (0.00s) -=== RUN TestStringFlagValueFromCommand ---- PASS: TestStringFlagValueFromCommand (0.00s) -=== RUN TestStringSliceFlagHelpOutput ---- PASS: TestStringSliceFlagHelpOutput (0.00s) -=== RUN TestStringSliceFlagWithEnvVarHelpOutput ---- PASS: TestStringSliceFlagWithEnvVarHelpOutput (0.00s) -=== RUN TestStringSliceFlagApply_SetsAllNames ---- PASS: TestStringSliceFlagApply_SetsAllNames (0.00s) -=== RUN TestStringSliceFlagApply_UsesEnvValues_noDefault ---- PASS: TestStringSliceFlagApply_UsesEnvValues_noDefault (0.00s) -=== RUN TestStringSliceFlagApply_UsesEnvValues_withDefault ---- PASS: TestStringSliceFlagApply_UsesEnvValues_withDefault (0.00s) -=== RUN TestStringSliceFlagApply_DefaultValueWithDestination ---- PASS: TestStringSliceFlagApply_DefaultValueWithDestination (0.00s) -=== RUN TestStringSliceFlagValueFromCommand ---- PASS: TestStringSliceFlagValueFromCommand (0.00s) -=== RUN TestIntFlagHelpOutput ---- PASS: TestIntFlagHelpOutput (0.00s) -=== RUN TestIntFlagWithEnvVarHelpOutput ---- PASS: TestIntFlagWithEnvVarHelpOutput (0.00s) -=== RUN TestIntFlagApply_SetsAllNames ---- PASS: TestIntFlagApply_SetsAllNames (0.00s) -=== RUN TestIntFlagValueFromCommand ---- PASS: TestIntFlagValueFromCommand (0.00s) -=== RUN TestUintFlagHelpOutput ---- PASS: TestUintFlagHelpOutput (0.00s) -=== RUN TestUintFlagWithEnvVarHelpOutput ---- PASS: TestUintFlagWithEnvVarHelpOutput (0.00s) -=== RUN TestUintFlagValueFromCommand ---- PASS: TestUintFlagValueFromCommand (0.00s) -=== RUN TestUint64FlagHelpOutput ---- PASS: TestUint64FlagHelpOutput (0.00s) -=== RUN TestUint64FlagWithEnvVarHelpOutput ---- PASS: TestUint64FlagWithEnvVarHelpOutput (0.00s) -=== RUN TestUint64FlagValueFromCommand ---- PASS: TestUint64FlagValueFromCommand (0.00s) -=== RUN TestDurationFlagHelpOutput ---- PASS: TestDurationFlagHelpOutput (0.00s) -=== RUN TestDurationFlagWithEnvVarHelpOutput ---- PASS: TestDurationFlagWithEnvVarHelpOutput (0.00s) -=== RUN TestDurationFlagApply_SetsAllNames ---- PASS: TestDurationFlagApply_SetsAllNames (0.00s) -=== RUN TestDurationFlagValueFromCommand ---- PASS: TestDurationFlagValueFromCommand (0.00s) -=== RUN TestIntSliceFlagHelpOutput ---- PASS: TestIntSliceFlagHelpOutput (0.00s) -=== RUN TestIntSliceFlagWithEnvVarHelpOutput ---- PASS: TestIntSliceFlagWithEnvVarHelpOutput (0.00s) -=== RUN TestIntSliceFlagApply_SetsAllNames ---- PASS: TestIntSliceFlagApply_SetsAllNames (0.00s) -=== RUN TestIntSliceFlagApply_UsesEnvValues_noDefault ---- PASS: TestIntSliceFlagApply_UsesEnvValues_noDefault (0.00s) -=== RUN TestIntSliceFlagApply_UsesEnvValues_withDefault ---- PASS: TestIntSliceFlagApply_UsesEnvValues_withDefault (0.00s) -=== RUN TestIntSliceFlagApply_DefaultValueWithDestination ---- PASS: TestIntSliceFlagApply_DefaultValueWithDestination (0.00s) -=== RUN TestIntSliceFlagApply_ParentContext ---- PASS: TestIntSliceFlagApply_ParentContext (0.00s) -=== RUN TestIntSliceFlag_SetFromParentCommand ---- PASS: TestIntSliceFlag_SetFromParentCommand (0.00s) -=== RUN TestIntSliceFlagValueFromCommand ---- PASS: TestIntSliceFlagValueFromCommand (0.00s) -=== RUN TestUintSliceFlagHelpOutput -=== RUN TestUintSliceFlagHelpOutput/heads -=== RUN TestUintSliceFlagHelpOutput/H -=== RUN TestUintSliceFlagHelpOutput/heads#01 ---- PASS: TestUintSliceFlagHelpOutput (0.00s) - --- PASS: TestUintSliceFlagHelpOutput/heads (0.00s) - --- PASS: TestUintSliceFlagHelpOutput/H (0.00s) - --- PASS: TestUintSliceFlagHelpOutput/heads#01 (0.00s) -=== RUN TestUintSliceFlagWithEnvVarHelpOutput ---- PASS: TestUintSliceFlagWithEnvVarHelpOutput (0.00s) -=== RUN TestUintSliceFlagApply_SetsAllNames ---- PASS: TestUintSliceFlagApply_SetsAllNames (0.00s) -=== RUN TestUintSliceFlagApply_UsesEnvValues_noDefault ---- PASS: TestUintSliceFlagApply_UsesEnvValues_noDefault (0.00s) -=== RUN TestUintSliceFlagApply_UsesEnvValues_withDefault ---- PASS: TestUintSliceFlagApply_UsesEnvValues_withDefault (0.00s) -=== RUN TestUintSliceFlagApply_DefaultValueWithDestination ---- PASS: TestUintSliceFlagApply_DefaultValueWithDestination (0.00s) -=== RUN TestUintSliceFlagApply_ParentContext ---- PASS: TestUintSliceFlagApply_ParentContext (0.00s) -=== RUN TestUintSliceFlag_SetFromParentCommand ---- PASS: TestUintSliceFlag_SetFromParentCommand (0.00s) -=== RUN TestUintSliceFlag_ReturnNil ---- PASS: TestUintSliceFlag_ReturnNil (0.00s) -=== RUN TestUint64SliceFlagHelpOutput ---- PASS: TestUint64SliceFlagHelpOutput (0.00s) -=== RUN TestUint64SliceFlagWithEnvVarHelpOutput ---- PASS: TestUint64SliceFlagWithEnvVarHelpOutput (0.00s) -=== RUN TestUint64SliceFlagApply_SetsAllNames ---- PASS: TestUint64SliceFlagApply_SetsAllNames (0.00s) -=== RUN TestUint64SliceFlagApply_UsesEnvValues_noDefault ---- PASS: TestUint64SliceFlagApply_UsesEnvValues_noDefault (0.00s) -=== RUN TestUint64SliceFlagApply_UsesEnvValues_withDefault ---- PASS: TestUint64SliceFlagApply_UsesEnvValues_withDefault (0.00s) -=== RUN TestUint64SliceFlagApply_DefaultValueWithDestination ---- PASS: TestUint64SliceFlagApply_DefaultValueWithDestination (0.00s) -=== RUN TestUint64SliceFlagApply_ParentCommand ---- PASS: TestUint64SliceFlagApply_ParentCommand (0.00s) -=== RUN TestUint64SliceFlag_SetFromParentCommand ---- PASS: TestUint64SliceFlag_SetFromParentCommand (0.00s) -=== RUN TestUint64SliceFlag_ReturnNil ---- PASS: TestUint64SliceFlag_ReturnNil (0.00s) -=== RUN TestFloat64FlagHelpOutput ---- PASS: TestFloat64FlagHelpOutput (0.00s) -=== RUN TestFloat64FlagWithEnvVarHelpOutput ---- PASS: TestFloat64FlagWithEnvVarHelpOutput (0.00s) -=== RUN TestFloat64FlagApply_SetsAllNames ---- PASS: TestFloat64FlagApply_SetsAllNames (0.00s) -=== RUN TestFloat64FlagValueFromCommand ---- PASS: TestFloat64FlagValueFromCommand (0.00s) -=== RUN TestFloat64SliceFlagHelpOutput ---- PASS: TestFloat64SliceFlagHelpOutput (0.00s) -=== RUN TestFloat64SliceFlagWithEnvVarHelpOutput ---- PASS: TestFloat64SliceFlagWithEnvVarHelpOutput (0.00s) -=== RUN TestFloat64SliceFlagApply_SetsAllNames ---- PASS: TestFloat64SliceFlagApply_SetsAllNames (0.00s) -=== RUN TestFloat64SliceFlagApply_UsesEnvValues_noDefault ---- PASS: TestFloat64SliceFlagApply_UsesEnvValues_noDefault (0.00s) -=== RUN TestFloat64SliceFlagApply_UsesEnvValues_withDefault ---- PASS: TestFloat64SliceFlagApply_UsesEnvValues_withDefault (0.00s) -=== RUN TestFloat64SliceFlagApply_DefaultValueWithDestination ---- PASS: TestFloat64SliceFlagApply_DefaultValueWithDestination (0.00s) -=== RUN TestFloat64SliceFlagValueFromCommand ---- PASS: TestFloat64SliceFlagValueFromCommand (0.00s) -=== RUN TestFloat64SliceFlagApply_ParentCommand ---- PASS: TestFloat64SliceFlagApply_ParentCommand (0.00s) -=== RUN TestParseMultiString ---- PASS: TestParseMultiString (0.00s) -=== RUN TestParseDestinationString ---- PASS: TestParseDestinationString (0.00s) -=== RUN TestParseMultiStringFromEnv ---- PASS: TestParseMultiStringFromEnv (0.00s) -=== RUN TestParseMultiStringFromEnvCascade ---- PASS: TestParseMultiStringFromEnvCascade (0.00s) -=== RUN TestParseMultiStringSlice ---- PASS: TestParseMultiStringSlice (0.00s) -=== RUN TestParseMultiStringSliceWithDefaults ---- PASS: TestParseMultiStringSliceWithDefaults (0.00s) -=== RUN TestParseMultiStringSliceWithDestination ---- PASS: TestParseMultiStringSliceWithDestination (0.00s) -=== RUN TestParseMultiStringSliceWithDestinationAndEnv ---- PASS: TestParseMultiStringSliceWithDestinationAndEnv (0.00s) -=== RUN TestParseMultiFloat64SliceWithDestinationAndEnv ---- PASS: TestParseMultiFloat64SliceWithDestinationAndEnv (0.00s) -=== RUN TestParseMultiIntSliceWithDestinationAndEnv ---- PASS: TestParseMultiIntSliceWithDestinationAndEnv (0.00s) -=== RUN TestParseMultiStringSliceWithDefaultsUnset ---- PASS: TestParseMultiStringSliceWithDefaultsUnset (0.00s) -=== RUN TestParseMultiStringSliceFromEnv ---- PASS: TestParseMultiStringSliceFromEnv (0.00s) -=== RUN TestParseMultiStringSliceFromEnvWithDefaults ---- PASS: TestParseMultiStringSliceFromEnvWithDefaults (0.00s) -=== RUN TestParseMultiStringSliceFromEnvCascade ---- PASS: TestParseMultiStringSliceFromEnvCascade (0.00s) -=== RUN TestParseMultiStringSliceFromEnvCascadeWithDefaults ---- PASS: TestParseMultiStringSliceFromEnvCascadeWithDefaults (0.00s) -=== RUN TestParseMultiStringSliceFromEnvWithDestination ---- PASS: TestParseMultiStringSliceFromEnvWithDestination (0.00s) -=== RUN TestParseMultiInt ---- PASS: TestParseMultiInt (0.00s) -=== RUN TestParseDestinationInt ---- PASS: TestParseDestinationInt (0.00s) -=== RUN TestParseMultiIntFromEnv ---- PASS: TestParseMultiIntFromEnv (0.00s) -=== RUN TestParseMultiIntFromEnvCascade ---- PASS: TestParseMultiIntFromEnvCascade (0.00s) -=== RUN TestParseMultiIntSlice ---- PASS: TestParseMultiIntSlice (0.00s) -=== RUN TestParseMultiIntSliceWithDefaults ---- PASS: TestParseMultiIntSliceWithDefaults (0.00s) -=== RUN TestParseMultiIntSliceWithDefaultsUnset ---- PASS: TestParseMultiIntSliceWithDefaultsUnset (0.00s) -=== RUN TestParseMultiIntSliceFromEnv ---- PASS: TestParseMultiIntSliceFromEnv (0.00s) -=== RUN TestParseMultiIntSliceFromEnvWithDefaults ---- PASS: TestParseMultiIntSliceFromEnvWithDefaults (0.00s) -=== RUN TestParseMultiIntSliceFromEnvCascade ---- PASS: TestParseMultiIntSliceFromEnvCascade (0.00s) -=== RUN TestParseMultiFloat64 ---- PASS: TestParseMultiFloat64 (0.00s) -=== RUN TestParseDestinationFloat64 ---- PASS: TestParseDestinationFloat64 (0.00s) -=== RUN TestParseMultiFloat64FromEnv ---- PASS: TestParseMultiFloat64FromEnv (0.00s) -=== RUN TestParseMultiFloat64FromEnvCascade ---- PASS: TestParseMultiFloat64FromEnvCascade (0.00s) -=== RUN TestParseMultiFloat64SliceFromEnv ---- PASS: TestParseMultiFloat64SliceFromEnv (0.00s) -=== RUN TestParseMultiFloat64SliceFromEnvCascade ---- PASS: TestParseMultiFloat64SliceFromEnvCascade (0.00s) -=== RUN TestParseMultiBool ---- PASS: TestParseMultiBool (0.00s) -=== RUN TestParseBoolShortOptionHandle ---- PASS: TestParseBoolShortOptionHandle (0.00s) -=== RUN TestParseDestinationBool ---- PASS: TestParseDestinationBool (0.00s) -=== RUN TestParseMultiBoolFromEnv ---- PASS: TestParseMultiBoolFromEnv (0.00s) -=== RUN TestParseMultiBoolFromEnvCascade ---- PASS: TestParseMultiBoolFromEnvCascade (0.00s) -=== RUN TestParseBoolFromEnv -=== RUN TestParseBoolFromEnv/""_false -=== RUN TestParseBoolFromEnv/"1"_true -=== RUN TestParseBoolFromEnv/"false"_false -=== RUN TestParseBoolFromEnv/"true"_true ---- PASS: TestParseBoolFromEnv (0.00s) - --- PASS: TestParseBoolFromEnv/""_false (0.00s) - --- PASS: TestParseBoolFromEnv/"1"_true (0.00s) - --- PASS: TestParseBoolFromEnv/"false"_false (0.00s) - --- PASS: TestParseBoolFromEnv/"true"_true (0.00s) -=== RUN TestParseMultiBoolT ---- PASS: TestParseMultiBoolT (0.00s) -=== RUN TestStringSlice_Serialized_Set ---- PASS: TestStringSlice_Serialized_Set (0.00s) -=== RUN TestIntSlice_Serialized_Set ---- PASS: TestIntSlice_Serialized_Set (0.00s) -=== RUN TestUintSlice_Serialized_Set ---- PASS: TestUintSlice_Serialized_Set (0.00s) -=== RUN TestUint64Slice_Serialized_Set ---- PASS: TestUint64Slice_Serialized_Set (0.00s) -=== RUN TestStringMap_Serialized_Set ---- PASS: TestStringMap_Serialized_Set (0.00s) -=== RUN TestTimestamp_set ---- PASS: TestTimestamp_set (0.00s) -=== RUN TestTimestampFlagApply_SingleFormat ---- PASS: TestTimestampFlagApply_SingleFormat (0.00s) -=== RUN TestTimestampFlagApply_MultipleFormats ---- PASS: TestTimestampFlagApply_MultipleFormats (0.00s) -=== RUN TestTimestampFlagApplyValue ---- PASS: TestTimestampFlagApplyValue (0.00s) -=== RUN TestTimestampFlagApply_Fail_Parse_Wrong_Layout ---- PASS: TestTimestampFlagApply_Fail_Parse_Wrong_Layout (0.00s) -=== RUN TestTimestampFlagApply_Fail_Parse_Wrong_Time ---- PASS: TestTimestampFlagApply_Fail_Parse_Wrong_Time (0.00s) -=== RUN TestTimestampFlagApply_Timezoned ---- PASS: TestTimestampFlagApply_Timezoned (0.00s) -=== RUN TestTimestampFlagValueFromCommand ---- PASS: TestTimestampFlagValueFromCommand (0.00s) -=== RUN TestFlagDefaultValue ---- PASS: TestFlagDefaultValue (0.00s) -=== RUN TestFlagDefaultValueWithEnv ---- PASS: TestFlagDefaultValueWithEnv (0.00s) -=== RUN TestFlagValue -=== RUN TestFlagValue/stringSlice -=== RUN TestFlagValue/float64Slice -=== RUN TestFlagValue/intSlice -=== RUN TestFlagValue/uintSlice -=== RUN TestFlagValue/stringMap ---- PASS: TestFlagValue (0.00s) - --- PASS: TestFlagValue/stringSlice (0.00s) - --- PASS: TestFlagValue/float64Slice (0.00s) - --- PASS: TestFlagValue/intSlice (0.00s) - --- PASS: TestFlagValue/uintSlice (0.00s) - --- PASS: TestFlagValue/stringMap (0.00s) -=== RUN TestTimestampFlagApply_WithDestination ---- PASS: TestTimestampFlagApply_WithDestination (0.00s) -=== RUN TestSliceShortOptionHandle ---- PASS: TestSliceShortOptionHandle (0.00s) -=== RUN TestCustomizedSliceFlagSeparator ---- PASS: TestCustomizedSliceFlagSeparator (0.00s) -=== RUN TestFlagSplitMultiValues_Disabled ---- PASS: TestFlagSplitMultiValues_Disabled (0.00s) -=== RUN TestStringMapFlagHelpOutput ---- PASS: TestStringMapFlagHelpOutput (0.00s) -=== RUN TestStringMapFlagWithEnvVarHelpOutput ---- PASS: TestStringMapFlagWithEnvVarHelpOutput (0.00s) -=== RUN TestStringMapFlagApply_SetsAllNames ---- PASS: TestStringMapFlagApply_SetsAllNames (0.00s) -=== RUN TestStringMapFlagApply_UsesEnvValues_noDefault ---- PASS: TestStringMapFlagApply_UsesEnvValues_noDefault (0.00s) -=== RUN TestStringMapFlagApply_UsesEnvValues_withDefault ---- PASS: TestStringMapFlagApply_UsesEnvValues_withDefault (0.00s) -=== RUN TestStringMapFlagApply_DefaultValueWithDestination ---- PASS: TestStringMapFlagApply_DefaultValueWithDestination (0.00s) -=== RUN TestStringMapFlagValueFromCommand ---- PASS: TestStringMapFlagValueFromCommand (0.00s) -=== RUN TestStringMapFlagApply_Error -invalid value "aaa" for flag -goat: item "aaa" is missing separator "=" -Usage of test: - -goat value - (default map[]) ---- PASS: TestStringMapFlagApply_Error (0.00s) -=== RUN TestFlagDefaultValidation -Incorrect Usage: Value 2 not in range [3,10] or [20,24] - -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --if value (default: 2) - --help, -h show help ---- PASS: TestFlagDefaultValidation (0.00s) -=== RUN TestFlagValidation -Incorrect Usage: invalid value "2" for flag -it: Value 2 not in range [3,10]U[20,24] - -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --it value (default: 5) - --help, -h show help -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --it value (default: 5) - --help, -h show help -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --it value (default: 5) - --help, -h show help -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --it value (default: 5) - --help, -h show help -Incorrect Usage: invalid value "15" for flag -it: Value 15 not in range [3,10]U[20,24] - -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --it value (default: 5) - --help, -h show help -Incorrect Usage: invalid value "19" for flag -it: Value 19 not in range [3,10]U[20,24] - -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --it value (default: 5) - --help, -h show help -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --it value (default: 5) - --help, -h show help -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --it value (default: 5) - --help, -h show help -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --it value (default: 5) - --help, -h show help -Incorrect Usage: invalid value "27" for flag -it: Value 27 not in range [3,10]U[20,24] - -NAME: - foo - A new cli application - -USAGE: - foo [global options] [command [command options]] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - -GLOBAL OPTIONS: - --it value (default: 5) - --help, -h show help ---- PASS: TestFlagValidation (0.02s) -=== RUN Test_ShowAppHelp_NoAuthor ---- PASS: Test_ShowAppHelp_NoAuthor (0.00s) -=== RUN Test_ShowAppHelp_NoVersion ---- PASS: Test_ShowAppHelp_NoVersion (0.00s) -=== RUN Test_ShowAppHelp_HideVersion ---- PASS: Test_ShowAppHelp_HideVersion (0.00s) -=== RUN Test_ShowAppHelp_MultiLineDescription ---- PASS: Test_ShowAppHelp_MultiLineDescription (0.00s) -=== RUN Test_Help_RequiredFlagsNoDefault ---- PASS: Test_Help_RequiredFlagsNoDefault (0.00s) -=== RUN Test_Help_Custom_Flags ---- PASS: Test_Help_Custom_Flags (0.00s) -=== RUN Test_Help_Nil_Flags ---- PASS: Test_Help_Nil_Flags (0.00s) -=== RUN Test_Version_Custom_Flags ---- PASS: Test_Version_Custom_Flags (0.00s) -=== RUN Test_helpCommand_Action_ErrorIfNoTopic ---- PASS: Test_helpCommand_Action_ErrorIfNoTopic (0.00s) -=== RUN Test_helpCommand_InHelpOutput ---- PASS: Test_helpCommand_InHelpOutput (0.00s) -=== RUN TestHelpCommand_FullName -=== RUN TestHelpCommand_FullName/app_help's_FullName -=== RUN TestHelpCommand_FullName/app_help's_FullName_via_flag -=== RUN TestHelpCommand_FullName/cmd_help's_FullName -=== RUN TestHelpCommand_FullName/cmd_help's_FullName_via_flag -=== RUN TestHelpCommand_FullName/subcmd_help's_FullName -=== RUN TestHelpCommand_FullName/subcmd_help's_FullName_via_flag ---- PASS: TestHelpCommand_FullName (0.01s) - --- PASS: TestHelpCommand_FullName/app_help's_FullName (0.00s) - --- PASS: TestHelpCommand_FullName/app_help's_FullName_via_flag (0.00s) - --- SKIP: TestHelpCommand_FullName/cmd_help's_FullName (0.00s) - --- SKIP: TestHelpCommand_FullName/cmd_help's_FullName_via_flag (0.00s) - --- PASS: TestHelpCommand_FullName/subcmd_help's_FullName (0.00s) - --- PASS: TestHelpCommand_FullName/subcmd_help's_FullName_via_flag (0.00s) -=== RUN Test_helpCommand_HideHelpCommand ---- PASS: Test_helpCommand_HideHelpCommand (0.00s) -=== RUN Test_helpCommand_HideHelpFlag -Incorrect Usage: flag: help requested - ---- PASS: Test_helpCommand_HideHelpFlag (0.00s) -=== RUN Test_helpSubcommand_Action_ErrorIfNoTopic ---- PASS: Test_helpSubcommand_Action_ErrorIfNoTopic (0.00s) -=== RUN TestShowAppHelp_CommandAliases ---- PASS: TestShowAppHelp_CommandAliases (0.00s) -=== RUN TestShowCommandHelp_AppendHelp -=== RUN TestShowCommandHelp_AppendHelp/with_HideHelp -=== RUN TestShowCommandHelp_AppendHelp/with_HideHelpCommand -=== RUN TestShowCommandHelp_AppendHelp/with_Subcommand -=== RUN TestShowCommandHelp_AppendHelp/without_Subcommand ---- PASS: TestShowCommandHelp_AppendHelp (0.01s) - --- PASS: TestShowCommandHelp_AppendHelp/with_HideHelp (0.00s) - --- PASS: TestShowCommandHelp_AppendHelp/with_HideHelpCommand (0.00s) - --- PASS: TestShowCommandHelp_AppendHelp/with_Subcommand (0.00s) - --- PASS: TestShowCommandHelp_AppendHelp/without_Subcommand (0.00s) -=== RUN TestShowCommandHelp_HelpPrinter -=== RUN TestShowCommandHelp_HelpPrinter/no-command ---- PASS: TestShowCommandHelp_HelpPrinter (0.00s) - --- PASS: TestShowCommandHelp_HelpPrinter/no-command (0.00s) -=== RUN TestShowCommandHelp_HelpPrinterCustom -=== RUN TestShowCommandHelp_HelpPrinterCustom/no_command - help_test.go:553: cmd.Run(ctx, [my-app help]) -=== RUN TestShowCommandHelp_HelpPrinterCustom/standard_command - help_test.go:553: cmd.Run(ctx, [my-app help my-command]) -=== RUN TestShowCommandHelp_HelpPrinterCustom/custom_template_command - help_test.go:553: cmd.Run(ctx, [my-app help my-command]) ---- PASS: TestShowCommandHelp_HelpPrinterCustom (0.00s) - --- PASS: TestShowCommandHelp_HelpPrinterCustom/no_command (0.00s) - --- PASS: TestShowCommandHelp_HelpPrinterCustom/standard_command (0.00s) - --- PASS: TestShowCommandHelp_HelpPrinterCustom/custom_template_command (0.00s) -=== RUN TestShowCommandHelp_CommandAliases ---- PASS: TestShowCommandHelp_CommandAliases (0.00s) -=== RUN TestShowSubcommandHelp_CommandAliases ---- PASS: TestShowSubcommandHelp_CommandAliases (0.00s) -=== RUN TestShowCommandHelp_Customtemplate ---- PASS: TestShowCommandHelp_Customtemplate (0.00s) -=== RUN TestShowSubcommandHelp_CommandUsageText ---- PASS: TestShowSubcommandHelp_CommandUsageText (0.00s) -=== RUN TestShowSubcommandHelp_MultiLine_CommandUsageText ---- PASS: TestShowSubcommandHelp_MultiLine_CommandUsageText (0.00s) -=== RUN TestShowSubcommandHelp_GlobalOptions ---- PASS: TestShowSubcommandHelp_GlobalOptions (0.00s) -=== RUN TestShowSubcommandHelp_SubcommandUsageText ---- PASS: TestShowSubcommandHelp_SubcommandUsageText (0.00s) -=== RUN TestShowSubcommandHelp_MultiLine_SubcommandUsageText ---- PASS: TestShowSubcommandHelp_MultiLine_SubcommandUsageText (0.00s) -=== RUN TestShowAppHelp_HiddenCommand ---- PASS: TestShowAppHelp_HiddenCommand (0.00s) -=== RUN TestShowAppHelp_HelpPrinter -=== RUN TestShowAppHelp_HelpPrinter/standard-command -=== RUN TestShowAppHelp_HelpPrinter/custom-template-command ---- PASS: TestShowAppHelp_HelpPrinter (0.00s) - --- PASS: TestShowAppHelp_HelpPrinter/standard-command (0.00s) - --- PASS: TestShowAppHelp_HelpPrinter/custom-template-command (0.00s) -=== RUN TestShowAppHelp_HelpPrinterCustom -=== RUN TestShowAppHelp_HelpPrinterCustom/standard-command -=== RUN TestShowAppHelp_HelpPrinterCustom/custom-template-command ---- PASS: TestShowAppHelp_HelpPrinterCustom (0.00s) - --- PASS: TestShowAppHelp_HelpPrinterCustom/standard-command (0.00s) - --- PASS: TestShowAppHelp_HelpPrinterCustom/custom-template-command (0.00s) -=== RUN TestShowAppHelp_CustomAppTemplate ---- PASS: TestShowAppHelp_CustomAppTemplate (0.00s) -=== RUN TestShowAppHelp_UsageText ---- PASS: TestShowAppHelp_UsageText (0.00s) -=== RUN TestShowAppHelp_MultiLine_UsageText ---- PASS: TestShowAppHelp_MultiLine_UsageText (0.00s) -=== RUN TestShowAppHelp_CommandMultiLine_UsageText ---- PASS: TestShowAppHelp_CommandMultiLine_UsageText (0.00s) -=== RUN TestHideHelpCommand ---- PASS: TestHideHelpCommand (0.00s) -=== RUN TestHideHelpCommand_False ---- PASS: TestHideHelpCommand_False (0.00s) -=== RUN TestHideHelpCommand_WithHideHelp -Incorrect Usage: flag: help requested - ---- PASS: TestHideHelpCommand_WithHideHelp (0.00s) -=== RUN TestHideHelpCommand_WithSubcommands -NAME: - cli.test - A new cli application - -USAGE: - cli.test [global options] [command [command options]] [arguments...] - -COMMANDS: - nully - -GLOBAL OPTIONS: - --help, -h show help ---- PASS: TestHideHelpCommand_WithSubcommands (0.00s) -=== RUN TestDefaultCompleteWithFlags -=== RUN TestDefaultCompleteWithFlags/empty -=== RUN TestDefaultCompleteWithFlags/typical-flag-suggestion -=== RUN TestDefaultCompleteWithFlags/typical-command-suggestion -=== RUN TestDefaultCompleteWithFlags/autocomplete-with-spaces -=== RUN TestDefaultCompleteWithFlags/zsh-autocomplete-with-flag-descriptions -=== RUN TestDefaultCompleteWithFlags/zsh-autocomplete-with-empty-flag-descriptions ---- PASS: TestDefaultCompleteWithFlags (0.00s) - --- PASS: TestDefaultCompleteWithFlags/empty (0.00s) - --- PASS: TestDefaultCompleteWithFlags/typical-flag-suggestion (0.00s) - --- PASS: TestDefaultCompleteWithFlags/typical-command-suggestion (0.00s) - --- PASS: TestDefaultCompleteWithFlags/autocomplete-with-spaces (0.00s) - --- PASS: TestDefaultCompleteWithFlags/zsh-autocomplete-with-flag-descriptions (0.00s) - --- PASS: TestDefaultCompleteWithFlags/zsh-autocomplete-with-empty-flag-descriptions (0.00s) -=== RUN TestMutuallyExclusiveFlags ---- PASS: TestMutuallyExclusiveFlags (0.00s) -=== RUN TestWrap ---- PASS: TestWrap (0.00s) -=== RUN TestWrappedHelp ---- PASS: TestWrappedHelp (0.00s) -=== RUN TestWrappedCommandHelp ---- PASS: TestWrappedCommandHelp (0.00s) -=== RUN TestWrappedSubcommandHelp ---- PASS: TestWrappedSubcommandHelp (0.00s) -=== RUN TestWrappedHelpSubcommand ---- PASS: TestWrappedHelpSubcommand (0.00s) -=== RUN TestCategorizedHelp ---- PASS: TestCategorizedHelp (0.00s) -=== RUN Test_checkShellCompleteFlag -=== PAUSE Test_checkShellCompleteFlag -=== RUN TestLexicographicLess ---- PASS: TestLexicographicLess (0.00s) -=== RUN TestJaroWinkler ---- PASS: TestJaroWinkler (0.00s) -=== RUN TestSuggestFlag ---- PASS: TestSuggestFlag (0.00s) -=== RUN TestSuggestFlagHideHelp ---- PASS: TestSuggestFlagHideHelp (0.00s) -=== RUN TestSuggestFlagFromError ---- PASS: TestSuggestFlagFromError (0.00s) -=== RUN TestSuggestFlagFromErrorWrongError ---- PASS: TestSuggestFlagFromErrorWrongError (0.00s) -=== RUN TestSuggestFlagFromErrorWrongCommand ---- PASS: TestSuggestFlagFromErrorWrongCommand (0.00s) -=== RUN TestSuggestFlagFromErrorNoSuggestion ---- PASS: TestSuggestFlagFromErrorNoSuggestion (0.00s) -=== RUN TestSuggestCommand ---- PASS: TestSuggestCommand (0.00s) -=== RUN TestEnvVarValueSource -=== RUN TestEnvVarValueSource/implements_ValueSource -=== RUN TestEnvVarValueSource/implements_ValueSource/not_found -=== RUN TestEnvVarValueSource/implements_ValueSource/found -=== RUN TestEnvVarValueSource/implements_fmt.Stringer -=== RUN TestEnvVarValueSource/implements_fmt.GoStringer ---- PASS: TestEnvVarValueSource (0.00s) - --- PASS: TestEnvVarValueSource/implements_ValueSource (0.00s) - --- PASS: TestEnvVarValueSource/implements_ValueSource/not_found (0.00s) - --- PASS: TestEnvVarValueSource/implements_ValueSource/found (0.00s) - --- PASS: TestEnvVarValueSource/implements_fmt.Stringer (0.00s) - --- PASS: TestEnvVarValueSource/implements_fmt.GoStringer (0.00s) -=== RUN TestEnvVars ---- PASS: TestEnvVars (0.00s) -=== RUN TestFileValueSource -=== RUN TestFileValueSource/implements_ValueSource -=== RUN TestFileValueSource/implements_ValueSource/not_found -=== RUN TestFileValueSource/implements_ValueSource/found -=== RUN TestFileValueSource/implements_fmt.Stringer -=== RUN TestFileValueSource/implements_fmt.GoStringer ---- PASS: TestFileValueSource (0.00s) - --- PASS: TestFileValueSource/implements_ValueSource (0.00s) - --- PASS: TestFileValueSource/implements_ValueSource/not_found (0.00s) - --- PASS: TestFileValueSource/implements_ValueSource/found (0.00s) - --- PASS: TestFileValueSource/implements_fmt.Stringer (0.00s) - --- PASS: TestFileValueSource/implements_fmt.GoStringer (0.00s) -=== RUN TestFilePaths ---- PASS: TestFilePaths (0.00s) -=== RUN TestValueSourceChainEnvKeys ---- PASS: TestValueSourceChainEnvKeys (0.00s) -=== RUN TestValueSourceChain -=== RUN TestValueSourceChain/implements_ValueSource -=== RUN TestValueSourceChain/implements_fmt.GoStringer -=== RUN TestValueSourceChain/implements_fmt.Stringer ---- PASS: TestValueSourceChain (0.00s) - --- PASS: TestValueSourceChain/implements_ValueSource (0.00s) - --- PASS: TestValueSourceChain/implements_fmt.GoStringer (0.00s) - --- PASS: TestValueSourceChain/implements_fmt.Stringer (0.00s) -=== CONT Test_checkShellCompleteFlag -=== RUN Test_checkShellCompleteFlag/disable-shell-completion -=== PAUSE Test_checkShellCompleteFlag/disable-shell-completion -=== RUN Test_checkShellCompleteFlag/child-disable-shell-completion -=== PAUSE Test_checkShellCompleteFlag/child-disable-shell-completion -=== RUN Test_checkShellCompleteFlag/last_argument_isn't_--generate-shell-completion -=== PAUSE Test_checkShellCompleteFlag/last_argument_isn't_--generate-shell-completion -=== RUN Test_checkShellCompleteFlag/arguments_include_double_dash -=== PAUSE Test_checkShellCompleteFlag/arguments_include_double_dash -=== RUN Test_checkShellCompleteFlag/shell_completion -=== PAUSE Test_checkShellCompleteFlag/shell_completion -=== CONT Test_checkShellCompleteFlag/disable-shell-completion -=== CONT Test_checkShellCompleteFlag/shell_completion -=== CONT Test_checkShellCompleteFlag/arguments_include_double_dash -=== CONT Test_checkShellCompleteFlag/last_argument_isn't_--generate-shell-completion -=== CONT Test_checkShellCompleteFlag/child-disable-shell-completion ---- PASS: Test_checkShellCompleteFlag (0.00s) - --- PASS: Test_checkShellCompleteFlag/disable-shell-completion (0.00s) - --- PASS: Test_checkShellCompleteFlag/shell_completion (0.00s) - --- PASS: Test_checkShellCompleteFlag/arguments_include_double_dash (0.00s) - --- PASS: Test_checkShellCompleteFlag/last_argument_isn't_--generate-shell-completion (0.00s) - --- PASS: Test_checkShellCompleteFlag/child-disable-shell-completion (0.00s) -=== RUN ExampleCommand_Run ---- PASS: ExampleCommand_Run (0.00s) -=== RUN ExampleCommand_Run_subcommand ---- PASS: ExampleCommand_Run_subcommand (0.00s) -=== RUN ExampleCommand_Run_appHelp ---- PASS: ExampleCommand_Run_appHelp (0.00s) -=== RUN ExampleCommand_Run_commandHelp ---- PASS: ExampleCommand_Run_commandHelp (0.00s) -=== RUN ExampleCommand_Run_noAction ---- PASS: ExampleCommand_Run_noAction (0.00s) -=== RUN ExampleCommand_Run_subcommandNoAction ---- PASS: ExampleCommand_Run_subcommandNoAction (0.00s) -=== RUN ExampleCommand_Run_shellComplete_bash_withShortFlag ---- PASS: ExampleCommand_Run_shellComplete_bash_withShortFlag (0.00s) -=== RUN ExampleCommand_Run_shellComplete_bash_withLongFlag ---- PASS: ExampleCommand_Run_shellComplete_bash_withLongFlag (0.00s) -=== RUN ExampleCommand_Run_shellComplete_bash_withMultipleLongFlag ---- PASS: ExampleCommand_Run_shellComplete_bash_withMultipleLongFlag (0.00s) -=== RUN ExampleCommand_Run_shellComplete_bash ---- PASS: ExampleCommand_Run_shellComplete_bash (0.00s) -=== RUN ExampleCommand_Run_shellComplete_zsh ---- PASS: ExampleCommand_Run_shellComplete_zsh (0.00s) -=== RUN ExampleCommand_Run_sliceValues ---- PASS: ExampleCommand_Run_sliceValues (0.00s) -=== RUN ExampleCommand_Run_mapValues ---- PASS: ExampleCommand_Run_mapValues (0.00s) -=== RUN ExampleBoolWithInverseFlag ---- PASS: ExampleBoolWithInverseFlag (0.00s) -=== RUN ExampleCommand_Suggest ---- PASS: ExampleCommand_Suggest (0.00s) -=== RUN ExampleCommand_Suggest_command ---- PASS: ExampleCommand_Suggest_command (0.00s) -FAIL -coverage: 91.5% of statements -FAIL github.com/urfave/cli/v3 0.628s -FAIL From 6b820b0f6b40ab5a139700e1788d30fa59b13296 Mon Sep 17 00:00:00 2001 From: horockey Date: Wed, 7 Aug 2024 10:52:51 +0300 Subject: [PATCH 07/19] docs: fix docs --- docs/v3/examples/timestamp-flag.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/v3/examples/timestamp-flag.md b/docs/v3/examples/timestamp-flag.md index 7180824af6..7fa24c5f28 100644 --- a/docs/v3/examples/timestamp-flag.md +++ b/docs/v3/examples/timestamp-flag.md @@ -28,7 +28,12 @@ import ( func main() { cmd := &cli.Command{ Flags: []cli.Flag{ - &cli.TimestampFlag{Name: "meeting", Config: cli.TimestampConfig{Layout: "2006-01-02T15:04:05"}}, + &cli.TimestampFlag{ + Name: "meeting", + Config: cli.TimestampConfig{ + AvailableLayouts: []string{"2006-01-02T15:04:05"}, + }, + }, }, Action: func(ctx context.Context, cmd *cli.Command) error { fmt.Printf("%s", cmd.Timestamp("meeting").String()) @@ -54,7 +59,13 @@ change behavior, a default timezone can be provided with flag definition: ```go cmd := &cli.Command{ Flags: []cli.Flag{ - &cli.TimestampFlag{Name: "meeting", Config: cli.TimestampConfig{Layout: "2006-01-02T15:04:05", Timezone: time.Local}}, + &cli.TimestampFlag{ + Name: "meeting", + Config: cli.TimestampConfig{ + Timezone: time.Local, + AvailableLayouts: []string{"2006-01-02T15:04:05"}, + }, + }, }, } ``` From 473a15443516aa269701cf67bec6977808b5f024 Mon Sep 17 00:00:00 2001 From: horockey Date: Wed, 7 Aug 2024 10:53:20 +0300 Subject: [PATCH 08/19] chore: set defaukt tz to UTC for bw compability --- flag_timestamp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flag_timestamp.go b/flag_timestamp.go index dd0105910a..79d3cb086d 100644 --- a/flag_timestamp.go +++ b/flag_timestamp.go @@ -54,7 +54,7 @@ func (t *timestampValue) Set(value string) error { var err error if t.location == nil { - t.location = time.Local + t.location = time.UTC } for _, layout := range t.availableLayouts { From 8a9c7f8ad88bca889c38020b4db9c8e998e95763 Mon Sep 17 00:00:00 2001 From: horockey Date: Wed, 7 Aug 2024 15:32:53 +0300 Subject: [PATCH 09/19] tets: add tests --- flag_test.go | 205 ++++++++++++++++++++++++++++++++++++++++++---- flag_timestamp.go | 21 ++++- 2 files changed, 208 insertions(+), 18 deletions(-) diff --git a/flag_test.go b/flag_test.go index de5c232b80..265c9b5a81 100644 --- a/flag_test.go +++ b/flag_test.go @@ -2,11 +2,13 @@ package cli import ( "context" + "errors" "flag" "fmt" "io" "os" "reflect" + "regexp" "strings" "testing" "time" @@ -2285,30 +2287,201 @@ func TestTimestampFlagApply_SingleFormat(t *testing.T) { } func TestTimestampFlagApply_MultipleFormats(t *testing.T) { + now := time.Now().UTC() + + testCases := []struct { + caseName string + layoutsPrecisions map[string]time.Duration + expRes time.Time + expErrValidation func(err error) (validation error) + }{ + { + caseName: "all_valid_layouts", + layoutsPrecisions: map[string]time.Duration{ + time.RFC3339: time.Second, + time.DateTime: time.Second, + time.RFC1123: time.Second, + }, + expRes: now.Truncate(time.Second), + }, + { + caseName: "one_invalid_layout", + layoutsPrecisions: map[string]time.Duration{ + time.RFC3339: time.Second, + time.DateTime: time.Second, + "foo": 0, + }, + expRes: now.Truncate(time.Second), + }, + { + caseName: "multiple_invalid_layouts", + layoutsPrecisions: map[string]time.Duration{ + time.RFC3339: time.Second, + "foo": 0, + time.DateTime: time.Second, + "bar": 0, + }, + expRes: now.Truncate(time.Second), + }, + { + caseName: "all_invalid_layouts", + layoutsPrecisions: map[string]time.Duration{ + "foo": 0, + "2024-08-07 74:01:82Z-100": 0, + "25:70": 0, + "": 0, + }, + expErrValidation: func(err error) error { + if err == nil { + return errors.New("got nil err") + } + + found := regexp.MustCompile(`(cannot parse ".+" as ".*")|(extra text: ".+")`).Match([]byte(err.Error())) + if !found { + return fmt.Errorf("given error does not satisfy pattern: %w", err) + } + + return nil + }, + }, + { + caseName: "empty_layout", + layoutsPrecisions: map[string]time.Duration{ + "": 0, + }, + expErrValidation: func(err error) error { + if err == nil { + return errors.New("got nil err") + } + + found := regexp.MustCompile(`extra text: ".+"`).Match([]byte(err.Error())) + if !found { + return fmt.Errorf("given error does not satisfy pattern: %w", err) + } + + return nil + }, + }, + { + caseName: "nil_layouts_slice", + expErrValidation: func(err error) error { + if err == nil { + return errors.New("got nil err") + } + + found := regexp.MustCompile(`got nil/empty layouts slice"`).Match([]byte(err.Error())) + if !found { + return fmt.Errorf("given error does not satisfy pattern: %w", err) + } + + return nil + }, + }, + { + caseName: "empty_layouts_slice", + layoutsPrecisions: map[string]time.Duration{}, + expErrValidation: func(err error) error { + if err == nil { + return errors.New("got nil err") + } + + found := regexp.MustCompile(`got nil/empty layouts slice"`).Match([]byte(err.Error())) + if !found { + return fmt.Errorf("given error does not satisfy pattern: %w", err) + } + + return nil + }, + }, + } + + getKeys := func(m map[string]time.Duration) []string { + keys := make([]string, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + return keys + } + + for idx := range testCases { + testCase := testCases[idx] + t.Run(testCase.caseName, func(t *testing.T) { + t.Parallel() + fl := TimestampFlag{ + Name: "time", + Config: TimestampConfig{ + AvailableLayouts: getKeys(testCase.layoutsPrecisions), + }, + } + + set := flag.NewFlagSet("test", 0) + _ = fl.Apply(set) + + validLayouts := make([]string, 0, len(testCase.layoutsPrecisions)) + invalidLayouts := make([]string, 0, len(testCase.layoutsPrecisions)) + + for layout, prec := range testCase.layoutsPrecisions { + v, err := time.Parse(layout, now.Format(layout)) + if err != nil || prec == 0 || now.Truncate(prec).UnixNano() != v.Truncate(prec).UnixNano() { + invalidLayouts = append(invalidLayouts, layout) + continue + } + validLayouts = append(validLayouts, layout) + } + + for _, layout := range validLayouts { + err := set.Parse([]string{"--time", now.Format(layout)}) + assert.NoError(t, err) + if !testCase.expRes.IsZero() { + assert.Equal(t, testCase.expRes, set.Lookup("time").Value.(flag.Getter).Get()) + } + } + + for range invalidLayouts { + err := set.Parse([]string{"--time", now.Format(time.RFC3339)}) + if testCase.expErrValidation != nil { + assert.NoError(t, testCase.expErrValidation(err)) + } + } + }) + } +} + +func TestTimestampFlagApply_ShortenedLayouts(t *testing.T) { + now := time.Now().UTC() + + shortenedLayoutsPrecisions := map[string]time.Duration{ + time.Kitchen: time.Minute, + time.Stamp: time.Second, + time.StampMilli: time.Millisecond, + time.StampMicro: time.Microsecond, + time.StampNano: time.Nanosecond, + time.TimeOnly: time.Second, + "15:04": time.Minute, + } + + getKeys := func(m map[string]time.Duration) []string { + keys := make([]string, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + return keys + } + fl := TimestampFlag{ - Name: "time", - Aliases: []string{"t"}, + Name: "time", Config: TimestampConfig{ - Timezone: time.Local, - AvailableLayouts: []string{ - time.DateTime, - time.TimeOnly, - time.Kitchen, - }, + AvailableLayouts: getKeys(shortenedLayoutsPrecisions), }, } + set := flag.NewFlagSet("test", 0) _ = fl.Apply(set) - now := time.Now() - for timeStr, expectedRes := range map[string]time.Time{ - now.Format(time.DateTime): now.Truncate(time.Second), - now.Format(time.TimeOnly): now.Truncate(time.Second), - now.Format(time.Kitchen): now.Truncate(time.Minute), - } { - err := set.Parse([]string{"--time", timeStr}) + for layout, prec := range shortenedLayoutsPrecisions { + err := set.Parse([]string{"--time", now.Format(layout)}) assert.NoError(t, err) - assert.Equal(t, expectedRes, set.Lookup("time").Value.(flag.Getter).Get()) + assert.Equal(t, now.Truncate(prec), set.Lookup("time").Value.(flag.Getter).Get()) } } diff --git a/flag_timestamp.go b/flag_timestamp.go index 79d3cb086d..090f03fc83 100644 --- a/flag_timestamp.go +++ b/flag_timestamp.go @@ -1,6 +1,7 @@ package cli import ( + "errors" "fmt" "time" ) @@ -57,6 +58,10 @@ func (t *timestampValue) Set(value string) error { t.location = time.UTC } + if len(t.availableLayouts) == 0 { + return errors.New("got nil/empty layouts slice") + } + for _, layout := range t.availableLayouts { var locErr error @@ -83,9 +88,10 @@ func (t *timestampValue) Set(value string) error { defaultTS, _ := time.ParseInLocation(time.TimeOnly, time.TimeOnly, timestamp.Location()) - // If format is missing date, set it explicitly to current + n := time.Now() + + // If format is missing date (or year only), set it explicitly to current if timestamp.Truncate(time.Hour*24).UnixNano() == defaultTS.Truncate(time.Hour*24).UnixNano() { - n := time.Now() timestamp = time.Date( n.Year(), n.Month(), @@ -96,6 +102,17 @@ func (t *timestampValue) Set(value string) error { timestamp.Nanosecond(), timestamp.Location(), ) + } else if timestamp.Year() == 0 { + timestamp = time.Date( + n.Year(), + timestamp.Month(), + timestamp.Day(), + timestamp.Hour(), + timestamp.Minute(), + timestamp.Second(), + timestamp.Nanosecond(), + timestamp.Location(), + ) } if t.timestamp != nil { From bd235d849896af4b3a0dce35e9049e65725f41fc Mon Sep 17 00:00:00 2001 From: horockey Date: Wed, 7 Aug 2024 16:06:14 +0300 Subject: [PATCH 10/19] docs: add todos --- flag_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flag_test.go b/flag_test.go index 265c9b5a81..0c37c3f1f0 100644 --- a/flag_test.go +++ b/flag_test.go @@ -2395,6 +2395,7 @@ func TestTimestampFlagApply_MultipleFormats(t *testing.T) { }, } + // TODO: replace with maps.Keys() (go >= ), lo.Keys() if acceptable getKeys := func(m map[string]time.Duration) []string { keys := make([]string, 0, len(m)) for k := range m { @@ -2420,6 +2421,7 @@ func TestTimestampFlagApply_MultipleFormats(t *testing.T) { validLayouts := make([]string, 0, len(testCase.layoutsPrecisions)) invalidLayouts := make([]string, 0, len(testCase.layoutsPrecisions)) + // TODO: replace with lo.Filter if acceptable for layout, prec := range testCase.layoutsPrecisions { v, err := time.Parse(layout, now.Format(layout)) if err != nil || prec == 0 || now.Truncate(prec).UnixNano() != v.Truncate(prec).UnixNano() { @@ -2460,6 +2462,7 @@ func TestTimestampFlagApply_ShortenedLayouts(t *testing.T) { "15:04": time.Minute, } + // TODO: replace with maps.Keys() (go >= ), lo.Keys() if acceptable getKeys := func(m map[string]time.Duration) []string { keys := make([]string, 0, len(m)) for k := range m { From bf82dab7fc2ab1251b3a945ff31cd187b7c96421 Mon Sep 17 00:00:00 2001 From: horockey Date: Wed, 7 Aug 2024 17:47:53 +0300 Subject: [PATCH 11/19] fix: prevent non-nil keys for nil map --- flag_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flag_test.go b/flag_test.go index 0c37c3f1f0..bc0c377373 100644 --- a/flag_test.go +++ b/flag_test.go @@ -2397,6 +2397,10 @@ func TestTimestampFlagApply_MultipleFormats(t *testing.T) { // TODO: replace with maps.Keys() (go >= ), lo.Keys() if acceptable getKeys := func(m map[string]time.Duration) []string { + if m == nil { + return nil + } + keys := make([]string, 0, len(m)) for k := range m { keys = append(keys, k) @@ -2464,6 +2468,10 @@ func TestTimestampFlagApply_ShortenedLayouts(t *testing.T) { // TODO: replace with maps.Keys() (go >= ), lo.Keys() if acceptable getKeys := func(m map[string]time.Duration) []string { + if m == nil { + return nil + } + keys := make([]string, 0, len(m)) for k := range m { keys = append(keys, k) From 9c9d13eb09cdcf4c8b9e934a4816ab6105852124 Mon Sep 17 00:00:00 2001 From: horockey Date: Wed, 7 Aug 2024 17:59:47 +0300 Subject: [PATCH 12/19] test: fix tests to cover empty layout scenario --- flag_test.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/flag_test.go b/flag_test.go index bc0c377373..91b16a4b2c 100644 --- a/flag_test.go +++ b/flag_test.go @@ -2369,7 +2369,7 @@ func TestTimestampFlagApply_MultipleFormats(t *testing.T) { return errors.New("got nil err") } - found := regexp.MustCompile(`got nil/empty layouts slice"`).Match([]byte(err.Error())) + found := regexp.MustCompile(`got nil/empty layouts slice`).Match([]byte(err.Error())) if !found { return fmt.Errorf("given error does not satisfy pattern: %w", err) } @@ -2385,7 +2385,7 @@ func TestTimestampFlagApply_MultipleFormats(t *testing.T) { return errors.New("got nil err") } - found := regexp.MustCompile(`got nil/empty layouts slice"`).Match([]byte(err.Error())) + found := regexp.MustCompile(`got nil/empty layouts slice`).Match([]byte(err.Error())) if !found { return fmt.Errorf("given error does not satisfy pattern: %w", err) } @@ -2411,7 +2411,7 @@ func TestTimestampFlagApply_MultipleFormats(t *testing.T) { for idx := range testCases { testCase := testCases[idx] t.Run(testCase.caseName, func(t *testing.T) { - t.Parallel() + // t.Parallel() fl := TimestampFlag{ Name: "time", Config: TimestampConfig{ @@ -2422,6 +2422,13 @@ func TestTimestampFlagApply_MultipleFormats(t *testing.T) { set := flag.NewFlagSet("test", 0) _ = fl.Apply(set) + if len(testCase.layoutsPrecisions) == 0 { + err := set.Parse([]string{"--time", now.Format(time.RFC3339)}) + if testCase.expErrValidation != nil { + assert.NoError(t, testCase.expErrValidation(err)) + } + } + validLayouts := make([]string, 0, len(testCase.layoutsPrecisions)) invalidLayouts := make([]string, 0, len(testCase.layoutsPrecisions)) From cdad83fc541c610becd41d299ee69611607cda63 Mon Sep 17 00:00:00 2001 From: horockey Date: Thu, 8 Aug 2024 17:11:52 +0300 Subject: [PATCH 13/19] refactor: use multierr for err join --- flag_timestamp.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/flag_timestamp.go b/flag_timestamp.go index 090f03fc83..c104358a4c 100644 --- a/flag_timestamp.go +++ b/flag_timestamp.go @@ -66,15 +66,13 @@ func (t *timestampValue) Set(value string) error { var locErr error timestamp, locErr = time.ParseInLocation(layout, value, t.location) - // TODO: replace with errors.Join() after upgrading to go 1.20 or newer - // OR use external error wrapping, if acceptable if locErr != nil { if err == nil { err = locErr continue } - err = fmt.Errorf("%v\n%v", err, locErr) + err = newMultiError(err, locErr) continue } From 5009fd4fd4c897b36dab550f643aa1e6a97fed3a Mon Sep 17 00:00:00 2001 From: horockey Date: Thu, 8 Aug 2024 17:15:14 +0300 Subject: [PATCH 14/19] style: change naming to PR sug variant --- args_test.go | 2 +- command_test.go | 4 ++-- docs/v3/examples/timestamp-flag.md | 2 +- flag_test.go | 30 +++++++++++++++--------------- flag_timestamp.go | 22 +++++++++++----------- godoc-current.txt | 4 ++-- 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/args_test.go b/args_test.go index f1f16189e7..983ed5d06a 100644 --- a/args_test.go +++ b/args_test.go @@ -68,7 +68,7 @@ func TestArgumentsSubcommand(t *testing.T) { Max: 1, Destination: &tval, Config: TimestampConfig{ - AvailableLayouts: []string{time.RFC3339}, + Layouts: []string{time.RFC3339}, }, }, &StringArg{ diff --git a/command_test.go b/command_test.go index 7539c16584..b8ed27f97d 100644 --- a/command_test.go +++ b/command_test.go @@ -2739,8 +2739,8 @@ func TestFlagAction(t *testing.T) { &TimestampFlag{ Name: "f_timestamp", Config: TimestampConfig{ - Timezone: time.UTC, - AvailableLayouts: []string{time.DateTime}, + Timezone: time.UTC, + Layouts: []string{time.DateTime}, }, Action: func(_ context.Context, cmd *Command, v time.Time) error { if v.IsZero() { diff --git a/docs/v3/examples/timestamp-flag.md b/docs/v3/examples/timestamp-flag.md index 7fa24c5f28..0513977949 100644 --- a/docs/v3/examples/timestamp-flag.md +++ b/docs/v3/examples/timestamp-flag.md @@ -31,7 +31,7 @@ func main() { &cli.TimestampFlag{ Name: "meeting", Config: cli.TimestampConfig{ - AvailableLayouts: []string{"2006-01-02T15:04:05"}, + Layouts: []string{"2006-01-02T15:04:05"}, }, }, }, diff --git a/flag_test.go b/flag_test.go index 91b16a4b2c..3b3ef5e768 100644 --- a/flag_test.go +++ b/flag_test.go @@ -2259,25 +2259,25 @@ func TestStringMap_Serialized_Set(t *testing.T) { func TestTimestamp_set(t *testing.T) { ts := timestampValue{ - timestamp: nil, - hasBeenSet: false, - availableLayouts: []string{"Jan 2, 2006 at 3:04pm (MST)"}, + timestamp: nil, + hasBeenSet: false, + layouts: []string{"Jan 2, 2006 at 3:04pm (MST)"}, } time1 := "Feb 3, 2013 at 7:54pm (PST)" - require.NoError(t, ts.Set(time1), "Failed to parse time %s with layouts %v", time1, ts.availableLayouts) + require.NoError(t, ts.Set(time1), "Failed to parse time %s with layouts %v", time1, ts.layouts) require.True(t, ts.hasBeenSet, "hasBeenSet is not true after setting a time") ts.hasBeenSet = false - ts.availableLayouts = []string{time.RFC3339} + ts.layouts = []string{time.RFC3339} time2 := "2006-01-02T15:04:05Z" - require.NoError(t, ts.Set(time2), "Failed to parse time %s with layout %v", time2, ts.availableLayouts) + require.NoError(t, ts.Set(time2), "Failed to parse time %s with layout %v", time2, ts.layouts) require.True(t, ts.hasBeenSet, "hasBeenSet is not true after setting a time") } func TestTimestampFlagApply_SingleFormat(t *testing.T) { expectedResult, _ := time.Parse(time.RFC3339, "2006-01-02T15:04:05Z") - fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{AvailableLayouts: []string{time.RFC3339}}} + fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{Layouts: []string{time.RFC3339}}} set := flag.NewFlagSet("test", 0) _ = fl.Apply(set) @@ -2415,7 +2415,7 @@ func TestTimestampFlagApply_MultipleFormats(t *testing.T) { fl := TimestampFlag{ Name: "time", Config: TimestampConfig{ - AvailableLayouts: getKeys(testCase.layoutsPrecisions), + Layouts: getKeys(testCase.layoutsPrecisions), }, } @@ -2489,7 +2489,7 @@ func TestTimestampFlagApply_ShortenedLayouts(t *testing.T) { fl := TimestampFlag{ Name: "time", Config: TimestampConfig{ - AvailableLayouts: getKeys(shortenedLayoutsPrecisions), + Layouts: getKeys(shortenedLayoutsPrecisions), }, } @@ -2505,7 +2505,7 @@ func TestTimestampFlagApply_ShortenedLayouts(t *testing.T) { func TestTimestampFlagApplyValue(t *testing.T) { expectedResult, _ := time.Parse(time.RFC3339, "2006-01-02T15:04:05Z") - fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{AvailableLayouts: []string{time.RFC3339}}, Value: expectedResult} + fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{Layouts: []string{time.RFC3339}}, Value: expectedResult} set := flag.NewFlagSet("test", 0) _ = fl.Apply(set) @@ -2515,7 +2515,7 @@ func TestTimestampFlagApplyValue(t *testing.T) { } func TestTimestampFlagApply_Fail_Parse_Wrong_Layout(t *testing.T) { - fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{AvailableLayouts: []string{"randomlayout"}}} + fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{Layouts: []string{"randomlayout"}}} set := flag.NewFlagSet("test", 0) set.SetOutput(io.Discard) _ = fl.Apply(set) @@ -2525,7 +2525,7 @@ func TestTimestampFlagApply_Fail_Parse_Wrong_Layout(t *testing.T) { } func TestTimestampFlagApply_Fail_Parse_Wrong_Time(t *testing.T) { - fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{AvailableLayouts: []string{"Jan 2, 2006 at 3:04pm (MST)"}}} + fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{Layouts: []string{"Jan 2, 2006 at 3:04pm (MST)"}}} set := flag.NewFlagSet("test", 0) set.SetOutput(io.Discard) _ = fl.Apply(set) @@ -2537,7 +2537,7 @@ func TestTimestampFlagApply_Fail_Parse_Wrong_Time(t *testing.T) { func TestTimestampFlagApply_Timezoned(t *testing.T) { pdt := time.FixedZone("PDT", -7*60*60) expectedResult, _ := time.Parse(time.RFC3339, "2006-01-02T15:04:05Z") - fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{AvailableLayouts: []string{time.ANSIC}, Timezone: pdt}} + fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{Layouts: []string{time.ANSIC}, Timezone: pdt}} set := flag.NewFlagSet("test", 0) _ = fl.Apply(set) @@ -2738,7 +2738,7 @@ func TestFlagDefaultValueWithEnv(t *testing.T) { }, { name: "timestamp", - flag: &TimestampFlag{Name: "flag", Value: ts, Config: TimestampConfig{AvailableLayouts: []string{time.RFC3339}}, Sources: EnvVars("tflag")}, + flag: &TimestampFlag{Name: "flag", Value: ts, Config: TimestampConfig{Layouts: []string{time.RFC3339}}, Sources: EnvVars("tflag")}, toParse: []string{"--flag", "2006-11-02T15:04:05Z"}, expect: `--flag value (default: 2005-01-02 15:04:05 +0000 UTC)` + withEnvHint([]string{"tflag"}, ""), environ: map[string]string{ @@ -2822,7 +2822,7 @@ func TestFlagValue(t *testing.T) { func TestTimestampFlagApply_WithDestination(t *testing.T) { var destination time.Time expectedResult, _ := time.Parse(time.RFC3339, "2006-01-02T15:04:05Z") - fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{AvailableLayouts: []string{time.RFC3339}}, Destination: &destination} + fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{Layouts: []string{time.RFC3339}}, Destination: &destination} set := flag.NewFlagSet("test", 0) _ = fl.Apply(set) diff --git a/flag_timestamp.go b/flag_timestamp.go index c104358a4c..460bba860e 100644 --- a/flag_timestamp.go +++ b/flag_timestamp.go @@ -10,16 +10,16 @@ type TimestampFlag = FlagBase[time.Time, TimestampConfig, timestampValue] // TimestampConfig defines the config for timestamp flags type TimestampConfig struct { - Timezone *time.Location - AvailableLayouts []string + Timezone *time.Location + Layouts []string } // timestampValue wrap to satisfy golang's flag interface. type timestampValue struct { - timestamp *time.Time - hasBeenSet bool - availableLayouts []string - location *time.Location + timestamp *time.Time + hasBeenSet bool + layouts []string + location *time.Location } var _ ValueCreator[time.Time, TimestampConfig] = timestampValue{} @@ -29,9 +29,9 @@ var _ ValueCreator[time.Time, TimestampConfig] = timestampValue{} func (t timestampValue) Create(val time.Time, p *time.Time, c TimestampConfig) Value { *p = val return ×tampValue{ - timestamp: p, - availableLayouts: c.AvailableLayouts, - location: c.Timezone, + timestamp: p, + layouts: c.Layouts, + location: c.Timezone, } } @@ -58,11 +58,11 @@ func (t *timestampValue) Set(value string) error { t.location = time.UTC } - if len(t.availableLayouts) == 0 { + if len(t.layouts) == 0 { return errors.New("got nil/empty layouts slice") } - for _, layout := range t.availableLayouts { + for _, layout := range t.layouts { var locErr error timestamp, locErr = time.ParseInLocation(layout, value, t.location) diff --git a/godoc-current.txt b/godoc-current.txt index 14f9a31b97..0a45c81c94 100644 --- a/godoc-current.txt +++ b/godoc-current.txt @@ -940,8 +940,8 @@ type SuggestFlagFunc func(flags []Flag, provided string, hideHelp bool) string type TimestampArg = ArgumentBase[time.Time, TimestampConfig, timestampValue] type TimestampConfig struct { - Timezone *time.Location - AvailableLayouts []string + Timezone *time.Location + Layouts []string } TimestampConfig defines the config for timestamp flags From eae778be415d6a0398278c21226b3db376a6d306 Mon Sep 17 00:00:00 2001 From: horockey Date: Thu, 8 Aug 2024 17:20:27 +0300 Subject: [PATCH 15/19] build: run v3approve --- testdata/godoc-v3.x.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testdata/godoc-v3.x.txt b/testdata/godoc-v3.x.txt index 14f9a31b97..0a45c81c94 100644 --- a/testdata/godoc-v3.x.txt +++ b/testdata/godoc-v3.x.txt @@ -940,8 +940,8 @@ type SuggestFlagFunc func(flags []Flag, provided string, hideHelp bool) string type TimestampArg = ArgumentBase[time.Time, TimestampConfig, timestampValue] type TimestampConfig struct { - Timezone *time.Location - AvailableLayouts []string + Timezone *time.Location + Layouts []string } TimestampConfig defines the config for timestamp flags From 350319c901289740c7d8a874a7db69c84718eb50 Mon Sep 17 00:00:00 2001 From: horockey Date: Fri, 9 Aug 2024 11:31:38 +0300 Subject: [PATCH 16/19] docs: add layouts docstring --- flag_timestamp.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flag_timestamp.go b/flag_timestamp.go index 460bba860e..313218d25d 100644 --- a/flag_timestamp.go +++ b/flag_timestamp.go @@ -11,7 +11,10 @@ type TimestampFlag = FlagBase[time.Time, TimestampConfig, timestampValue] // TimestampConfig defines the config for timestamp flags type TimestampConfig struct { Timezone *time.Location - Layouts []string + // Available layouts for flag value. + // + // Note that value for formats with missing year/date will be interpreted as current year/date respectively. + Layouts []string } // timestampValue wrap to satisfy golang's flag interface. From a90ae49e87eec95d76450fc646fe4962fa2fdaae Mon Sep 17 00:00:00 2001 From: horockey Date: Fri, 9 Aug 2024 12:40:11 +0300 Subject: [PATCH 17/19] build: upd docs --- godoc-current.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/godoc-current.txt b/godoc-current.txt index 0a45c81c94..51aaad5d53 100644 --- a/godoc-current.txt +++ b/godoc-current.txt @@ -941,7 +941,10 @@ type TimestampArg = ArgumentBase[time.Time, TimestampConfig, timestampValue] type TimestampConfig struct { Timezone *time.Location - Layouts []string + // Available layouts for flag value. + // + // Note that value for formats with missing year/date will be interpreted as current year/date respectively. + Layouts []string } TimestampConfig defines the config for timestamp flags From 894ce6451ae05e9b34deeec52c556b4c33d003cd Mon Sep 17 00:00:00 2001 From: horockey Date: Fri, 9 Aug 2024 12:44:05 +0300 Subject: [PATCH 18/19] build: run v3approve --- testdata/godoc-v3.x.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testdata/godoc-v3.x.txt b/testdata/godoc-v3.x.txt index 0a45c81c94..51aaad5d53 100644 --- a/testdata/godoc-v3.x.txt +++ b/testdata/godoc-v3.x.txt @@ -941,7 +941,10 @@ type TimestampArg = ArgumentBase[time.Time, TimestampConfig, timestampValue] type TimestampConfig struct { Timezone *time.Location - Layouts []string + // Available layouts for flag value. + // + // Note that value for formats with missing year/date will be interpreted as current year/date respectively. + Layouts []string } TimestampConfig defines the config for timestamp flags From ead7db004b18a6302cae7fbdb20c2bbf1bd6ead0 Mon Sep 17 00:00:00 2001 From: horockey Date: Fri, 9 Aug 2024 15:02:35 +0300 Subject: [PATCH 19/19] docs: add doc link to time layouts --- flag_timestamp.go | 2 ++ godoc-current.txt | 2 ++ testdata/godoc-v3.x.txt | 2 ++ 3 files changed, 6 insertions(+) diff --git a/flag_timestamp.go b/flag_timestamp.go index 313218d25d..8b9dd16a09 100644 --- a/flag_timestamp.go +++ b/flag_timestamp.go @@ -14,6 +14,8 @@ type TimestampConfig struct { // Available layouts for flag value. // // Note that value for formats with missing year/date will be interpreted as current year/date respectively. + // + // Read more about time layouts: https://pkg.go.dev/time#pkg-constants Layouts []string } diff --git a/godoc-current.txt b/godoc-current.txt index 51aaad5d53..7faf8b7cb7 100644 --- a/godoc-current.txt +++ b/godoc-current.txt @@ -944,6 +944,8 @@ type TimestampConfig struct { // Available layouts for flag value. // // Note that value for formats with missing year/date will be interpreted as current year/date respectively. + // + // Read more about time layouts: https://pkg.go.dev/time#pkg-constants Layouts []string } TimestampConfig defines the config for timestamp flags diff --git a/testdata/godoc-v3.x.txt b/testdata/godoc-v3.x.txt index 51aaad5d53..7faf8b7cb7 100644 --- a/testdata/godoc-v3.x.txt +++ b/testdata/godoc-v3.x.txt @@ -944,6 +944,8 @@ type TimestampConfig struct { // Available layouts for flag value. // // Note that value for formats with missing year/date will be interpreted as current year/date respectively. + // + // Read more about time layouts: https://pkg.go.dev/time#pkg-constants Layouts []string } TimestampConfig defines the config for timestamp flags