carto/src/cli/mod.rs

59 lines
1.4 KiB
Rust

pub mod tree;
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "where", about = "Universal system file and package mapper")]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
/// Scan system and build/update database
Scan {
#[arg(short, long, help = "Force full rescan")]
force: bool,
},
/// Show file information
File {
path: String,
},
/// List files in tree format for packages
Tree {
#[arg(long, help = "Show tree for specific package")]
package: Option<String>,
#[arg(short, long, help = "Maximum depth")]
depth: Option<usize>,
#[arg(short, long, help = "Filter by source type")]
source: Option<String>,
},
/// Search for files
Find {
#[arg(short, long, help = "File name pattern")]
name: Option<String>,
#[arg(short, long, help = "Package name")]
package: Option<String>,
#[arg(short, long, help = "Files larger than size")]
size: Option<String>,
},
/// Show package information
Package {
name: String,
},
/// List all packages
Packages {
#[arg(short, long, help = "Filter by source")]
source: Option<String>,
},
}