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

Option parsing of docker ps command is incorrect with concatenated option flags #3

Closed
krishnakumarg1984 opened this issue May 18, 2023 · 1 comment

Comments

@krishnakumarg1984
Copy link

If we pass more option flags to the docker ps command in the concatenated short-form style, e.g. docker ps -aq where the -q flag is concatenated with the -a flag to result in the combined -aq flag, we do not get the correct output from dops.

As an example, if we have the following situation

$ docker ps -a
CONTAINER ID   IMAGE     COMMAND                  CREATED         STATUS                     PORTS     NAMES
030aa141e0bc   nginx     "/docker-entrypoint.…"   4 minutes ago   Exited (0) 3 minutes ago             website

dops -a works absolutely fine.

$ dops -a
CONTAINER ID    NAME       IMAGE    TAG    CREATED AT (+01:00 BST)    STATE       STATUS                      PUBLISHED PORTS
------------    -------    -----    ---    -----------------------    --------    ------------------------    ---------------
030aa141e0bc    website    nginx           2023-05-18 16:00:36        [EXITED]    Exited (0) 4 minutes ago

while, the -aq combined flag does not produce the correct output. With docker ps -aq, we get the container ID as expected i.e. 030aa141e0bc.

However, dops -aq produces an empty output. The long form, dops -a -q does work correctly though. The bash/zsh/fish alias functions are also correspondingly broken.

@Mikescher
Copy link
Owner

Yeah, I guess the commandline parser currently does not pick up the short syntax - I'll try to look into it next week

Mikescher added a commit that referenced this issue May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants