1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

df: migrate OptionsError to thiserror

Closes #7536
This commit is contained in:
Lewis Boon 2025-04-06 20:43:04 +01:00
parent 36e7b28426
commit 59d0e50397

View file

@ -115,10 +115,16 @@ impl Default for Options {
#[derive(Debug, Error)] #[derive(Debug, Error)]
enum OptionsError { enum OptionsError {
// TODO This needs to vary based on whether `--block-size`
// or `-B` were provided.
#[error("--block-size argument '{0}' too large")] #[error("--block-size argument '{0}' too large")]
BlockSizeTooLarge(String), BlockSizeTooLarge(String),
// TODO This needs to vary based on whether `--block-size`
// or `-B` were provided.,
#[error("invalid --block-size argument {0}")] #[error("invalid --block-size argument {0}")]
InvalidBlockSize(String), InvalidBlockSize(String),
// TODO This needs to vary based on whether `--block-size`
// or `-B` were provided.
#[error("invalid suffix in --block-size argument {0}")] #[error("invalid suffix in --block-size argument {0}")]
InvalidSuffix(String), InvalidSuffix(String),
@ -126,7 +132,10 @@ enum OptionsError {
#[error("option --output: field {0} used more than once")] #[error("option --output: field {0} used more than once")]
ColumnError(ColumnError), ColumnError(ColumnError),
#[error("{}", .0.iter().map(|t| format!("file system type {} both selected and excluded", t.quote())).collect::<Vec<String>>().join(format!("\n{}: ", uucore::util_name()).as_str()))] #[error("{}", .0.iter()
.map(|t| format!("file system type {} both selected and excluded", t.quote()))
.collect::<Vec<_>>()
.join(format!("\n{}: ", uucore::util_name()).as_str()))]
FilesystemTypeBothSelectedAndExcluded(Vec<String>), FilesystemTypeBothSelectedAndExcluded(Vec<String>),
} }