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

Identify incorrect subcommand after a correct one #2024

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

idorax
Copy link
Contributor

@idorax idorax commented Apr 26, 2023

Fix: #2022

@idorax
Copy link
Contributor Author

idorax commented Apr 27, 2023

Hi @lukaszachy and @happz, would you please help to review this PR? Thanks!

@idorax idorax force-pushed the dev-huanli-2022-20230426-cli branch from c89bfcb to e06d01f Compare May 10, 2023 15:10
@lukaszachy lukaszachy added this to the 1.24 milestone May 16, 2023
@happz happz added the cli label May 16, 2023
@idorax idorax force-pushed the dev-huanli-2022-20230426-cli branch from e06d01f to 66e19a7 Compare June 2, 2023 10:07
tmt/options.py Outdated Show resolved Hide resolved
tests/usability/test.sh Outdated Show resolved Hide resolved
@idorax idorax force-pushed the dev-huanli-2022-20230426-cli branch 5 times, most recently from 83912d2 to 31d9666 Compare June 6, 2023 07:22
tests/discover/options.sh Outdated Show resolved Hide resolved
@idorax idorax force-pushed the dev-huanli-2022-20230426-cli branch from b9e96e1 to f84dc50 Compare June 6, 2023 11:49
Copy link
Collaborator

@psss psss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for fixing this!

If a correct subcommand is followed by an incorrect one, the CLI should
raise a proper error. For example,
    $ tmt run --rm pl disc provin -h local
`disc` is the subcommand `discover` for short, but `provin` is not
`provision` for short, which is invalid actually. Hence, CLI should
not ignore the invalid short name of the subcommand `provision`.

Signed-off-by: Vector Li <huanli@redhat.com>
Co-authored-by: Miloš Prchlík <mprchlik@redhat.com>
@psss psss force-pushed the dev-huanli-2022-20230426-cli branch from f84dc50 to 7280d02 Compare June 6, 2023 15:07
@psss
Copy link
Collaborator

psss commented Jun 6, 2023

Rebased and squashed. The test failures which appeared in the latest run were all irrelevant.

@psss psss self-assigned this Jun 6, 2023
@psss psss merged commit 7280d02 into main Jun 6, 2023
15 checks passed
@psss psss deleted the dev-huanli-2022-20230426-cli branch June 6, 2023 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid short name 'provin' should not be ignored when running 'tmt run --rm pl disc provin -h local'
4 participants