Lines Matching defs:new

87         Self::new(kind).set_message(message.to_string())
115 /// let cmd = clap::Command::new("prog");
117 /// let mut err = clap::Error::new(ErrorKind::ValueValidation)
124 pub fn new(kind: ErrorKind) -> Self {
126 inner: Box::new(ErrorInner {
129 context: FlatMap::new(),
135 backtrace: Backtrace::new(),
143 /// Generally, this is used with [`Error::new`]
158 /// let cmd = Command::new("foo")
159 /// .arg(Arg::new("input").required(true));
233 /// match Command::new("Command").try_get_matches() {
253 let c = Colorizer::new(self.stream(), color_when).with_content(style.into_owned());
263 /// match Command::new("Command").try_get_matches() {
280 Self::new(kind).set_message(styled).with_cmd(cmd)
353 let mut err = Self::new(ErrorKind::ArgumentConflict).with_cmd(cmd);
380 let mut err = Self::new(ErrorKind::NoEquals).with_cmd(cmd);
402 let mut err = Self::new(ErrorKind::InvalidValue).with_cmd(cmd);
432 let mut err = Self::new(ErrorKind::InvalidSubcommand).with_cmd(cmd);
436 let mut styled_suggestion = StyledStr::new();
470 let mut err = Self::new(ErrorKind::InvalidSubcommand).with_cmd(cmd);
492 let mut err = Self::new(ErrorKind::MissingRequiredArgument).with_cmd(cmd);
515 let mut err = Self::new(ErrorKind::MissingSubcommand).with_cmd(cmd);
536 let mut err = Self::new(ErrorKind::InvalidUtf8).with_cmd(cmd);
555 let mut err = Self::new(ErrorKind::TooManyValues).with_cmd(cmd);
579 let mut err = Self::new(ErrorKind::TooFewValues).with_cmd(cmd);
608 let mut err = Self::new(ErrorKind::ValueValidation).set_source(err);
628 let mut err = Self::new(ErrorKind::WrongNumberOfValues).with_cmd(cmd);
659 let mut err = Self::new(ErrorKind::UnknownArgument).with_cmd(cmd);
665 let mut styled_suggestion = StyledStr::new();
683 let mut styled_suggestion = StyledStr::new();
716 let mut err = Self::new(ErrorKind::UnknownArgument).with_cmd(cmd);
720 let mut styled_suggestion = StyledStr::new();
801 let mut message = String::new();
842 fn new() -> Option<Self> {
843 Some(Self(backtrace::Backtrace::new()))
861 fn new() -> Option<Self> {