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

[BUG] "konveyor-analyzer-dep --help" keeps running instead of showing help and stopping #439

Closed
1 task done
jmle opened this issue Nov 23, 2023 · 8 comments · Fixed by #468
Closed
1 task done
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.

Comments

@jmle
Copy link
Contributor

jmle commented Nov 23, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Konveyor version

0.3.0-beta2

Priority

Minor

Current Behavior

When running konveyor-analyzer-dep --help, the command shows the help and keeps running instead of exiting.

Expected Behavior

The command should show the help and exit.

How Reproducible

Always (Default)

Steps To Reproduce

  1. Run [docker|podman] run -ti --entrypoint /bin/bash <latest analyzer-lsp image>
  2. Run konveyor-analyzer-help within the container.

Environment

- Fedora 38
- Latest analyzer-lsp image

Anything else?

No response

@jmle jmle added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 23, 2023
@jmle jmle added this to Planning Nov 23, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in Planning Nov 23, 2023
@shawn-hurley shawn-hurley added the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Jan 3, 2024
@pranavgaikwad pranavgaikwad moved this from 🆕 New to 📋 Backlog in Planning Jan 8, 2024
@pranavgaikwad pranavgaikwad removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 8, 2024
@Vickysomtee
Copy link
Contributor

@shawn-hurley can this be assigned to me? I want to work on it

@shawn-hurley
Copy link
Contributor

@Vickysomtee all yours!

@Vickysomtee
Copy link
Contributor

@jmle the command you provided in the second step to reproduce returns

bash: konveyor-analyzer-help: command not found

I decided to try konveyor-analyzer-dep --help This is the output below and it exited

Screenshot from 2024-01-15 14-18-01

@jmle
Copy link
Contributor Author

jmle commented Jan 15, 2024

Hey @Vickysomtee, thank you for taking a look. The log messages that appear after the "Flags" section indicate that the bin is actually running a dependency analysis, and that shouldn't happen. That is what should be fixed.

@shawn-hurley
Copy link
Contributor

@Vickysomtee, that is correct on the command konveyor-analyzer-dep --help, you are on the right track.

I think that you want to look at a line like this: if err := rootCmd.Execute(); err != nil {

I think that if there is an error, we need to stop executing.

We also need to handle the case when help is specifcally called like:} else if rootCmd.Flags().Changed("help") {

Let me know if that helps?

@Vickysomtee
Copy link
Contributor

@shawn-hurley Thanks for the pointers, I have a better understanding.

One quick question about this.

We also need to handle the case when help is specifcally called like:} else if rootCmd.Flags().Changed("help") {

What should happen when help is specifically called

@shawn-hurley
Copy link
Contributor

Print the help text, and then exit would be what would be best

@Vickysomtee
Copy link
Contributor

Print the help text, and then exit would be what would be best

@shawn-hurley I am not sure I understood what you meant by Print the help text but I created a draft PR so you can review

pranavgaikwad pushed a commit that referenced this issue Mar 4, 2024
Fixes #439

---------

Signed-off-by: vickysomtee <vickysomtee@gmail.com>
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Planning Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

4 participants