Lines Matching full:usage
1 #![cfg_attr(not(feature = "usage"), allow(unused_imports))]
2 #![cfg_attr(not(feature = "usage"), allow(unused_variables))]
3 #![cfg_attr(not(feature = "usage"), allow(clippy::manual_map))]
4 #![cfg_attr(not(feature = "usage"), allow(dead_code))]
16 pub(crate) struct Usage<'cmd> { struct
21 impl<'cmd> Usage<'cmd> { impl
23 Usage { in new()
34 …// Creates a usage string for display. This happens just after all arguments were parsed, but befo…
35 // any subcommands have been parsed (so as to give subcommands their own usage recursively)
37 debug!("Usage::create_usage_with_title"); in create_usage_with_title()
38 let usage = some!(self.create_usage_no_title(used)); in create_usage_with_title() localVariable
41 styled.header("Usage:"); in create_usage_with_title()
43 styled.extend(usage.into_iter()); in create_usage_with_title()
47 // Creates a usage string (*without title*) if one was not provided by the user manually.
49 debug!("Usage::create_usage_no_title"); in create_usage_no_title()
53 #[cfg(feature = "usage")] in create_usage_no_title()
62 #[cfg(not(feature = "usage"))] in create_usage_no_title()
70 #[cfg(feature = "usage")]
71 impl<'cmd> Usage<'cmd> { impl
72 // Creates a usage string for display in help messages (i.e. not for errors)
74 debug!("Usage::create_help_usage; incl_reqs={:?}", incl_reqs); in create_help_usage()
103 // Short-circuit full usage creation since no args will be relevant in create_help_usage()
122 debug!("Usage::create_help_usage: usage={}", styled); in create_help_usage()
126 // Creates a context aware usage string, or "smart usage" from currently used
129 debug!("Usage::create_smart_usage"); in create_smart_usage()
153 // Determines if we need the `[OPTIONS]` tag in the usage string
155 debug!("Usage::needs_options_tag"); in needs_options_tag()
157 debug!("Usage::needs_options_tag:iter: f={}", f.get_id()); in needs_options_tag()
161 debug!("Usage::needs_options_tag:iter Option is built-in"); in needs_options_tag()
166 debug!("Usage::needs_options_tag:iter Option is hidden"); in needs_options_tag()
170 debug!("Usage::needs_options_tag:iter Option is required"); in needs_options_tag()
174 debug!("Usage::needs_options_tag:iter:iter: grp_s={:?}", grp_s); in needs_options_tag()
176 debug!("Usage::needs_options_tag:iter:iter: Group is required"); in needs_options_tag()
181 debug!("Usage::needs_options_tag:iter: [OPTIONS] required"); in needs_options_tag()
185 debug!("Usage::needs_options_tag: [OPTIONS] not required"); in needs_options_tag()
189 // Returns the required args in usage string form by fully unrolling all groups
198 debug!("Usage::get_args: incls={:?}", incls,); in get_args()
227 debug!("Usage::get_args: unrolled_reqs={:?}", unrolled_reqs); in get_args()
312 debug!("Usage::get_args: ret_val={:?}", ret_val); in get_args()
323 "Usage::get_required_usage_from: incls={:?}, matcher={:?}, incl_last={:?}", in get_required_usage_from()
363 "Usage::get_required_usage_from: unrolled_reqs={:?}", in get_required_usage_from()
380 "Usage::get_required_usage_from:iter:{:?} group is_present={}", in get_required_usage_from()
407 "Usage::get_required_usage_from:iter:{:?} arg is_present={}", in get_required_usage_from()
438 debug!("Usage::get_required_usage_from: ret_val={:?}", ret_val); in get_required_usage_from()