Skip to content

Commit

Permalink
name fix for count_args in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
TanklesXL committed Feb 19, 2024
1 parent 7e47a2f commit 325d20f
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/glint.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(", ")
},
)
}
})
Expand Down Expand Up @@ -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,
)
}
}
Expand Down Expand Up @@ -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
]
Expand Down

0 comments on commit 325d20f

Please sign in to comment.