refactor: streamline console format determination logic in main function
This commit is contained in:
@@ -48,15 +48,15 @@ fn main() -> Result<()> {
|
|||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
|
|
||||||
let mut format = args.format;
|
let mut format = args.format;
|
||||||
if matches!(format, Format::Console) {
|
if matches!(format, Format::Console)
|
||||||
if let Some(output_path) = &args.output {
|
&& let Some(output_path) = &args.output
|
||||||
|
{
|
||||||
match output_path.extension().and_then(|s| s.to_str()) {
|
match output_path.extension().and_then(|s| s.to_str()) {
|
||||||
Some("md") => format = Format::Markdown,
|
Some("md") => format = Format::Markdown,
|
||||||
Some("txt") => format = Format::Text,
|
Some("txt") => format = Format::Text,
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
let config = codebase_to_prompt::Config {
|
let config = codebase_to_prompt::Config {
|
||||||
directory: args.directory,
|
directory: args.directory,
|
||||||
|
Reference in New Issue
Block a user