diff options
author | Sean Poulter <sean.poulter@gmail.com> | 2023-04-03 23:00:40 -0400 |
---|---|---|
committer | Sean Poulter <sean.poulter@gmail.com> | 2023-04-03 03:05:24 -0400 |
commit | bffdb0b03d7b94af26083053191a4d77feb4fb1a (patch) | |
tree | 4cece1083185a411edddede3c11b3d9f11a959f7 /src | |
parent | b5ffc734a2dfcf225b26ff5fd94ca8e772293bf6 (diff) |
fix(cli): init --force skips confirmation prompts
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd/init.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/init.rs b/src/cmd/init.rs index d8ce93d1..3a60d975 100644 --- a/src/cmd/init.rs +++ b/src/cmd/init.rs @@ -56,7 +56,7 @@ pub fn execute(args: &ArgMatches) -> Result<()> { "git" => builder.create_gitignore(true), _ => builder.create_gitignore(false), }; - } else { + } else if !args.get_flag("force") { println!("\nDo you want a .gitignore to be created? (y/n)"); if confirm() { builder.create_gitignore(true); @@ -65,6 +65,8 @@ pub fn execute(args: &ArgMatches) -> Result<()> { config.book.title = if args.contains_id("title") { args.get_one::<String>("title").map(String::from) + } else if args.get_flag("force") { + None } else { request_book_title() }; |