Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using -h short flag for —hostname gives podlet’s help instead of generating the correct quadlet #105

Open
xrisk opened this issue Sep 14, 2024 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@xrisk
Copy link

xrisk commented Sep 14, 2024

$ podlet podman run -h foo.local hello-world
Generate a Podman Quadlet `.container` file

Usage: podlet podman run [OPTIONS] <IMAGE> [COMMAND]...

Arguments:
  <IMAGE>       The image to run in the container
  [COMMAND]...  Optionally, the command to run in the container

Options:
      --cap-add <CAPABILITY>                                         Add Linux capabilities
      --device <HOST-DEVICE[:CONTAINER-DEVICE][:PERMISSIONS]>        Add a device node from the host into the container
      --annotation <KEY=VALUE>                                       Add an annotation to the container
      --name <NAME>                                                  The (optional) name of the container
      --dns <IP_ADDRESS>                                             Set custom DNS servers
      --dns-option <OPTION>                                          Set custom DNS options
      --dns-search <DOMAIN>
…

Using the —hostname full form makes this work as expected:

podlet podman run --hostname foo.local hello-world
# hello-world.container
[Container]
HostName=foo.local
Image=hello-world
@xrisk xrisk changed the title Using -h short flag for —hostname gives podlet’s help instead of generating the correct quad let Using -h short flag for —hostname gives podlet’s help instead of generating the correct quadlet Sep 14, 2024
@k9withabone
Copy link
Member

I'm not sure what the correct solution for this problem is. I think Docker/Podman made a mistake not reserving -h for help. One possibility is to use Command::disable_help_flag() for podlet podman run and add --help back manually, but then how would one get the short help?

@k9withabone k9withabone added bug Something isn't working help wanted Extra attention is needed labels Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants