-
Notifications
You must be signed in to change notification settings - Fork 302
fleetctl: Need return fail if no args given to some subcommand. #1230
base: master
Are you sure you want to change the base?
Conversation
Some subcommand like destroy/load/start/status/stop/submit/unload, need to give prompt if no args for them. Add the same prompt "One unit file must be provided" as the "cat" subcommand is doing: [root@localhost fleet-0.10.1]# fleetctl cat One unit file must be provided
Before the code, destroy/load/start/status/stop/submit/unload subcommand without any args will give 0 return value. It should return error code, like -1 as "cat" is doing now. That's why to add those codes. |
Maybe: "At least one unit file must be specified." |
Currently, "cat" subcommand give "One unit file must be provided". So other subcommand I gave the same. |
Yes, the
|
So I think we need modify the message of "cat", instead. |
Well, |
@@ -29,6 +29,10 @@ Destroyed units are impossible to start unless re-submitted.`, | |||
} | |||
|
|||
func runDestroyUnits(args []string) (exit int) { | |||
if len(args) == 0 { | |||
stderr("One unit file must be provided.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One or more unit files must be provided
@bcwaldon, are all commands or just stop need not give error if no args failing ?
|
14580b0
to
63b20dc
Compare
23d4b13
to
6fb1256
Compare
54409ab
to
a1a21b8
Compare
150d30c
to
4002bf5
Compare
3b60e93
to
875d938
Compare
bdc94e8
to
fa5aa3a
Compare
20a3e96
to
3aaa1ab
Compare
eb6872f
to
365565e
Compare
39a99ba
to
44591b0
Compare
0132632
to
6974811
Compare
Some subcommand like destroy/load/start/status/stop/submit/unload,
need to give prompt if no args for them.
Add the same prompt "One unit file must be provided" as the "cat"
subcommand is doing:
[root@localhost fleet-0.10.1]# fleetctl cat
One unit file must be provided