Skip to content

Commit 56bc4f4

Browse files
committed
chore(services): optimize service command parameters
1 parent eb13ce6 commit 56bc4f4

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

parser/services.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,22 @@ func servicesAdd(argv []string, cmdr cmd.Commander) error {
4444
usage := `
4545
Creates extra service for an application and binds it to specific route of the main app domain
4646
47-
Usage: drycc services:add --type=<type> --protocol=<protocol> --port=<port>:<target_port> [options]
47+
Usage: drycc services:add <type> <port>:<target> [options]
4848
4949
Arguments:
5050
<type>
5151
procfile type which should handle the request, e.g. webhooks (should be bind to the port PORT).
5252
only single extra service per Porcfile type could be created
53-
<protocol>
54-
the IP protocol for this port. Supports TCP, UDP, and SCTP. Default is TCP.
5553
<port>
5654
the port that will be exposed by this service.
57-
<targetPort>
55+
<target>
5856
number or name of the port to access on the pods targeted by the service.
5957
6058
Options:
6159
-a --app=<app>
6260
the uniquely identifiable name for the application.
61+
--protocol=<protocol>
62+
the IP protocol for this port. Supports TCP, UDP, and SCTP. Default is TCP.
6363
`
6464

6565
args, err := docopt.ParseArgs(usage, argv, "")
@@ -69,9 +69,9 @@ Options:
6969
}
7070

7171
app := safeGetString(args, "--app")
72-
procfileType := safeGetString(args, "--type")
72+
procfileType := safeGetString(args, "<type>")
7373
protocol := safeGetString(args, "--protocol")
74-
ports := safeGetString(args, "--port")
74+
ports := safeGetString(args, "<port>:<target>")
7575
return cmdr.ServicesAdd(app, procfileType, ports, protocol)
7676
}
7777

@@ -101,20 +101,20 @@ func servicesRemove(argv []string, cmdr cmd.Commander) error {
101101
usage := `
102102
Deletes specific extra service for application
103103
104-
Usage: drycc services:remove --type=<type> --protocol=<protocol> --port=<port> [options]
104+
Usage: drycc services:remove <type> <port> [options]
105105
106106
Arguments:
107107
<type>
108108
procfile type which should handle the request, e.g. webhooks (should be bind to the port PORT).
109109
Only single extra service per Porcfile type could be created
110-
<protocol>
111-
the IP protocol for this port. Supports TCP, UDP, and SCTP. Default is TCP.
112110
<port>
113111
the port exposed by this service.
114112
115113
Options:
116114
-a --app=<app>
117115
the uniquely identifiable name for the application.
116+
--protocol=<protocol>
117+
the IP protocol for this port. Supports TCP, UDP, and SCTP. Default is TCP.
118118
`
119119

120120
args, err := docopt.ParseArgs(usage, argv, "")
@@ -124,9 +124,9 @@ Options:
124124
}
125125

126126
app := safeGetString(args, "--app")
127-
procfileType := safeGetString(args, "--type")
127+
procfileType := safeGetString(args, "<type>")
128128
protocol := safeGetString(args, "--protocol")
129-
port := safeGetInt(args, "--port")
129+
port := safeGetInt(args, "<port>")
130130

131131
return cmdr.ServicesRemove(app, procfileType, protocol, port)
132132
}

0 commit comments

Comments
 (0)