Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,20 @@ pub enum Commands {
#[arg(long)]
clear: bool,
},
/// Initialise Feluda in the current project (generates .feluda.toml and .pre-commit-config.yaml)
Init {
/// Path to the local project directory
#[arg(short, long, default_value = "./")]
path: String,

/// Overwrite existing config files without prompting
#[arg(long)]
force: bool,

/// Skip creating or updating .pre-commit-config.yaml
#[arg(long)]
no_pre_commit: bool,
},
}

#[derive(Parser, Debug, Clone)]
Expand Down Expand Up @@ -538,10 +552,7 @@ mod tests {
assert_eq!(language, Some("rust".to_string()));
assert_eq!(project_license, Some("MIT".to_string()));
}
Commands::Sbom { .. } => {
panic!("Expected Generate command");
}
Commands::Cache { .. } => {
Commands::Sbom { .. } | Commands::Cache { .. } | Commands::Init { .. } => {
panic!("Expected Generate command");
}
}
Expand Down Expand Up @@ -588,10 +599,7 @@ mod tests {
assert_eq!(language, None);
assert_eq!(project_license, None);
}
Commands::Sbom { .. } => {
panic!("Expected Generate command");
}
Commands::Cache { .. } => {
Commands::Sbom { .. } | Commands::Cache { .. } | Commands::Init { .. } => {
panic!("Expected Generate command");
}
}
Expand Down
Loading
Loading