gitignore_template_generator/config/
impls.rs1use std::process::exit;
2
3use clap::{CommandFactory, Parser};
4
5use crate::{
6 config::{Args, ArgsParser},
7 constant,
8};
9
10pub struct DefaultArgsParser;
11
12impl ArgsParser for DefaultArgsParser {
13 fn parse() -> Args {
14 let args = Args::parse();
15
16 if args.show_author {
17 let cmd = Args::command();
18 if let Some(author) = cmd.get_author() {
19 println!("{author}");
20 } else {
21 println!(
22 "{}",
23 constant::error_messages::AUTHOR_INFOS_NOT_AVAILABLE
24 );
25 }
26
27 exit(constant::exit_status::SUCCESS);
28 }
29
30 args
31 }
32}