handlr-regex: handlr 0.12.0 completion scripts is faulty
Current Behavior
The generated completer is faulty. For open and mime subcommands it only complete options and will not complete paths, and completes nothing if the current word doesn’t match the options. For launch and get it only complete extensions, not options, and continues to do so after typing 2 dashes.
The new created script also seems to hard code the path to handlr by prepending cwd to argv[0] unless argv[0] is not a path. If the completion script is generated before installation the path would be invalid and suppress the original completer. Might be better to document it in the README.
Expected Behavior
It should generate completion for both options and paths/extensions. If a dash or 2 dashes are at the front of the completing word then it should complete options, and if ./ is at the front of the current word it should complete only paths.
Distribution and Version
handlr version : 0.12.0 Distribution : Artix Linux using Arch Linux extra repository
I do not see any commit to the code after the tag release so I did not compile it myself.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 17 (10 by maintainers)
@The-Ludwig Sorry about that. I have made a new patch release.
I am guessing that
ValueHintandArgValueCompleterhave separate implementations, since the former is used for “static” completions and the latter is used for “dynamic” completions. So fixing a bug in one would not necessarily fix the other.Or maybe the dynamic completions are unstable enough there are still significant holes in test coverage.
In any case, I might have to issue a bug report.
I think those might be more issues with
clap_complete, especially since it appears to still be kind of a work in progress a work in progress.That might be possible. To my understanding, users tend to mainly use
handlr-regexfor scripts and keybinds and mainly only directly use it in a command line for editing or viewingmimeapps.list.Regardless, I am glad someone noticed it and reported it so that others with your use case no longer have to deal with it.