Skip to content

Commit

Permalink
chgd formatting of remote list table
Browse files Browse the repository at this point in the history
  • Loading branch information
Omer Preminger committed Jul 21, 2023
1 parent 742aea7 commit bc13ce1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
- The commands related to OCI/Docker registries that were under `remote` have
been moved to their own, dedicated `registry` command. Run
`singularity help registry` for more information.
- The the `remote list` subcommand now outputs only remote endpoints (with
keyservers and OCI/Docker registries having been moved to separate commands),
and the output has been streamlined.

### New Features & Functionality

Expand Down
23 changes: 10 additions & 13 deletions internal/app/singularity/remote_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,28 @@ func RemoteList(usrConfigFile string) (err error) {
})
sort.Strings(names)

fmt.Println("Cloud Services Endpoints")
fmt.Println("========================")
fmt.Println()

tw := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
fmt.Fprintf(tw, listLine, "NAME", "URI", "ACTIVE", "GLOBAL", "EXCLUSIVE", "INSECURE")
fmt.Fprintf(tw, listLine, "NAME", "URI", "DEFAULT?", "GLOBAL?", "EXCLUSIVE?", "SECURE?")
for _, n := range names {
sys := "NO"
sys := ""
if c.Remotes[n].System {
sys = "YES"
sys = ""
}
excl := "NO"
excl := ""
if c.Remotes[n].Exclusive {
excl = "YES"
excl = ""
}
insec := "NO"
secure := ""
if c.Remotes[n].Insecure {
insec = "YES"
secure = "✗!"
}
active := "NO"
isDefault := ""
if c.DefaultRemote != "" && c.DefaultRemote == n {
active = "YES"
isDefault = ""
}

fmt.Fprintf(tw, listLine, n, c.Remotes[n].URI, active, sys, excl, insec)
fmt.Fprintf(tw, listLine, n, c.Remotes[n].URI, isDefault, sys, excl, secure)
}
tw.Flush()

Expand Down

0 comments on commit bc13ce1

Please sign in to comment.