Files
console/example/cmd/config/main.go
andrey 0d661986d1
All checks were successful
Go Action / goaction (pull_request) Successful in 56s
update example
2026-01-05 23:51:55 +03:00

37 lines
833 B
Go

package main
import (
"context"
"os"
"gitoa.ru/go-4devs/config/provider/arg"
"gitoa.ru/go-4devs/config/provider/chain"
"gitoa.ru/go-4devs/config/provider/env"
"gitoa.ru/go-4devs/config/provider/memory"
"gitoa.ru/go-4devs/console"
"gitoa.ru/go-4devs/console/example/pkg/command"
)
const (
Namespace = "fdevs"
AppName = "console"
)
// 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() {
console.
New(console.WithInput(
chain.New(
arg.New(arg.WithArgs(os.Args)),
env.New(Namespace, AppName),
&memory.Default{},
),
)).
Add(
command.Long(),
command.Args(),
).
Execute(context.Background())
}