28 lines
502 B
Rust
28 lines
502 B
Rust
use crate::commands::config;
|
|
|
|
use super::config::get_all_remote;
|
|
|
|
pub struct RemoteArgs {
|
|
pub name: String,
|
|
pub url: String,
|
|
}
|
|
|
|
pub fn remote_add(args: RemoteArgs) {
|
|
let _ = config::add_remote(&args.name, &args.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);
|
|
}
|
|
}
|
|
|
|
}
|