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

quarkus dev broken for command mode arguments #37921

Closed
maxandersen opened this issue Dec 23, 2023 · 14 comments · Fixed by #37961 or #38058 · May be fixed by #37968
Closed

quarkus dev broken for command mode arguments #37921

maxandersen opened this issue Dec 23, 2023 · 14 comments · Fixed by #37961 or #38058 · May be fixed by #37968
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) area/devmode kind/bug Something isn't working
Milestone

Comments

@maxandersen
Copy link
Member

Describe the bug

using quarkus dev with command mode seem to have regressed.

do this:

quarkus create app -x picocli whoops

then run:
quarkus dev this is my name

and it will print out "this is my name" and in bottom line have:

Press [space] to restart, [e] to edit command line args (currently 'this is my name'), [r] to resume testing, [o] Toggle test output, [:] for the terminal, [h] for more options>

now press 'e' to edit and notice that you are shown an empty line. Type in something else completely and press enter and you get:

Unmatched arguments from index 1: 'completely', 'different' Usage: greeting [-hV] <name> <name> Your name. -h, --help Show this help message and exit. -V, --version Print version information and exit.

but the line still shows:

Press [space] to restart, [e] to edit command line args (currently 'this is my name'), [r] to resume testing, [o] Toggle test output, [:] for the terminal, [h] for more options>

so multiple issues in the above:

  1. quarkus dev whatever i put the latter part gets passed in as one string ("whatever i put") rather than actual individual arguments. It should be an array of strings ("whatever", "i", "put") rather than one big string.
    note: quarkus dev "whatever I put" should give you one string and not an array of string.
    the edit command actually seem to do this correct. its just the passing of parameter that is wrong
  2. the line at bottom does not show the current command line arg but what was passed in originally
  3. the edit does not actually let you edit the command line. just give you blank line. Sometimes characters are not even shown when typing.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@maxandersen maxandersen added the kind/bug Something isn't working label Dec 23, 2023
@maxandersen maxandersen added area/cli Related to quarkus cli (not maven/gradle/etc.) and removed triage/needs-triage labels Dec 23, 2023
Copy link

quarkus-bot bot commented Dec 23, 2023

/cc @ebullient (cli)

@MaciejDromin
Copy link
Contributor

Hey @maxandersen I started looking into this issue, was able to fix already the second issue You pointed out. I will continue work on this in the upcoming days :)

@maxandersen
Copy link
Member Author

Awesome.

Remember it's just as fine fixing smaller subparts in multiple prs as that often makes it easier to fix and review.

@MaciejDromin
Copy link
Contributor

Remember it's just as fine fixing smaller subparts in multiple prs as that often makes it easier to fix and review.

You are right. In this case this pr is ready for review, it fixes the second pointed out issue

@MaciejDromin
Copy link
Contributor

Regarding point 3, I did some investigation and I'm afraid it's impossible to provide a string to be edited from the command line.
What I suggest as an alternative is to print some prompt at the beginning: Current args: arg1 arg2 >
What do You think?

@maxandersen
Copy link
Member Author

Remember it's just as fine fixing smaller subparts in multiple prs as that often makes it easier to fix and review.

You are right. In this case this pr is ready for review, it fixes the second pointed out issue

Which pr is it? Got a link?

@maxandersen
Copy link
Member Author

Regarding point 3, I did some investigation and I'm afraid it's impossible to provide a string to be edited from the command line.

What I suggest as an alternative is to print some prompt at the beginning: Current args: arg1 arg2 >

What do You think?

Makes sense.

@MaciejDromin
Copy link
Contributor

Which pr is it? Got a link?

Yes, there you go Fix quarkus dev broken...

@MaciejDromin
Copy link
Contributor

Makes sense.

Here is new PR which fixes this issue from point 3. Display current args...

@MaciejDromin
Copy link
Contributor

@maxandersen Here is PR which fixes point 1 Fix command line args...
Please have a look at all those 3 PR in free time, merging all those should fix all the issues you mentioned :)

@maxandersen
Copy link
Member Author

Awesome. I'm back working on Monday so hope to get to this as soon as possible.

@MaciejDromin
Copy link
Contributor

Awesome. I'm back working on Monday so hope to get to this as soon as possible.

Alright thanks. I'm looking forward for the feedback

@maxandersen
Copy link
Member Author

sorry for the delay! first off - awesome contributions @MaciejDromin - these greatly improve the devmode experience with cli based commands.

#37961 - spot on! LGTM.
#37968 - better, but still having weird behavior. Please check if you see it too.
#38058 - spot on! LGTM (special case we can look at improving in future)

@MaciejDromin
Copy link
Contributor

Thanks for the feedback @maxandersen!
if #37961 and #38058 look good I think they can be merged :) Regarding the special case maybe it would be good to create a new Issue for improvement?
#37968 - I will try to look into this hopefully tomorrow

gsmet added a commit that referenced this issue Jan 23, 2024
Fix command line arguments being squashed
@quarkus-bot quarkus-bot bot added this to the 3.9 - main milestone Jan 23, 2024
gsmet added a commit that referenced this issue Jan 23, 2024
Fix quarkus dev broken for command mode arguments
@gsmet gsmet modified the milestones: 3.9 - main, 3.7.0 Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) area/devmode kind/bug Something isn't working
Projects
None yet
3 participants