Skip to content

Commit

Permalink
🎨 Hide --no-git if git is disabled, prevent warning
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixr-codes committed Oct 18, 2024
1 parent 00cc760 commit fd00cea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cli/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ pub fn cmd() -> Command {
Arg::new("init-git")
.long("no-git")
.help("Prevents creation of a git repository")
.action(ArgAction::SetFalse),
.action(ArgAction::SetFalse)
.hide(!cfg!(feature = "git")),
)
.arg(
Arg::new("gitignore")
Expand All @@ -37,6 +38,7 @@ pub fn run(matches: &ArgMatches) -> ExitCode {
let path: &PathBuf = matches.get_one("dir").unwrap();
let force: bool = matches.get_flag("force");
let with_gitignore: bool = matches.get_flag("gitignore");
#[cfg(feature = "git")]
let init_git: bool = matches.get_flag("init-git");

Project::new(
Expand Down

0 comments on commit fd00cea

Please sign in to comment.