Skip to content

Fix newline on missing positional argument - #5

Merged
jirutka merged 1 commit into
jirutka:masterfrom
ZettaScript:fix-newline
May 23, 2026
Merged

jirutka merged 1 commit into
jirutka:masterfrom
ZettaScript:fix-newline

Conversation

@ZettaScript

Copy link
Copy Markdown
Contributor

When both a positional argument and a subcommand are missing, the subcommand did not add the required newline. Example (from simple_example):

/// Top-level command.
#[derive(FromArgs, PartialEq, Debug)]
struct TopLevel {
    /// Foo
    #[argp(positional)]
    foo: String,

    /// Be verbose.
    #[argp(switch, global)]
    verbose: bool,

    #[argp(subcommand)]
    nested: MySubCommandEnum,
}

prints

Required positional arguments not provided:
    fooOne of the following subcommands must be present:
    help
    one
    two

The PR fixes this.

Also thank you for this crate which I use in all my new CLI projects (for the same good reasons as listed in your readme)!

@jirutka
jirutka merged commit a469d00 into jirutka:master May 23, 2026
10 checks passed
@jirutka

jirutka commented May 23, 2026

Copy link
Copy Markdown
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants