gitignore-template-generator 0.3.5

A binary crate to generate templates for .gitignore files
Documentation
use std::process::exit;

use clap::{CommandFactory, Parser};

use crate::{
    config::{Args, ArgsParser},
    constant,
};

pub struct DefaultArgsParser;

impl ArgsParser for DefaultArgsParser {
    fn parse() -> Args {
        let args = Args::parse();

        if args.show_author {
            let cmd = Args::command();
            if let Some(author) = cmd.get_author() {
                println!("{author}");
            } else {
                println!(
                    "{}",
                    constant::error_messages::AUTHOR_INFOS_NOT_AVAILABLE
                );
            }

            exit(constant::exit_status::SUCCESS);
        }

        args
    }
}