Skip to content

Commit

Permalink
feat(clap): add force, unlink flags
Browse files Browse the repository at this point in the history
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
  • Loading branch information
cafkafk committed Oct 16, 2023
1 parent b1a0c99 commit cea9a4e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const HELP_TEMPLATE: &str = "\
//#[clap(author, version, about, long_about = None)]
#[derive(Parser, Debug)]
#[clap(
name="seidr - git gut",
name="seidr - declarative linkfarm",
author,
version,
long_version=env!("CARGO_PKG_VERSION"),
Expand Down Expand Up @@ -72,6 +72,14 @@ pub struct Args {
#[arg(short, long)]
pub no_emoji: bool,

/// (not imlemented)
#[arg(short, long)]
pub unlink: bool,

/// (not imlemented)
#[arg(short, long)]
pub force: bool,

#[arg(short, long)]
pub message: Option<String>,

Expand Down
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ fn main() {
args if args.code_of_conduct => println!("{}", utils::strings::INTERACTIVE_COC),
args if args.quiet => settings::QUIET.store(true, Ordering::Relaxed),
args if args.no_emoji => settings::EMOJIS.store(true, Ordering::Relaxed),
args if args.unlink => settings::UNLINK.store(true, Ordering::Relaxed),
args if args.force => settings::FORCE.store(true, Ordering::Relaxed),
args if args.message.is_some() => message_input = args.message.clone().unwrap(),
_ => (),
}
Expand Down
4 changes: 4 additions & 0 deletions src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ use std::sync::atomic::AtomicBool;
pub static QUIET: AtomicBool = AtomicBool::new(false);

pub static EMOJIS: AtomicBool = AtomicBool::new(false);

pub static UNLINK: AtomicBool = AtomicBool::new(false);

pub static FORCE: AtomicBool = AtomicBool::new(false);

0 comments on commit cea9a4e

Please sign in to comment.