Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All notable changes to Puddi are recorded here. The format follows [Keep a Chang

### Fixed

- `pud add --name` requires a value instead of silently defaulting.
- `pud doc` preserves paragraph breaks in module documentation.
- Integer literals too large for the compiler's integer representation report an error instead of wrapping.
- List pattern exhaustiveness accounts for the exact lengths covered by rest patterns.
Expand Down
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,10 @@ fn main() -> ExitCode {
"--check" => check_only = true,
"--name" => {
i += 1;
name_opt = opts.get(i).cloned();
match opts.get(i) {
Some(n) => name_opt = Some(n.clone()),
None => return fail("--name needs a value"),
}
}
"-o" | "--out" => {
i += 1;
Expand Down
8 changes: 8 additions & 0 deletions tests/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,11 @@ fn plugin_host_capabilities() {
// the jobs are timed on their own, then the worker answers
assert!(text.contains(r#"["job2", "job1", "job0", "concurrent true", "worker Some(49)"]"#), "{text}");
}

#[test]
fn pud_add_name_requires_value() {
let out = pud().args(["add", "foo", "--name"]).output().unwrap();
assert!(!out.status.success());
let stderr = String::from_utf8_lossy(&out.stderr);
assert!(stderr.contains("--name needs a value"), "{stderr}");
}
Loading