mirror of
https://github.com/clap-rs/clap
synced 2025-01-05 17:28:42 +00:00
Merge pull request #3138 from epage/disp
refactor: Clarify explicit display order wins
This commit is contained in:
commit
313b5e3c80
1 changed files with 3 additions and 9 deletions
|
@ -2879,19 +2879,13 @@ impl<'help> App<'help> {
|
||||||
.args
|
.args
|
||||||
.args_mut()
|
.args_mut()
|
||||||
.filter(|a| !a.is_positional())
|
.filter(|a| !a.is_positional())
|
||||||
.filter(|a| a.get_display_order() == 999)
|
|
||||||
.filter(|a| a.provider != ArgProvider::Generated)
|
.filter(|a| a.provider != ArgProvider::Generated)
|
||||||
.enumerate()
|
.enumerate()
|
||||||
{
|
{
|
||||||
a.disp_ord = Some(i);
|
a.disp_ord.get_or_insert(i);
|
||||||
}
|
}
|
||||||
for (i, mut sc) in &mut self
|
for (i, sc) in &mut self.subcommands.iter_mut().enumerate() {
|
||||||
.subcommands
|
sc.disp_ord.get_or_insert(i);
|
||||||
.iter_mut()
|
|
||||||
.enumerate()
|
|
||||||
.filter(|&(_, ref sc)| sc.get_display_order() == 999)
|
|
||||||
{
|
|
||||||
sc.disp_ord = Some(i);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for sc in &mut self.subcommands {
|
for sc in &mut self.subcommands {
|
||||||
|
|
Loading…
Reference in a new issue