Skip to content

Commit

Permalink
Merge pull request #3138 from epage/disp
Browse files Browse the repository at this point in the history
refactor: Clarify explicit display order wins
  • Loading branch information
epage committed Dec 10, 2021
2 parents ae2b315 + d38452c commit 313b5e3
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/build/app/mod.rs
Expand Up @@ -2879,19 +2879,13 @@ impl<'help> App<'help> {
.args
.args_mut()
.filter(|a| !a.is_positional())
.filter(|a| a.get_display_order() == 999)
.filter(|a| a.provider != ArgProvider::Generated)
.enumerate()
{
a.disp_ord = Some(i);
a.disp_ord.get_or_insert(i);
}
for (i, mut sc) in &mut self
.subcommands
.iter_mut()
.enumerate()
.filter(|&(_, ref sc)| sc.get_display_order() == 999)
{
sc.disp_ord = Some(i);
for (i, sc) in &mut self.subcommands.iter_mut().enumerate() {
sc.disp_ord.get_or_insert(i);
}
}
for sc in &mut self.subcommands {
Expand Down

0 comments on commit 313b5e3

Please sign in to comment.