-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move `gritty list-remotes` into `gritty remote list` to allow grouping common remote operations - like adding, deleting and configuring remotes in the future. BREAKING CHANGE: `gritty list-remotes` is now `gritty remote list`
- Loading branch information
1 parent
b1ac66a
commit 2e4b717
Showing
6 changed files
with
36 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use clap::{Parser, Subcommand}; | ||
|
||
#[derive(Debug, Clone, Parser)] | ||
#[command(about = "Remote operations")] | ||
pub struct Remote { | ||
#[command(subcommand)] | ||
pub subcommand: RemoteCommands, | ||
} | ||
#[derive(Debug, Clone, Subcommand)] | ||
pub enum RemoteCommands { | ||
#[command(about = "List all configured remotes")] | ||
List, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use gritty_clap::remote::{Remote, RemoteCommands}; | ||
|
||
use crate::config::Config; | ||
use crate::error::Result; | ||
|
||
pub mod list; | ||
|
||
pub use list::list_remotes; | ||
|
||
pub async fn remote(remote: Remote, config: &Config) -> Result<()> { | ||
match remote.subcommand { | ||
RemoteCommands::List => list_remotes(config).await, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters