generated from templates/go-generic
Dan Anglin
4fdad2d805
- Set the project's placeholder name to indieauth-server. - Update the magefiles and CI workflow. - Add the version command to print the app's build information. - Add the serve command to run the HTTP server.
17 lines
365 B
Go
17 lines
365 B
Go
package executors
|
|
|
|
func Execute(args []string) error {
|
|
command := newCommand(args)
|
|
|
|
executorFuncMap := map[string]func(args []string) error{
|
|
"serve": executeServeCommand,
|
|
"version": executeVersionCommand,
|
|
}
|
|
|
|
executeFunc, ok := executorFuncMap[command.name]
|
|
if !ok {
|
|
return UnrecognisedCommandError{command.name}
|
|
}
|
|
|
|
return executeFunc(command.args)
|
|
}
|