Add help output
This commit is contained in:
@@ -131,7 +131,7 @@ func main() {
|
||||
|
||||
args := flag.Args()
|
||||
if len(args) == 0 {
|
||||
showConfig(*configFile)
|
||||
showHelp()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -142,6 +142,7 @@ func main() {
|
||||
generateEnv(*configFile)
|
||||
default:
|
||||
fmt.Fprintf(os.Stderr, "Unknown command: %s\n", args[0])
|
||||
showHelp()
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
@@ -160,6 +161,19 @@ func loadConfig(yamlFile string) Config {
|
||||
return config
|
||||
}
|
||||
|
||||
func showHelp() {
|
||||
fmt.Printf("Usage: %s [options] <command>\n\n", os.Args[0])
|
||||
fmt.Printf("Options:\n")
|
||||
fmt.Printf(" -c <file> Path to YAML configuration file (default: ./tesseract-staging.yaml)\n\n")
|
||||
fmt.Printf("Commands:\n")
|
||||
fmt.Printf(" gen-html Generate index.html and log.v3.json files in each log's localdirectory.\n")
|
||||
fmt.Printf(" Creates HTML pages with log information and CT log metadata JSON.\n")
|
||||
fmt.Printf(" Computes LOG_ID and public keys from private keys.\n\n")
|
||||
fmt.Printf(" gen-env Generate .env files and combined roots.pem in each log's localdirectory.\n")
|
||||
fmt.Printf(" Creates TESSERACT_ARGS environment variable with command line flags.\n")
|
||||
fmt.Printf(" Combines global roots and log-specific extraroots into roots.pem.\n\n")
|
||||
}
|
||||
|
||||
func showConfig(yamlFile string) {
|
||||
config := loadConfig(yamlFile)
|
||||
|
||||
|
Reference in New Issue
Block a user