Commit 3728033e authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Enhance service list

parent e30076a0
......@@ -12,6 +12,7 @@ import (
"os/exec"
"path/filepath"
"strings"
"text/tabwriter"
"time"
api "git.scc.kit.edu/feudal/feudalSSH/api"
......@@ -165,11 +166,20 @@ func findServiceID() (serviceID int) {
json.Unmarshal(serviceBytes, &services)
if *serviceName == "" {
fmt.Println("Available services:")
fmt.Printf("Available services: (Services availability is based on your VO membership)\n\n")
const (
minWidth = 0
padding = 3
tabWidth = 4
)
w := tabwriter.NewWriter(os.Stdout, minWidth, tabWidth, padding, ' ', 0)
fmt.Fprintf(w, "Service Name\tDescription\t\n")
for _, s := range services {
fmt.Println(s)
fmt.Fprintf(w, " - '%s'\t%s\t\n", s.Name, s.Description)
}
log.Fatal("Specify service name to use. See --help")
w.Flush()
fmt.Println("\nSpecify service name to use. See --help")
os.Exit(1)
}
// find the service id
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment