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
2 changes: 1 addition & 1 deletion pkgs/id/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ pub struct Cli {
/// Each variant represents a distinct operation mode for the `id` tool.
/// Commands are organized by their primary function: storage, retrieval,
/// search, or system operations.
#[derive(Subcommand, Debug)]
/// Parses a result limit (`--first` / `--last` / peek `--lines`): zero is
/// rejected with a clear error instead of silently producing an empty result
/// or a header-only preview (#3059). Clap names the flag in its error prefix,
Expand All @@ -209,6 +208,7 @@ fn parse_result_limit(raw: &str) -> Result<usize, String> {
}
}

#[derive(Subcommand, Debug)]
pub enum Command {
/// Start a server that accepts put/get requests from peers.
///
Expand Down
6 changes: 3 additions & 3 deletions pkgs/id/src/repl/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1643,20 +1643,20 @@ mod tests {
#[test]
fn test_parse_find_args_invalid_format_is_error() {
let rest = ["--format", "gorup", "hello"];
let args = parse_find_args(&rest, "union");
let args = parse_find_args(&rest, "union").unwrap();
assert_eq!(args.format_error, Some("gorup"));
assert_eq!(args.format, "union");

let rest = ["--format", "yaml", "hello"];
let args = parse_find_args(&rest, "tag");
let args = parse_find_args(&rest, "tag").unwrap();
assert_eq!(args.format_error, Some("yaml"));
}

#[test]
fn test_parse_find_args_valid_format_is_stored() {
for good in ["tag", "group", "union"] {
let rest = ["--format", good, "hello"];
let args = parse_find_args(&rest, "union");
let args = parse_find_args(&rest, "union").unwrap();
assert_eq!(args.format_error, None);
assert_eq!(args.format, good);
}
Expand Down