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

No need for -- when using withDebug command #5737

Closed
wants to merge 1 commit into from

Conversation

JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented Feb 22, 2023

Pull Request Description

I am tired of always adding -- when using withDebug command. With this change one can simply prefix:

sbt> withDebug --debugger testOnly *SomeTest

rather than having to add -- after testOnly:

sbt> withDebug --debugger testOnly -- *SomeTest

Important Notes

Both (the new as well as the old) variants remain possible however.

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • All code conforms to the
    Scala,
    style guides.
  • All code has been tested:
    • Unit tests have been written where possible.

@JaroslavTulach JaroslavTulach added the CI: No changelog needed Do not require a changelog entry for this PR. label Feb 22, 2023
@JaroslavTulach JaroslavTulach requested a review from 4e6 as a code owner February 22, 2023 12:32
@JaroslavTulach JaroslavTulach self-assigned this Feb 22, 2023
Copy link
Member

@Akirathan Akirathan left a comment

Choose a reason for hiding this comment

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

Nice. I am looking forward to the moment once we get rid even of the annoying additional -- in, e.g., withDebug --debugger testOnly -- *EnsoCompilerTest -- -z org.enso.compiler.EnsoCompilerTest.testBench

@hubertp
Copy link
Collaborator

hubertp commented Feb 24, 2023

But -- is generic and with your change we hardcode the debug options so 🤷

@JaroslavTulach
Copy link
Member Author

But -- is generic and with your change we hardcode the debug options so shrug

What do you mean by "hardcode"? My idea was to process all options until first that is not known to withDebug. Obviously the set of options that withDebug recognizes is fixed - but it was fixed/hardcoded all the time!

What do you mean be "generic"? Yes, -- is a POSIX way of saying: stop processing following CLI arguments as options. I am just claiming that it is not needed in this case. If withDebug arguments precede the other ones, we can easily recognize them and consume just them. -- seems unnecessary.

@hubertp
Copy link
Collaborator

hubertp commented Feb 28, 2023

But -- is generic and with your change we hardcode the debug options so shrug

What do you mean by "hardcode"? My idea was to process all options until first that is not known to withDebug. Obviously the set of options that withDebug recognizes is fixed - but it was fixed/hardcoded all the time!

I don't think we had something similar to isDebugFlag before. So if someone adds a debug option but forgets to add it to that match, this approach won't work.

I'm not convinced about this solution but at the same time I don't have any other proposal. It also doesn't bother me enough to reject it, so I will give a weak 👍

@Akirathan
Copy link
Member

@JaroslavTulach I have just discovered that with sbt, you can create, e.g., $HOME/.sbtrc and put some aliases there, like:

alias dbg=withDebug --debugger testOnly --

And then, you can just start debugging with, e.g., dbg *EnsoCompilerTest. No double dashes anywhere.

@JaroslavTulach JaroslavTulach added the s-wontfix Status: will not be fixed / not a bug label Mar 1, 2023
@farmaazon farmaazon deleted the wip/jtulach/AvoidUselessDashDash branch May 9, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. s-wontfix Status: will not be fixed / not a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants