From 39ae1d8ae8597679c490609ca5c796b1272e8be6 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 3 Oct 2025 08:39:57 -0500 Subject: move urls to show repos --- argv.go | 14 +++++++------- main.go | 19 ++++++++++++++++--- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/argv.go b/argv.go index 6f63b6d..03d97a1 100644 --- a/argv.go +++ b/argv.go @@ -50,7 +50,6 @@ type ShowCmd struct { Dirty *EmptyCmd `arg:"subcommand:dirty" help:"show dirty git repos"` Repo *RepoCmd `arg:"subcommand:repos" help:"print a table of the current repos"` Tag *TagCmd `arg:"subcommand:tag" help:"show git tags"` - Urls *EmptyCmd `arg:"subcommand:urls" help:"show repo urls"` } func (ShowCmd) Examples() string { @@ -58,12 +57,13 @@ func (ShowCmd) Examples() string { } type RepoCmd struct { - All bool `arg:"--all" help:"select every repo (the default)"` - Mine bool `arg:"--mine" help:"your repos as defined in the forge config"` - Favorites bool `arg:"--favorites" help:"your repos configured as favorites"` - Private bool `arg:"--private" help:"your private repos from your .config/forge/"` - User bool `arg:"--user" help:"show repos on the user branch"` - Full bool `arg:"--full" help:"show full repo names"` + Urls *EmptyCmd `arg:"subcommand:urls" help:"show repo urls"` + All bool `arg:"--all" help:"select every repo (the default)"` + Mine bool `arg:"--mine" help:"your repos as defined in the forge config"` + Favorites bool `arg:"--favorites" help:"your repos configured as favorites"` + Private bool `arg:"--private" help:"your private repos from your .config/forge/"` + User bool `arg:"--user" help:"show repos on the user branch"` + Full bool `arg:"--full" help:"show full repo names"` // ReadOnly bool `arg:"--readonly" help:"include read-only repos"` } diff --git a/main.go b/main.go index c050541..63810c3 100644 --- a/main.go +++ b/main.go @@ -163,11 +163,11 @@ func main() { okExit("") } - if argv.Show.Urls != nil { - me.forge.PrintForgedTable(me.forge.Repos) + found := findRepos() + if showUrls() { + me.forge.PrintForgedTable(found) okExit("") } - found := findRepos() // print out the repos if argv.All { me.forge.PrintHumanTableFull(found) @@ -206,3 +206,16 @@ func main() { } okExit("") } + +func showUrls() bool { + if argv.Show == nil { + return false + } + if argv.Show.Repo == nil { + return false + } + if argv.Show.Repo.Urls != nil { + return true + } + return false +} -- cgit v1.2.3