feat: -m supports pattern matching - #2364
Conversation
thanks - wdyt about wether we should do the asking by default or we should require pattern to be there? i.e. should Actually, having -m * being needed is probably not good as * gets expanded. I guess |
|
note, |
5f69f91 to
116efc9
Compare
116efc9 to
22a3db1
Compare
|
I've updated this to only support glob patterns (?*) not full regex as its not really needed and characters like $ and others are actual valid java identifiers. Now it will default ask if no main specificed and will filter the list with the pattern - but for now I plan not running even if only single match as user have not explicitly chosen which main method to run. |
this is a draft of a idea that came to me bumping into projects with multiple mains.
i added printing of multiple mains in last release so user can copy/paste the name - this one uses that same code to let user get to interactively choose which main...but I didn't like it to happen automatically so came up with
-m <pattern>|classname.Basically if
-mis not just a classname we treat it as "ask me".this pr for now just implement
-m ?so you get:could imagine we treat it as a regular expression and you could do:
and
wdyt? too much or just enough to be useful (the code is trivial so feels like worth it to me)
should we do the asking by default or should we require it to be explicilty asked?
note that it uses our standard query mechanism so it will never block - at most delay 30 seconds.