Skip to content

Commit

Permalink
Merge pull request #73 from godalming123/add-listrepo-command
Browse files Browse the repository at this point in the history
  • Loading branch information
Elara6331 authored Apr 29, 2023
2 parents d03f39f + 6524c31 commit 6d090dd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ Example:
lure rr -n default
```

### listrepo

The listrepo command lists all of the repos you have.

Example:
```shell
lure lr
```

### refresh

The refresh command pulls all changes from all LURE repos that have changed.
Expand Down
1 change: 1 addition & 0 deletions list.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,4 @@ func listCmd(c *cli.Context) error {

return nil
}

6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ func main() {
Aliases: []string{"rr"},
Action: removerepoCmd,
},
{
Name: "listrepo",
Usage: "List all of the repos you have",
Aliases: []string{"lr"},
Action: listrepoCmd,
},
{
Name: "refresh",
Usage: "Pull all repositories that have changed",
Expand Down
8 changes: 8 additions & 0 deletions repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package main
import (
"os"
"path/filepath"
"fmt"

"github.com/pelletier/go-toml/v2"
"github.com/urfave/cli/v2"
Expand Down Expand Up @@ -112,3 +113,10 @@ func refreshCmd(c *cli.Context) error {
}
return nil
}

func listrepoCmd(c *cli.Context) error {
for _, repo := range cfg.Repos {
fmt.Printf("%s - %s\n", repo.Name, repo.URL)
}
return nil
}

0 comments on commit 6d090dd

Please sign in to comment.