mirror of
https://github.com/hanzoai/ingress.git
synced 2026-10-26 02:47:15 +00:00
- Fork github.com/traefik/paerser to github.com/hanzoai/ingress-parser with rebranded prefixes (TRAEFIK_ → INGRESS_, traefik. → ingress.) - Update all 71 Go files importing paerser to use ingress-parser - CLI flags: traefik.configfile → ingress.configfile - Env prefix: TRAEFIK_* → INGRESS_* - Deprecation loader: traefik. label prefix → ingress. - Recompute digest auth test hashes for realm "ingress" - Rename traefiker test realm → ingresser - Fix remaining comment URLs to hanzoai/ingress 7 remaining "traefik" refs are Go import paths for external packages (traefik/yaegi, traefik/grpc-web) — these are the packages' module identity, cannot be renamed without forking the entire Go interpreter and gRPC-Web proxy.
28 lines
612 B
Go
28 lines
612 B
Go
package cli
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/rs/zerolog/log"
|
|
"github.com/hanzoai/ingress-parser/cli"
|
|
"github.com/hanzoai/ingress-parser/flag"
|
|
)
|
|
|
|
// FlagLoader loads configuration from flags.
|
|
type FlagLoader struct{}
|
|
|
|
// Load loads the command's configuration from flag arguments.
|
|
func (*FlagLoader) Load(args []string, cmd *cli.Command) (bool, error) {
|
|
if len(args) == 0 {
|
|
return false, nil
|
|
}
|
|
|
|
if err := flag.Decode(args, cmd.Configuration); err != nil {
|
|
return false, fmt.Errorf("failed to decode configuration from flags: %w", err)
|
|
}
|
|
|
|
log.Print("Configuration loaded from flags")
|
|
|
|
return true, nil
|
|
}
|