From c0dee21e03a9d070bd80fd7b7b5be6366ba53104 Mon Sep 17 00:00:00 2001 From: godalming123 Date: Sat, 29 Apr 2023 10:33:11 +0100 Subject: [PATCH 1/3] add the listrepo command --- list.go | 7 +++++++ main.go | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/list.go b/list.go index 24249a8..ca4204a 100644 --- a/list.go +++ b/list.go @@ -91,3 +91,10 @@ func listCmd(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 +} diff --git a/main.go b/main.go index 68b1cc5..c38dde6 100644 --- a/main.go +++ b/main.go @@ -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", From 4fe502eb2b0816c45dec263215211622423aa852 Mon Sep 17 00:00:00 2001 From: godalming123 Date: Sat, 29 Apr 2023 10:34:54 +0100 Subject: [PATCH 2/3] add documentation for the listrepo command --- docs/usage.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/usage.md b/docs/usage.md index 68009de..cdd4020 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -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. From 6524c313997c2be56a59956f976bcbf3764d782c Mon Sep 17 00:00:00 2001 From: godalming123 Date: Sat, 29 Apr 2023 10:49:47 +0100 Subject: [PATCH 3/3] move command to repo.go --- list.go | 6 ------ repo.go | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/list.go b/list.go index ca4204a..6a1b94e 100644 --- a/list.go +++ b/list.go @@ -92,9 +92,3 @@ func listCmd(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 -} diff --git a/repo.go b/repo.go index 80a94ee..3e70377 100644 --- a/repo.go +++ b/repo.go @@ -21,6 +21,7 @@ package main import ( "os" "path/filepath" + "fmt" "github.com/pelletier/go-toml/v2" "github.com/urfave/cli/v2" @@ -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 +}