From 325d20f1cf8beb43e1e7c9d0ce7119b00aea0017 Mon Sep 17 00:00:00 2001 From: Robert Attard Date: Mon, 19 Feb 2024 16:02:55 -0500 Subject: [PATCH] name fix for count_args in comment --- src/glint.gleam | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/glint.gleam b/src/glint.gleam index 43e5adc..f3a2416 100644 --- a/src/glint.gleam +++ b/src/glint.gleam @@ -91,7 +91,7 @@ pub opaque type Glint(a) { Glint(config: Config, cmd: CommandNode(a), global_flags: FlagMap) } -/// Specify the expected number of arguments with this type and the `glint.count_args` function +/// Specify the expected number of arguments with this type and the `glint.unnamed_args` function /// pub type ArgsCount { /// Specifies that a command must accept a specific number of arguments @@ -369,8 +369,7 @@ fn do_execute( case args { // when there are no more available arguments // and help flag has been passed, generate help message - [] if help - -> + [] if help -> command_path |> cmd_help(cmd, config, global_flags) |> Help @@ -444,12 +443,12 @@ fn execute_root( False -> snag.error( "unmatched named arguments: " - <> { - contents.named_args - |> list.drop(list.length(named)) - |> list.map(fn(s) { "'" <> s <> "'" }) - |> string.join(", ") - }, + <> { + contents.named_args + |> list.drop(list.length(named)) + |> list.map(fn(s) { "'" <> s <> "'" }) + |> string.join(", ") + }, ) } }) @@ -479,8 +478,8 @@ fn execute_root( Error(#(snag, help)) -> Error( snag.pretty_print(snag) - <> "\nSee the following help text, available via the '--help' flag.\n\n" - <> help, + <> "\nSee the following help text, available via the '--help' flag.\n\n" + <> help, ) } } @@ -678,8 +677,8 @@ fn build_subcommands_help( Metadata( name: name, description: cmd.contents - |> option.map(fn(command) { command.description }) - |> option.unwrap(""), + |> option.map(fn(command) { command.description }) + |> option.unwrap(""), ), ..acc ]