refactor: update Config to support multiple directories and add relative path option
Some checks failed
Continuous Integration / Build and Test on ubuntu-latest (push) Failing after 1m27s
Some checks failed
Continuous Integration / Build and Test on ubuntu-latest (push) Failing after 1m27s
This commit is contained in:
16
src/main.rs
16
src/main.rs
@@ -8,16 +8,16 @@ use tracing_subscriber::FmtSubscriber;
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(author, version, about, long_about = None)]
|
||||
struct Args {
|
||||
#[arg(default_value = ".")]
|
||||
directory: PathBuf,
|
||||
#[arg(default_value = ".", value_delimiter = ' ', num_args=1..)]
|
||||
directory: Vec<PathBuf>,
|
||||
|
||||
#[arg(short, long)]
|
||||
output: Option<PathBuf>,
|
||||
|
||||
#[arg(short, long, use_value_delimiter = true, default_value = "")]
|
||||
#[arg(short, long, value_delimiter = ',', num_args = 0..)]
|
||||
include: Vec<String>,
|
||||
|
||||
#[arg(short, long, use_value_delimiter = true, default_value = "")]
|
||||
#[arg(short, long, value_delimiter = ',', num_args = 0..)]
|
||||
exclude: Vec<String>,
|
||||
|
||||
#[arg(long, value_enum, default_value_t = Format::Console)]
|
||||
@@ -32,16 +32,19 @@ struct Args {
|
||||
#[arg(short = 'l', long)]
|
||||
line_numbers: bool,
|
||||
|
||||
#[arg(short = 'H', long)]
|
||||
#[arg(short = 'H', long, default_value_t = true)]
|
||||
ignore_hidden: bool,
|
||||
|
||||
#[arg(short = 'R', long, default_value_t = true)]
|
||||
respect_gitignore: bool,
|
||||
|
||||
#[arg(long, default_value_t = false)]
|
||||
relative_path: bool,
|
||||
}
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let subscriber = FmtSubscriber::builder()
|
||||
.with_max_level(LevelFilter::INFO)
|
||||
.with_max_level(LevelFilter::DEBUG)
|
||||
.finish();
|
||||
tracing::subscriber::set_global_default(subscriber).expect("setting default subscriber failed");
|
||||
|
||||
@@ -69,6 +72,7 @@ fn main() -> Result<()> {
|
||||
line_numbers: args.line_numbers,
|
||||
ignore_hidden: args.ignore_hidden,
|
||||
respect_gitignore: args.respect_gitignore,
|
||||
relative_path: args.relative_path,
|
||||
};
|
||||
|
||||
debug!("Starting codebase to prompt with config: {:?}", config);
|
||||
|
Reference in New Issue
Block a user