access-engine/cmd/flex-auth/main.go

31 lines
797 B
Go
Raw Normal View History

// Command flex-auth is the CLI entry point for the flex-auth authorization
// registry and control plane.
//
// At skeleton stage this binary only reports its version. Subcommands
// (validate, load, test, check, batch-check, explain) are added in
// FLEX-WP-0002.
package main
import (
"flag"
"fmt"
"os"
)
// version is set at build time via -ldflags "-X main.version=…".
var version = "0.0.0-dev"
func main() {
showVersion := flag.Bool("version", false, "print version and exit")
flag.Parse()
if *showVersion || (flag.NArg() > 0 && flag.Arg(0) == "version") {
fmt.Println(version)
return
}
fmt.Fprintln(os.Stderr, "flex-auth: no subcommand yet (skeleton stage — see workplans/FLEX-WP-0002).")
fmt.Fprintln(os.Stderr, "Try: flex-auth --version")
os.Exit(64) // EX_USAGE
}