Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
feudal
feudalSSH
Commits
3728033e
Commit
3728033e
authored
Feb 28, 2019
by
Lukas Burgey
Browse files
Enhance service list
parent
e30076a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.go
View file @
3728033e
...
...
@@ -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
\t
Description
\t\n
"
)
for
_
,
s
:=
range
services
{
fmt
.
P
rint
ln
(
s
)
fmt
.
Fp
rint
f
(
w
,
" - '%s'
\t
%s
\t\n
"
,
s
.
Name
,
s
.
Description
)
}
log
.
Fatal
(
"Specify service name to use. See --help"
)
w
.
Flush
()
fmt
.
Println
(
"
\n
Specify service name to use. See --help"
)
os
.
Exit
(
1
)
}
// find the service id
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment