fix: complete path arguments before later options - #248
Conversation
7fc7894 to
5df353b
Compare
|
I traced this back to #116. The generated Bash function was keeping the path completer active, but it was still passing the already-typed option token ( Commit Validation on this checkout:
The full pytest suite still cannot start on this Windows checkout because its POSIX |
casperdcl
left a comment
There was a problem hiding this comment.
this currently breaks examples/pathcomplete.py:
pathcomplete -<TAB> # doesn't list --options
pathcomplete . -<TAB> # correctly lists --options
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #248 +/- ##
=======================================
Coverage 85.13% 85.13%
=======================================
Files 3 3
Lines 471 471
Branches 92 92
=======================================
Hits 401 401
Misses 39 39
Partials 31 31 🚀 New features to boost your workflow:
|
|
I reproduced the regression in the generated Bash state machine. The path completer should still win when an option token is actually the value for a pending option argument, but after a positional path is complete the user should be able to start a new |
d35ce54 to
cd06afb
Compare
cd06afb to
65ca5cc
Compare
What changed
When Bash is completing a custom path argument and the next token already starts with
-, the generated completer now keeps the path completer active. This covers editing a command such as... -d -wand prevents the later option from being inserted as the path value.Verification
python -m compileall -q shtabgit diff --checkI could not run the full pytest suite on this Windows checkout because the repository's POSIX
ptytest helper requirestermios, and the local environment also has incompatible pytest recording plugins. Let me know what you think.