indieauth-server/internal/executors/command.go
Dan Anglin d25c157b20
Some checks failed
CI / Tests (pull_request) Failing after 9s
CI / Style (pull_request) Failing after 9s
check formatting in ci
2024-10-13 12:52:44 +01:00

24 lines
347 B
Go

package executors
type command struct {
name string
args []string
}
func newCommand(args []string) command {
if len(args) == 0 {
return command{
name: "help",
args: make([]string, 0),
}
}
if len(args) == 1 {
return command{
name: args[0],
args: make([]string, 0),
}
}
return command{name: args[0], args: args[1:]}
}