Skip to content

Commit

Permalink
feat: add command to create default config
Browse files Browse the repository at this point in the history
  • Loading branch information
benpueschel committed Jul 6, 2024
1 parent d80983a commit 9be661b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ pub mod remote;
#[derive(Debug, Clone, StructOpt)]
#[structopt(name = "gritty", about = "A tool to manage remote git repositories.")]
pub enum Args {
#[structopt(about = "Create a default config")]
CreateConfig,
#[structopt(about = "List repositories on a remote")]
List {
#[structopt(help = "Name of the remote as defined in the config (ex: 'github')")]
Expand Down Expand Up @@ -83,6 +85,11 @@ async fn main() -> Result<(), Box<dyn Error>> {
let command = Args::from_args();

match command {
Args::CreateConfig => {
log::println("Creating default config...");
Config::save_default()?;
return Ok(());
}
Args::List { remote } => {
log::print("Listing repositories on remote '");
log::info(&remote);
Expand Down

0 comments on commit 9be661b

Please sign in to comment.