Lines Matching refs:error

20 use crate::error::ErrorKind;
21 use crate::error::Result as ClapResult;
426 /// Most error states are handled as asserts under the assumption they are programming mistake
459 /// Custom error message for post-parsing validation
464 /// # use clap::{Command, error::ErrorKind};
466 /// let err = cmd.error(ErrorKind::InvalidValue, "Some failure case");
468 pub fn error(&mut self, kind: ErrorKind, message: impl std::fmt::Display) -> Error {
543 /// [`ErrorKind::DisplayHelp`]: crate::error::ErrorKind::DisplayHelp
544 /// [`ErrorKind::DisplayVersion`]: crate::error::ErrorKind::DisplayVersion
616 /// [`ErrorKind::DisplayHelp`]: crate::error::ErrorKind::DisplayHelp
617 /// [`ErrorKind::DisplayVersion`]: crate::error::ErrorKind::DisplayVersion
963 /// assert!(r.is_ok(), "unexpected error: {:?}", r);
978 /// Replace prior occurrences of arguments rather than error
1115 /// # use clap::{Command, error::ErrorKind};
1190 /// # use clap::{Command, error::ErrorKind};
1213 /// # use clap::{Command, error::ErrorKind};
1411 /// Overrides the runtime-determined name of the binary for help and error messages.
1421 /// error or help messages.
1437 /// Overrides the runtime-determined display name of the program for help and error messages.
1657 /// Overrides the `clap` generated usage string for help and error messages.
1894 /// dispatch to `cmd module install` handling code. This is error prone and
1923 /// and `--save-runtime` *should* have been used. But again this is error
1926 /// an error!
2677 /// If no [`subcommand`] is present at runtime, error and exit gracefully.
2682 /// # use clap::{Command, error::ErrorKind};
2709 /// will **not** cause an error and instead be treated as a potential subcommand.
2741 /// [`ErrorKind::UnknownArgument`]: crate::error::ErrorKind::UnknownArgument
2908 /// and yet receive no error so long as the user uses a valid subcommand instead.
2914 /// This first example shows that it is an error to not use a required argument
2917 /// # use clap::{Command, Arg, error::ErrorKind};
2930 /// This next example shows that it is no longer error to not use a required argument if a
2934 /// # use clap::{Command, Arg, error::ErrorKind};
2977 /// - Let the error percolate up normally
2978 /// - Print a specialized error message using the
2984 /// When detecting the error condition, the [`ErrorKind`] isn't sufficient as a sub-subcommand
2985 /// might report the same error. Enable
3018 /// # use clap::{Command, error::ErrorKind};
3796 if let Err(error) = parser.get_matches_with(&mut matcher, raw_args, args_cursor) {
3798 debug!("Command::_do_parse: ignoring error: {}", error);
3800 return Err(error);