Skip to content

Commit

Permalink
fix(help): Use display name instead of bin name (unstable-v4)
Browse files Browse the repository at this point in the history
This will mean we won't have an awkard `.exe` in the middle on Windows

This means users can have a display name for their application rather
than it being dependent on the binary name it was run as

This means users can manually set it to use spaces instead of dashes for
separating things out.

Fixes #992
Fixes #1474
Fixes #1431
  • Loading branch information
epage committed May 5, 2022
1 parent 16791ab commit e4c096e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/output/help.rs
Expand Up @@ -32,6 +32,15 @@ pub(crate) struct Help<'help, 'cmd, 'writer> {

// Public Functions
impl<'help, 'cmd, 'writer> Help<'help, 'cmd, 'writer> {
#[cfg(feature = "unstable-v4")]
const DEFAULT_TEMPLATE: &'static str = "\
{before-help}{name} {version}\n\
{author-with-newline}{about-with-newline}\n\
{usage-heading}\n {usage}\n\
\n\
{all-args}{after-help}\
";
#[cfg(not(feature = "unstable-v4"))]
const DEFAULT_TEMPLATE: &'static str = "\
{before-help}{bin} {version}\n\
{author-with-newline}{about-with-newline}\n\
Expand All @@ -40,6 +49,13 @@ impl<'help, 'cmd, 'writer> Help<'help, 'cmd, 'writer> {
{all-args}{after-help}\
";

#[cfg(feature = "unstable-v4")]
const DEFAULT_NO_ARGS_TEMPLATE: &'static str = "\
{before-help}{name} {version}\n\
{author-with-newline}{about-with-newline}\n\
{usage-heading}\n {usage}{after-help}\
";
#[cfg(not(feature = "unstable-v4"))]
const DEFAULT_NO_ARGS_TEMPLATE: &'static str = "\
{before-help}{bin} {version}\n\
{author-with-newline}{about-with-newline}\n\
Expand Down

0 comments on commit e4c096e

Please sign in to comment.