glint
Types
Input type for Runner.
pub type CommandInput {
CommandInput(args: List(String), flags: FlagMap)
}
Constructors
-
CommandInput(args: List(String), flags: FlagMap)
Functions
pub fn add_command(to root: Command(a), at path: List(String), do f: fn(
CommandInput,
) -> a, with flags: List(Flag)) -> Command(a)
Adds a new command to be run at the specified path.
If the path is [], the root command is set with the provided function and flags.
pub fn execute(cmd: Command(a), args: List(String)) -> Result(
a,
Snag,
)
Determines which command to run and executes it.
Sets any provided flags if necessary.
Each value prefixed with -- is parsed as a flag.