From acdd2c33f04034468a004a942aa1045108b897e9 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 9 Nov 2023 11:50:46 -0600 Subject: [PATCH] refactor(help): Make usage argument order consistent --- clap_builder/src/output/usage.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clap_builder/src/output/usage.rs b/clap_builder/src/output/usage.rs index bb2036c3..ebd7257d 100644 --- a/clap_builder/src/output/usage.rs +++ b/clap_builder/src/output/usage.rs @@ -129,7 +129,7 @@ impl<'cmd> Usage<'cmd> { ); } - self.write_args(&[], !incl_reqs, styled); + self.write_args(styled, &[], !incl_reqs); // incl_reqs is only false when this function is called recursively if self.cmd.has_visible_subcommands() && incl_reqs @@ -199,7 +199,7 @@ impl<'cmd> Usage<'cmd> { literal.render_reset() ); - self.write_args(used, false, styled); + self.write_args(styled, used, false); if self.cmd.is_subcommand_required_set() { let value_name = self @@ -266,7 +266,7 @@ impl<'cmd> Usage<'cmd> { } // Returns the required args in usage string form by fully unrolling all groups - pub(crate) fn write_args(&self, incls: &[Id], force_optional: bool, styled: &mut StyledStr) { + pub(crate) fn write_args(&self, styled: &mut StyledStr, incls: &[Id], force_optional: bool) { for required in self.get_args(incls, force_optional) { styled.push_styled(&required); styled.push_str(" ");