These are chat archives for kbknapp/clap-rs

18th
Mar 2018
Luke Frisken
@kellpossible
Mar 18 2018 06:18
@kbknapp @tanriol hi guys thanks I've created a new issue #1210 for this issue
Ishan Jain
@ishanjain28
Mar 18 2018 10:35
Hi, I am working on Alacritty's Source code. Alacritty uses clap.rs and I am having a really weird problem. I'd very thankful if some can help me.
William Murphy
@willmurphyscode
Mar 18 2018 12:25
@kbknapp Here's a work in progress PR for addressing kbknapp/clap-rs#805 -- kbknapp/clap-rs#1211
Would you mind letting me know whether this is on the right track before I do formatting clean up work and the like? I'm pretty happy with it, but I wanted to double check
@ishanjain28 I think you need matches.values_of("position") rather than matches.value_of("position") (note the plural in the function name)
Ishan Jain
@ishanjain28
Mar 18 2018 12:35
@willmurphyscode Oh damm, I totally didn't paid enough attention to that. Thanks for the help.
Kevin K.
@kbknapp
Mar 18 2018 18:30
@willmurphyscode awesome! I'll check the pr later today when I get to a computer or early tomorrow, just got back in town after a week :)
Jeroen Bollen
@Binero
Mar 18 2018 21:25
Is there a way to have a subcommand be represented with a - option?
I am writing an AUR helper for Arch. It's convention that subcommands are represented as --options.
e.g.
pacman --sync -yu
pacman -Syu
In this scenario, --sync would be the subcommand.
Kevin K.
@kbknapp
Mar 18 2018 21:27
Im not sure I understand the question, that should be possible already
Jeroen Bollen
@Binero
Mar 18 2018 21:27
Then how do I set the .short() and the .long() on a subcommand?
Kevin K.
@kbknapp
Mar 18 2018 21:27
Or are you saying --sync had it's own options and flags separate from Pacman?
Ah ok I think I understand now
Jeroen Bollen
@Binero
Mar 18 2018 21:28
Yes, for example there is also --query, which takes other options than --sync
Kevin K.
@kbknapp
Mar 18 2018 21:30
Currently that isn't possible
Without doing it manually
I'd be open to an issue for it though
I.e. args that enable/disable other args
Jeroen Bollen
@Binero
Mar 18 2018 21:32
i think that would not be sufficient
Because the meaning of the arguments with the same short changes depending on the 'main' arg
Kevin K.
@kbknapp
Mar 18 2018 21:35
Ah ok
Short of just doing a 1:1 pacman clone I'd be of the opinion that using regular subcommands is almost always a better option
Jeroen Bollen
@Binero
Mar 18 2018 21:37
meh, I feel like it's not worth polluting this crate even further with these specific use cases
I'll just use subcommands and people who don't like it can eat it
Kevin K.
@kbknapp
Mar 18 2018 21:38
Haha :P