use clap::{Parser, Subcommand};
use std::path::PathBuf;
#[derive(Parser)]
#[command(name = "pdfx")]
#[command(about = "🛠️ A lightning-fast terminal-native PDF toolkit")]
#[command(version = "0.2.0")]
#[command(author = "ions <zara.leonardo@gmail.com>")]
#[command(
long_about = "pdfx is a lightning-fast terminal-native PDF toolkit. It allows you to index, search, and manage your PDF files with ease.
EXAMPLES:
# Initialize PDF index
pdfx init # Indexes current directory
pdfx init ~ # Indexes home directory
pdfx init ~/Documents # Indexes specific directory
# Search indexed PDFs
pdfx search \"machine learning\" # Search in both filename and content
pdfx search \"rust\" --filename # Search in filenames only
pdfx search \"concurrency\" --content # Search in content only
# List PDFs
pdfx list # Show recent PDFs only
pdfx list -a # Show all PDFs with details
# Clean up
pdfx cleanup # Removes all indexed data"
)]
pub struct Cli {
#[command(subcommand)]
pub command: Option<Commands>,
}
#[derive(Subcommand)]
pub enum Commands {
#[command(name = "init")]
Init {
path: Option<PathBuf>,
},
#[command(name = "search")]
Search {
query: String,
},
#[command(name = "list")]
List {
},
#[command(name = "export")]
Export {
#[arg(short, long)]
format: Option<String>,
},
#[command(name = "cleanup")]
Cleanup,
}