Proposal: change the API options in rdctl to look more like the fields in jq
output
#5563
Replies: 4 comments
-
I think using randomly uppercase things in CLIs are more frustrating than they are worth it; we should stick with the current syntax. I don't understand the issue with seeing the options in help, given that you'd normally never want help unless you need it; in the new scheme, it's not obvious how the user would know what options are available. If anything, we should finally get around to fixing the command line parsing from the JS side to use the foo-bar syntax: |
Beta Was this translation helpful? Give feedback.
-
OTOH,
The caveat is that the user will need to use precise JSON syntax:
But it's better than what we have right now, which is requiring the user to fall back to the API, which also requires precise JSON |
Beta Was this translation helpful? Give feedback.
-
Implementation notes...But we run afoul with that golang
This isn't a problem when using To deal with this: In ServerSettingsForJSON change the following fields to pointers: Application.Extensions.Allowed.List That solves the dropped-empty-compound-object problem. |
Beta Was this translation helpful? Give feedback.
-
That was my thought as well. But then we should use the same names inside the JSON too1 because a user should never have to deal with both notations, as in TOGGLE=$(rdctl api settings | jq '.experimental.virtualMachine.proxy.enabled|not')
rdctl set --experimental.virtual-machine.proxy.enabled=$TOGGLE But if we use the kebab-style in JSON it makes jq '.experimental."virtual-machine".proxy.enabled' Maybe that is acceptable. My "hard" requirement would be that users should only ever deal with one form of the option name. Which is why I'm willing to explore Eric's suggestion, even though I dislike having to use camelCase names with the CLI. Footnotes
|
Beta Was this translation helpful? Give feedback.
-
Proposal to make the
rdctl set
andrdctl start
options dealing with preference settings to use the JSON/jq syntax.It's been awkward switching between the linux --snake-case-format and the json camelCase format, and I never liked seeing dozens of options when running help.
Commands:
rd set ( GLOBAL-FLAGS | SETTINGS ) ...
rdctl start
( GLOBAL-FLAGS | SETTINGS )`SETTINGS:
This syntax is closer to the setting-syntax for
helm install
, with these differences:There's no need for helm's
--set-string
or--set-literal
.--set
is used to set a scalar value, and--set-json
is used to set a compound value.Note that
rdctl start
retains--no-modal-dialogs
and--path PATH-TO-EXECUTABLE
Migration
We can support both sets of options for version 11, with deprecation warnings when the old form is used, and drop support for the old form with version 12.
Future possibility:
If you're doing
FQDN.field=VALUE
you don't need to precede it with a--set
. But if you want to leave out the=
you need the--set
option.Beta Was this translation helpful? Give feedback.
All reactions