jgo icon indicating copy to clipboard operation
jgo copied to clipboard

WIP: Parse endpoints using argparse

Open jayvdb opened this issue 3 years ago • 5 comments

jayvdb avatar Jul 15 '22 04:07 jayvdb

Happy to re-add find_endpoint and mark it as deprecated somehow. Also happy to add more tests to help guarantee this is working correctly for any edge cases.

jayvdb avatar Jul 15 '22 04:07 jayvdb

This is really coincidental; I've run into this issue also the last few days, and just last night (shortly before this issue), I opened a PR to fix this as well https://github.com/scijava/jgo/pull/74

I take a different approach though, just adding a patter to match window's drive letters and ignore, similar to how it already did for http://

cmhulbert avatar Jul 15 '22 13:07 cmhulbert

@jayvdb Do you think the merge of #74 is sufficient to address your needs here? I.e. can this PR be closed? Or are there still benefits to updating and merging it?

ctrueden avatar Jul 31 '22 06:07 ctrueden

I think there are benefits in where I was going with this, but I want to first get tests in place for the current behaviour, before attempting to take this approach further. I'll get a WIP up shortly.

jayvdb avatar Jul 31 '22 08:07 jayvdb

@ctrueden, I am pretty confident that I can get this working correctly, resulting in no more attempt to parse the program_args and all the problems that can cause. OTOH, complexity goes through the roof, and we'd be using 'private' parts of the ArgumentParser class (_match_arguments_partial and _parse_optional), and making parse_args stateful (with those new members of the ArgumentParser) which is contrary to its intent.

Should I keep going?

jayvdb avatar Aug 01 '22 10:08 jayvdb