Skip to content

Commit

Permalink
updating list and cargo lock
Browse files Browse the repository at this point in the history
  • Loading branch information
mckernant1 committed May 21, 2020
1 parent 59fb5bd commit fef9051
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
30 changes: 15 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ subcommands:
- list:
about: list all of the directories managed by global git
args:
- list-dirs:
short: l
long: list-dirs
help: also gives the directories of git repos
- plain:
short: p
long: plain
help: lists just the projects by name with no directories
takes_value: false
- add:
about: Add a directory to the list maintained by global-git
Expand Down
11 changes: 7 additions & 4 deletions src/subcommands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,14 @@ pub fn pull(matches: ArgMatches, settings_file: SettingsFile) {

pub fn list(matches: ArgMatches, settings_file: SettingsFile) {
let repos = settings_file.list_repos();
let dirs_flag = matches.subcommand_matches("list")
.unwrap().is_present("list-dirs");
let plain_flag = matches.subcommand_matches("list")
.unwrap().is_present("plain");
for member in repos.members() {
if dirs_flag {
println!("name: {}\npath: {}\n", member["name"].to_string(), member["path"].to_string());
if ! plain_flag {
println!("{} -> {}",
member["name"].to_string(),
member["path"].to_string()
);
} else {
println!("{}", member["name"].to_string());
}
Expand Down

0 comments on commit fef9051

Please sign in to comment.