INNER CODE UNIT · Go
Main
cli/cli · .github/skills/cli-exercise/tool/internal/preflight/main.go:131
func Main(ctx context.Context, skillRoot string, args []string, streams cliutil.Streams) int {
options, err := parseOptions(args)
if errors.Is(err, flag.ErrHelp) {
_, err = fmt.Fprintln(streams.Out, "Usage: cli-exercise --skill-root PATH preflight check --output FILE [options]")
if err == nil {
return 0
}
}
code := 2
if err == nil {
code, err = run(ctx, skillRoot, options, streams, newService)
}
if err != nil {
if writeErr := cliutil.Error(streams.ErrOut, "preflight_blocked", err.Error()); writeErr != nil {
return 2
}
}
return code