Skip to content

Commit ea4cb97

Browse files
zippoxerclaude
andcommitted
Add --help and --version flags
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 968e04a commit ea4cb97

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "recall"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
edition = "2021"
55
description = "Search and resume Claude Code and Codex CLI conversations"
66

src/main.rs

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,22 @@ use app::App;
1111
use crossterm::event::{self, Event, KeyCode, KeyModifiers, MouseEventKind};
1212
use std::time::Duration;
1313

14+
const VERSION: &str = env!("CARGO_PKG_VERSION");
15+
1416
fn main() -> Result<()> {
15-
// Collect command-line args (skip program name, join with spaces)
16-
let initial_query: String = std::env::args().skip(1).collect::<Vec<_>>().join(" ");
17+
// Handle --help and --version
18+
let args: Vec<String> = std::env::args().skip(1).collect();
19+
if args.iter().any(|a| a == "--help" || a == "-h") {
20+
print_help();
21+
return Ok(());
22+
}
23+
if args.iter().any(|a| a == "--version" || a == "-V") {
24+
println!("recall {}", VERSION);
25+
return Ok(());
26+
}
27+
28+
// Collect remaining args as initial search query
29+
let initial_query = args.join(" ");
1730

1831
// Initialize app (starts background indexing automatically)
1932
let mut app = App::new(initial_query)?;
@@ -129,3 +142,21 @@ fn copy_to_clipboard(text: &str) -> Result<()> {
129142
clipboard.set_text(text)?;
130143
Ok(())
131144
}
145+
146+
fn print_help() {
147+
println!(
148+
"recall {} - Search and resume Claude Code and Codex CLI conversations
149+
150+
Usage: recall [query]
151+
152+
Examples:
153+
recall
154+
recall foo
155+
recall foo bar
156+
157+
Options:
158+
-h, --help Print help
159+
-V, --version Print version",
160+
VERSION
161+
);
162+
}

0 commit comments

Comments
 (0)