1use std::path::PathBuf;
2
3use thiserror::Error;
4
5#[derive(Debug, PartialEq, Error)]
6pub enum RopsCliError {
7 #[error("multiple inputs; received content from stdin when a file path was provided")]
8 MultipleInputs,
9 #[error("missing input; neither a file path nor stdin were provided")]
10 MissingInput,
11 #[error("unable to determine input format; {0}")]
12 UndeterminedFormat(#[from] UndeterminedFormatError),
13}
14
15#[derive(Debug, PartialEq, Error)]
16pub enum UndeterminedFormatError {
17 #[error("found neither format nor file arguments")]
18 FoundNeither,
19 #[error("unable to determine file extension for {0} when no format argument was found")]
20 NoFileExtension(PathBuf),
21}
22
23pub const IN_PLACE_PANIC: &str = "inplace argument not declared with a #[requires = \"file\"] field attribute.";