Skip to content

Commit

Permalink
remove help_flag function from public api
Browse files Browse the repository at this point in the history
  • Loading branch information
TanklesXL committed Mar 13, 2024
1 parent 67c40ab commit c91848a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/glint.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ const help_flag_message = "--help\t\t\tPrint help information"
/// Function to create the help flag string
/// Exported for testing purposes only
///
pub fn help_flag() -> String {
fn help_flag() -> String {
flag.prefix <> help_flag_name
}

Expand Down
10 changes: 5 additions & 5 deletions test/glint_test.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ pub fn help_test() {
|> should.be_error()

// help message for root command
glint.execute(cli, [glint.help_flag()])
glint.execute(cli, ["--help"])
|> should.equal(
Ok(Help(
"This is the root command
Expand All @@ -219,7 +219,7 @@ SUBCOMMANDS:
)

// help message for command
glint.execute(cli, ["cmd1", glint.help_flag()])
glint.execute(cli, ["cmd1", "--help"])
|> should.equal(
Ok(Help(
"cmd1
Expand All @@ -241,7 +241,7 @@ SUBCOMMANDS:
)

// help message for nested command
glint.execute(cli, ["cmd1", "cmd4", glint.help_flag()])
glint.execute(cli, ["cmd1", "cmd4", "--help"])
|> should.equal(
Ok(Help(
"cmd1 cmd4
Expand All @@ -257,7 +257,7 @@ FLAGS:
)),
)
// help message for command with no additional flags
glint.execute(cli, ["cmd2", glint.help_flag()])
glint.execute(cli, ["cmd2", "--help"])
|> should.equal(
Ok(Help(
"cmd2
Expand All @@ -273,7 +273,7 @@ FLAGS:
)

// help message for command with no additional flags
glint.execute(cli, ["cmd1", "cmd3", glint.help_flag()])
glint.execute(cli, ["cmd1", "cmd3", "--help"])
|> should.equal(
Ok(Help(
"cmd1 cmd3
Expand Down

0 comments on commit c91848a

Please sign in to comment.