kong icon indicating copy to clipboard operation
kong copied to clipboard

existingdir with default is tested even on --help

Open cxtuttle opened this issue 4 years ago • 11 comments

All existingdir with default values are tested even on commands not run or with --help

Example run:

./test --help test: error: --dest: stat /foo: no such file or directory

cxtuttle avatar Jul 30 '21 18:07 cxtuttle

Got hit by the same issue.

mitar avatar Dec 01 '21 18:12 mitar

Related: #26

mitar avatar Dec 01 '21 18:12 mitar

Actually this is slightly different - help should work no matter what :(

alecthomas avatar Dec 01 '21 19:12 alecthomas

Yes, they are not exactly the same.

mitar avatar Dec 01 '21 23:12 mitar

Opened https://github.com/alecthomas/kong/pull/298 as a draft to potentially resolve this issue. Please let me know if there's any unintended consequences of addressing it this way.

pyqlsa avatar May 01 '22 23:05 pyqlsa

This also happens without default value. If you configure it as optional, is tested anyways

MrMarble avatar May 03 '22 08:05 MrMarble

cc @alecthomas should https://github.com/alecthomas/kong/pull/298 have closed this?

pyqlsa avatar May 16 '22 22:05 pyqlsa

Yes I think so. If someone can test, let's close it!

alecthomas avatar May 16 '22 22:05 alecthomas

Yes I think so. If someone can test, let's close it!

I introduced this test to hopefully capture this, and the fix "works for me".

cc @mitar @cxtuttle could either of you confirm that this appears to work for you as well?

pyqlsa avatar May 16 '22 22:05 pyqlsa

I'm seeing a similar behavior with a kong.VersionFlag not working if the default value for an existingfile does not exist.

douglaswth avatar Jul 27 '22 05:07 douglaswth

I'm seeing a similar behavior with a kong.VersionFlag not working if the default value for an existingfile does not exist.

Thanks @douglaswth, I think https://github.com/alecthomas/kong/pull/321 should address that.

pyqlsa avatar Jul 28 '22 01:07 pyqlsa