These are chat archives for kbknapp/clap-rs

8th
Mar 2017
Gautier P
@bagage
Mar 08 2017 16:22
Hello - is there any way to force an argument to take a filepath as value? (and more generally speaking to force it to be of a fixed type (path, integer, …))
Kevin K.
@kbknapp
Mar 08 2017 16:29
You can use Arg:: validator or Arg::validator_os if you need to support invalid UTF-8 (which is legal for file paths on on *nix
I'm on mobile right now, but if you search for validator in the docs it'll pop up with examples
Gautier P
@bagage
Mar 08 2017 16:31
yeah thanks for the hint - I was looking for something more available at autocompletion time though (for Zsh it would be written as-f[description]:filepath:_files)
Kevin K.
@kbknapp
Mar 08 2017 16:32
Ah that's in active development and I'm hoping to have something in a few days for file paths on ZSH specifically
Gautier P
@bagage
Mar 08 2017 16:32
ah? cool! Is there an open issue on that I can track?
Kevin K.
@kbknapp
Mar 08 2017 16:33
There is, I can't get the link right now, but if you look for issues tagged "completion gen" you'll see it ;)
Gautier P
@bagage
Mar 08 2017 16:33
thanks a lot then :)
Kevin K.
@kbknapp
Mar 08 2017 16:34
I had a working branch locally but some other issues have taken priority lately and I've been traveling a ton for work...But should have some time now finally
No prob!
Gautier P
@bagage
Mar 08 2017 16:34
I believe it's kbknapp/clap-rs#568 but couldn't find it earlier with my own keywords
Anyway it's great news - clap is a great piece of software for a laborious work
Kevin K.
@kbknapp
Mar 08 2017 16:35
That is one of them, there is more recent on in the 800s asking for files specifically
It's titled akout ZSH in ripgrep
Gautier P
@bagage
Mar 08 2017 16:35
kbknapp/clap-rs#868 yeah ok, thanks