use clap::Args;
use std::path::PathBuf;
#[derive(Args)]
pub struct LogArgs {
#[arg(value_name = "COMMAND")]
pub command: String,
#[arg(short = 'T', long)]
pub timestamp: Option<i64>,
#[arg(short = 'D', long)]
pub directory: Option<String>,
#[arg(long)]
pub no_redact: bool,
#[arg(short = 'E', long)]
pub exit_code: Option<i32>,
#[arg(short = 'S', long)]
pub session_id: Option<String>,
}
#[derive(Args)]
pub struct EndSessionArgs {
#[arg(value_name = "SESSION_ID")]
pub session_id: String,
}
#[derive(Args)]
pub struct AuthArgs {
#[arg(value_name = "ITEM")]
pub item: Option<String>,
#[arg(short = 'L', long)]
pub list: bool,
#[arg(long)]
pub export: bool,
#[arg(long)]
pub clear: bool,
#[arg(long, value_name = "KEY:VALUE")]
pub set: Option<String>,
#[arg(short = 'S', long)]
pub session_id: Option<String>,
}
#[derive(Args)]
pub struct SearchArgs {
#[arg(value_name = "TERM")]
pub term: String,
#[arg(short = 'D', long)]
pub directory: Option<String>,
#[arg(short = 'E', long)]
pub exact: bool,
#[arg(short = 'C', long)]
pub case_sensitive: bool,
#[arg(short = 'R', long)]
pub regex: bool,
#[arg(long)]
pub redacted_only: bool,
#[arg(short = 'L', long, default_value = "50")]
pub limit: usize,
#[arg(short = 'T', long)]
pub timestamps: bool,
#[arg(long)]
pub show_dirs: bool,
#[arg(long)]
pub since: Option<String>,
#[arg(long)]
pub before: Option<String>,
}
#[derive(Args)]
pub struct ImportArgs {
#[arg(value_enum, default_value = "zsh")]
pub shell: ShellType,
#[arg(short = 'F', long)]
pub file: Option<PathBuf>,
#[arg(long)]
pub dry_run: bool,
#[arg(long)]
pub no_dedup: bool,
#[arg(long)]
pub days: Option<u32>,
#[arg(long)]
pub progress: bool,
}
#[derive(Args)]
pub struct ExportArgs {
#[arg(value_enum, default_value = "json")]
pub format: ExportFormat,
#[arg(short = 'O', long)]
pub output: Option<PathBuf>,
#[arg(long)]
pub include_redacted: bool,
#[arg(long)]
pub include_original: bool,
#[arg(short = 'D', long)]
pub directory: Option<String>,
#[arg(long)]
pub days: Option<u32>,
}
#[derive(Args)]
pub struct StatsArgs {
#[arg(short = 'D', long)]
pub detailed: bool,
#[arg(long)]
pub redaction: bool,
#[arg(long)]
pub directories: bool,
#[arg(long)]
pub time_stats: bool,
}
#[derive(Args)]
pub struct ClearArgs {
#[arg(short = 'F', long)]
pub force: bool,
#[arg(long)]
pub keep: Option<usize>,
#[arg(long)]
pub older_than: Option<u32>,
}
#[derive(Args)]
pub struct ConfigArgs {
#[arg(long)]
pub show: bool,
#[arg(long)]
pub init: bool,
#[arg(long)]
pub validate: bool,
#[arg(long)]
pub set: Option<String>,
#[arg(long)]
pub get: Option<String>,
}
#[derive(Args)]
pub struct FzfArgs {
#[arg(short = 'U', long)]
pub unique: bool,
#[arg(short = 'D', long)]
pub directory: Option<String>,
#[arg(short = 'L', long, default_value = "1000")]
pub limit: usize,
#[arg(short = 'R', long)]
pub reverse: bool,
}
#[derive(Args)]
pub struct ShellArgs {
#[arg(value_enum)]
pub shell: ShellType,
#[arg(short = 'O', long)]
pub output: Option<PathBuf>,
#[arg(long)]
pub custom_bindings: bool,
}
#[derive(Args)]
pub struct RecentArgs {
#[arg(short = 'n', long, default_value = "20")]
pub count: usize,
#[arg(short = 'D', long)]
pub directory: Option<String>,
#[arg(short = 'T', long)]
pub timestamps: bool,
}
#[derive(Args)]
pub struct FrequentArgs {
#[arg(short = 'n', long, default_value = "10")]
pub count: usize,
#[arg(long)]
pub directories: bool,
#[arg(long)]
pub counts: bool,
}
#[derive(Args)]
pub struct ValidateArgs {
#[arg(value_name = "PATTERN")]
pub pattern: String,
#[arg(short = 't', long)]
pub test: Option<String>,
}
#[derive(Args)]
pub struct MergeArgs {
#[arg(value_name = "DB_FILE")]
pub db_file: PathBuf,
#[arg(long)]
pub dry_run: bool,
#[arg(long)]
pub progress: bool,
}
#[derive(Args)]
pub struct TokensArgs {
#[arg(short = 'S', long)]
pub session: Option<String>,
#[arg(short = 'D', long)]
pub directory: Option<String>,
#[arg(short = 'C', long)]
pub command_id: Option<i64>,
#[arg(long)]
pub show_values: bool,
#[arg(short = 'O', long)]
pub output: Option<PathBuf>,
}
#[derive(Args)]
pub struct HostsArgs {
#[arg(short = 'L', long)]
pub list: bool,
#[arg(short = 'S', long)]
pub show_sessions: Option<i64>,
#[arg(short = 'D', long)]
pub detailed: bool,
}
#[derive(Args)]
pub struct SessionsArgs {
#[arg(short = 'H', long)]
pub host_id: Option<i64>,
#[arg(short = 'A', long)]
pub active: bool,
#[arg(short = 'C', long)]
pub show_commands: Option<String>,
#[arg(short = 'D', long)]
pub detailed: bool,
}
#[derive(Args)]
pub struct AliasArgs {
#[command(subcommand)]
pub command: AliasCommands,
}
#[derive(clap::Subcommand)]
pub enum AliasCommands {
Add(AliasAddArgs),
Update(AliasUpdateArgs),
Remove(AliasRemoveArgs),
List(AliasListArgs),
Export(AliasExportArgs),
Sync,
}
#[derive(Args)]
pub struct AliasAddArgs {
pub name: String,
pub command: String,
pub description: String,
}
#[derive(Args)]
pub struct AliasUpdateArgs {
pub name: String,
pub command: String,
#[arg(short, long)]
pub description: Option<String>,
}
#[derive(Args)]
pub struct AliasRemoveArgs {
pub name: String,
}
#[derive(Args)]
pub struct AliasListArgs {
#[arg(long)]
pub shell: bool,
}
#[derive(Args)]
pub struct AliasExportArgs {
#[arg(short = 'O', long)]
pub output: Option<std::path::PathBuf>,
}
#[derive(Args)]
pub struct VacuumArgs {
#[arg(long)]
pub max_entries: Option<usize>,
}
#[derive(clap::ValueEnum, Clone)]
pub enum ShellType {
Zsh,
Bash,
Fish,
}
#[derive(clap::ValueEnum, Clone)]
pub enum ExportFormat {
Json,
Csv,
Tsv,
Plain,
}