Skip to content

Commit

Permalink
Rename config generate to config init
Browse files Browse the repository at this point in the history
  • Loading branch information
9999years committed Oct 21, 2024
1 parent aa6cabf commit 8d2fdde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::add::WorktreePlan;
use crate::app_git::AppGit;
use crate::cli;
use crate::cli::ConfigCommand;
use crate::cli::ConfigGenerateArgs;
use crate::cli::ConfigInitArgs;
use crate::config::Config;
use crate::convert::ConvertPlan;
use crate::convert::ConvertPlanOpts;
Expand Down Expand Up @@ -57,15 +57,13 @@ impl App {
.execute()?,
cli::Command::Clone(args) => crate::clone::clone(self.git()?, args.to_owned())?,
cli::Command::Add(args) => WorktreePlan::new(self.git()?, args)?.execute()?,
cli::Command::Config(ConfigCommand::Generate(args)) => {
self.config_generate(args.to_owned())?
}
cli::Command::Config(ConfigCommand::Init(args)) => self.config_init(args.to_owned())?,
}

Ok(())
}

fn config_generate(&self, args: ConfigGenerateArgs) -> miette::Result<()> {
fn config_init(&self, args: ConfigInitArgs) -> miette::Result<()> {
let path = match &args.output {
Some(path) => {
if path == "-" {
Expand Down
4 changes: 2 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ pub struct AddArgsInner {
#[derive(Debug, Clone, Subcommand)]
pub enum ConfigCommand {
/// Initialize a default configuration file.
Generate(ConfigGenerateArgs),
Init(ConfigInitArgs),
}

#[derive(Args, Clone, Debug)]
pub struct ConfigGenerateArgs {
pub struct ConfigInitArgs {
/// The location to write the configuration file. Can be `-` for stdout. Defaults to
/// `~/.config/git-prole/config.toml`.
pub output: Option<Utf8PathBuf>,
Expand Down

0 comments on commit 8d2fdde

Please sign in to comment.