Function promote_leading_positionals

Source
pub(crate) fn promote_leading_positionals(args: &mut Vec<Arg>, cmd_path: &str)
Expand description

Clap rejects a definition in which an optional positional precedes a required one, because filling positionals in order makes it impossible to tell which argument a lone value belongs to. Clap 3 silently accepted the definition and then always filled the earlier positional first, so it was effectively required regardless of how it was declared. Promote those arguments so the declaration matches the behavior users already had, and say so, rather than aborting on a parser assertion.