Skip to content

Commit

Permalink
add docs as command, add handler in main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskim0987 committed Nov 1, 2024
1 parent a38eb5a commit 4cbebc0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ func main() {
Flags: append(config.ForkCLIFlags(envVarPrefix), baseFlags...),
Action: cliapp.LifecycleCmd(SupersimMain),
},
{
Name: config.DocsCommandName,
Usage: "Display available docs links",
Action: cliapp.LifecycleCmd(SupersimMain),
},
}

ctx := ctxinterrupt.WithSignalWaiterMain(context.Background())
Expand All @@ -89,6 +94,12 @@ func SupersimMain(ctx *cli.Context, closeApp context.CancelCauseFunc) (cliapp.Li
return nil, fmt.Errorf("invalid cli config: %w", err)
}

if ctx.Command.Name == config.DocsCommandName {
config.PrintDocLinks()
closeApp(nil)
os.Exit(0)
}

// use config and setup supersim
s, err := supersim.NewSupersim(log, envVarPrefix, closeApp, cfg)
if err != nil {
Expand Down

0 comments on commit 4cbebc0

Please sign in to comment.