From 0b6a6ee99b5d4f274ab5a72e9be7c1b85cf80cbf Mon Sep 17 00:00:00 2001 From: andrey1s Date: Sun, 18 Sep 2022 23:11:24 +0300 Subject: [PATCH] add example hidden option --- example/cmd/config/main.go | 3 ++- example/pkg/command/args.go | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/example/cmd/config/main.go b/example/cmd/config/main.go index 0dd0109..713a7f5 100644 --- a/example/cmd/config/main.go +++ b/example/cmd/config/main.go @@ -16,7 +16,8 @@ const ( AppName = "console" ) -// FDEVS_CONSOLE_CAT=env go run cmd/config/main.go fdevs:console:arg -b tmp. +// FDEVS_CONSOLE_CAT=env FDEVS_CONSOLE_HIDDEN=2022-09-18T23:07:49+03:00 go run cmd/config/main.go fdevs:console:arg -b tmp. +// FDEVS_CONSOLE_CAT=env go run cmd/config/main.go fdevs:console:arg --hidden=2022-09-18T23:07:49+03:00 -b tmp. func main() { env := config.New(Namespace, AppName, []config.Provider{ env.New(), diff --git a/example/pkg/command/args.go b/example/pkg/command/args.go index f1f40af..9f6cfa9 100644 --- a/example/pkg/command/args.go +++ b/example/pkg/command/args.go @@ -20,6 +20,7 @@ func Args() *console.Command { option.String("bar", "required bar option", option.Required, option.Short('b')), option.String("cat", "cat option", option.Short('c')), option.Time("time", "time example"), + option.Time("hidden", "hidden time example", option.Hidden), ) return nil @@ -29,6 +30,7 @@ func Args() *console.Command { out.Println(ctx, "bar: ", in.Option(ctx, "bar").String(), "") out.Println(ctx, "cat: ", in.Option(ctx, "cat").String(), "") out.Println(ctx, "time: ", in.Option(ctx, "time").Time().Format(time.RFC3339), "") + out.Println(ctx, "hidden: ", in.Option(ctx, "hidden").Time().Format(time.RFC3339), "") return nil }, -- 2.30.2