go-script-bash
go-script-bash copied to clipboard
Add `subcommand` module with `@go.subcommand_select` function
The first implementation of demo-core (#57) will provide a list of available subcommands whenever it's actually executed, rather than one of its subcommands. When the argument list is empty, it's not an error; when it isn't empty, a subcommand wasn't found, hence it is an error.
The next iteration will include a select statement-based interface that will prompt the user to select a subcommand whenever the standard input (file descriptor zero) is a terminal. Since this behavior seems like it could be generally useful, I'll implement it as a module function.