diff --git a/src/render/context/mod.rs b/src/render/context/mod.rs index 586fed3b..137d4308 100644 --- a/src/render/context/mod.rs +++ b/src/render/context/mod.rs @@ -86,11 +86,11 @@ pub struct Context { pub report: bool, /// Print human-readable disk usage in report - #[arg(long)] + #[arg(long, requires = "report")] pub human: bool, /// Print file-name in report as opposed to full path - #[arg(long)] + #[arg(long, requires = "report")] pub file_name: bool, /// Sort-order to display directory content diff --git a/tests/report.rs b/tests/report.rs index 94bfe890..e08e19c5 100644 --- a/tests/report.rs +++ b/tests/report.rs @@ -73,3 +73,15 @@ fn report_with_level() { ) ) } + +#[test] +#[should_panic] +fn report_requires_human() { + utils::run_cmd(&["--human"]); +} + +#[test] +#[should_panic] +fn report_requires_file_name() { + utils::run_cmd(&["--file-name"]); +}