feat(remote): list remote with verbose option
This commit is contained in:
@@ -2,6 +2,8 @@ use clap::Values;
|
||||
|
||||
use crate::commands::config;
|
||||
|
||||
use super::config::get_all_remote;
|
||||
|
||||
pub struct RemoteArgs<'a> {
|
||||
pub name: Option<Values<'a>>,
|
||||
pub url: Option<Values<'a>>,
|
||||
@@ -19,3 +21,17 @@ pub fn remote_add(args: RemoteArgs) {
|
||||
let _ = config::add_remote(name, url);
|
||||
}
|
||||
|
||||
pub fn remote_list(verbose: bool) {
|
||||
let remotes = get_all_remote();
|
||||
for remote in remotes {
|
||||
if verbose
|
||||
{
|
||||
println!("{} {}", remote.0, remote.1);
|
||||
}
|
||||
else
|
||||
{
|
||||
println!("{}", remote.0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user