From 3239638024ae05637a692fb2c0b762fb735e57a5 Mon Sep 17 00:00:00 2001 From: Robert Attard Date: Tue, 12 Mar 2024 22:13:24 -0400 Subject: [PATCH] remove help_flag function from public api --- src/glint.gleam | 2 +- test/glint_test.gleam | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/glint.gleam b/src/glint.gleam index 36e81dc..479cb9a 100644 --- a/src/glint.gleam +++ b/src/glint.gleam @@ -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 } diff --git a/test/glint_test.gleam b/test/glint_test.gleam index bb1df1d..4842187 100644 --- a/test/glint_test.gleam +++ b/test/glint_test.gleam @@ -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 @@ -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 @@ -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 @@ -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 @@ -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