You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Podman Desktop's issue containers/podman-desktop#5989 proposes to add a free-form field for the user to add any podman create option when creating a container.
To help the validation of the field, and/or to propose a typeahead helping the user discover existing options, it would be nice that Podman Desktop is able to get the list of options, in a formatted way.
Suggest potential solution
Add an option --json or similar option, to get the output of podman <cmd> --help in a JSON format.
For example:
$ podman create --help --json
{
"short-description": "Create but do not start a container",
"description": "Creates a new container from the given image or storage and prepares it for running the specified command\n\nThe container ID is then printed to stdout. You can then start it at any time with the podman start <container_id> command. The container will be created with the initial state 'created'.",
"usage": "podman create [options] IMAGE [COMMAND [ARG...]]",
"examples": [
"podman create alpine ls",
"podman create --annotation HELLO=WORLD alpine ls",
"podman create -t -i --name myctr alpine ls"
],
"options": [
{
"long": "--add-host",
"type": "strings",
"description": "Add a custom host-to-IP mapping (host:ip) (default [])",
},
{
"short": "-a",
"long": "--attach",
"type": "strings",
"description": "Attach to STDIN, STDOUT or STDERR"
},
[...]
]
}
Have you considered any alternatives?
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered:
--help is parsed and processed directly by the cobra lib so there is really no way to also parse --json in such a case AFAIK. This means we would need to parse the args ourselves which is not very nice.
While it should be possible to generate json of this it is not exactly great either, the cli help is not really consitent. The type field is not defined in any way and can be basically anything so while you could validate some common known types I don't think in general type as field makes a lot of sense.
But most importantly I really do not understand what you would gain from this at all. Sure you could show the field in your gui but it would not map the the actual API request, API != cli. The API doesn't accept --device foo instead you need to send this in the proper json format. The same for any option really so I do not see how this would get you any closer to accepting any option unless you shell out to podman-remote which AFAIK podman-desktop doesn't do for the podman API requests.
Feature request description
Podman Desktop's issue containers/podman-desktop#5989 proposes to add a free-form field for the user to add any
podman create
option when creating a container.To help the validation of the field, and/or to propose a typeahead helping the user discover existing options, it would be nice that Podman Desktop is able to get the list of options, in a formatted way.
Suggest potential solution
Add an option
--json
or similar option, to get the output ofpodman <cmd> --help
in a JSON format.For example:
Have you considered any alternatives?
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: