Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 01 2020 13:10
    pksunkara commented #1711
  • Mar 01 2020 13:09
    pickfire commented #1711
  • Mar 01 2020 13:07
    pickfire commented #1710
  • Mar 01 2020 12:14
    bors[bot] commented #1710
  • Mar 01 2020 12:14
    CreepySkeleton commented #1710
  • Mar 01 2020 12:09
    CreepySkeleton commented #1710
  • Mar 01 2020 12:09
    CreepySkeleton commented #1710
  • Mar 01 2020 12:08
    pksunkara review_requested #1710
  • Mar 01 2020 11:49
    pickfire commented #1710
  • Mar 01 2020 11:47
    pksunkara commented #1711
  • Mar 01 2020 11:44
    pickfire opened #1711
  • Mar 01 2020 11:44
    pickfire labeled #1711
  • Mar 01 2020 11:36
    pickfire synchronize #1710
  • Mar 01 2020 09:10
    pickfire commented #1710
  • Mar 01 2020 09:09
    pickfire opened #1710
  • Mar 01 2020 08:30
    pksunkara commented #1655
  • Mar 01 2020 08:29
    pickfire commented #1655
  • Feb 29 2020 16:49
    bors[bot] closed #1709
  • Feb 29 2020 16:49
    bors[bot] commented #1709
  • Feb 29 2020 16:07
    pksunkara commented #1709
Jonas Natten
@jnatten
Hey there, I'm trying to make a cli where the user can tag stuff with mrt -t test and then later reference the tag with mrt +test other_command. Is there a way to have a different prefix than - in clap? (Python does it like this: https://docs.python.org/3/library/argparse.html#prefix-chars)
Matthew Pocock
@drdozer
Oh sorry! Wrong room
Stephen Chavez
@redragonx
error: failed to select a version for the requirement clap = "^3.0.0-beta.1"
candidate versions found which didn't match: 2.33.0, 2.32.0, 2.31.2,
Hi all, when I try to setup clap, i get that error
used the readme as a guide.
Denis Lisov
@tanriol
The readme is for the 3.0 branch which has not been released yet. clap = "2.33" should work for the latest currently released version.
Stephen Chavez
@redragonx
Any fixes?
ok
ty
oh its you @tanriol
The rust community must be close :)
Any reason not to use 3.0 branch locally?
Denis Lisov
@tanriol
I do monitor the communication channels of the libraries I'm interested in... usually works as "come in to ask a question and never leave if the channel is quiet enough" :-)
Depends on your use case, probably. My personal rule of thumb is to use released versions only unless there's some specific reason to require a newer one.
Stephen Chavez
@redragonx
i dont plan on using the structopt feature yet.
so 2.33 it is
Mehdi Sadeghi
@mehdisadeghi
Good morning. Does someone know whether we can order subcommands? e.g. help comes first, then the rest of subcommands. Sorry for not reading the code! I'm just learning Rust and it is too much to dig into the library code.
Mehdi Sadeghi
@mehdisadeghi
Nevermind, found it! (display_order: 1000), (display_order: 1001), etc.
Howerver I have another question. How can I add default value and env option to an arguement with the clap_app! macro? e.g. (@arg BUS: "socketcan interface")
Mehdi Sadeghi
@mehdisadeghi
Found that one too! (@arg BUS: default_value[vcan0] "socketcan interface")
This channel is pure magic. You just ask the questsions. The answers appear in your mind. Have a good day!
Git User
@gitb2_gitlab
is there a way to capture all args in clap without "--" param. So I'd like to have ./myprog -a something anotherparam -e -a --anything ==>
param1: -a (something)
param2: anotherparam
param3: -e -a --anything
I've tried in yaml with "allow_hyphen_values: true and "multiple: true" but it does not work
complains that -e is not valid parameter
Denis Lisov
@tanriol
Have you tried AppSettings::TrailingVarArg?
Git User
@gitb2_gitlab
@tanriol thanks, seems to work
programmatically, gotta find a way to impl it in yaml
let m = App::from(yml).setting(clap::AppSettings::TrailingVarArg).get_matches();
and yml: "cmd" with "multiple: true" seemed to do the trick
prographo
@prographo

I really hate rust, hope someone can help me, so I can get back to programming in a language I like...

            Arg::with_name("tflag")
                .short("tf")
                .long("tflag")
                .help("Turbo on if this flag is specified"),

When I run...

error: The argument 'tflag' wasn't found

How do I make a an argument optional?

even when I specify it doesn't take a value .. same result.
                .takes_value(false)
               .required(false)
Still demands the argument.
h.e.l.p
Denis Lisov
@tanriol

@prographo

I really hate rust

I'm pretty sure that this is not the most efficient way of asking for help :-)

Anyway, your error looks like it is optional, but your code is not ready for it being absent (using macros that assume it's always present?).

stedingan
@stedingan
Hello what am i doing wrong if i want to have an argument -e and also an argument -ext or is this not possible?
Denis Lisov
@tanriol
@stedingan By default, -ext as an argument is considered the same as -e -x -t
Long arguments are normally introduced with -- like --my-ext-argument
stedingan
@stedingan
@tanriol so if i do https://paste.xinu.at/W3A/ i generate three shorts?
Arash
@areux

is there a way to have multi-word options in clap_app!?
for example in this code

(@arg dbus_start_jack: --start-jack "Start jack via dbus interface")

clap converts --start-jack to --start.

Denis Lisov
@tanriol
@areux Definitely possible if constructed in code; not sure about macros.
See docs, your question is mentioned there. TL;DR: --("start-jack")
CreepySkeleton
@CreepySkeleton
Hey people! From now on, I'm going to be monitoring this channel and answering your pleads for help / complaints. The goal is to build a sort of sub-community that is able answering simple questions, thus taking some load off the maintainers. Only feature requests / bug reports / really complicated questions should be directed to the issue tracker.
Denis Lisov
@tanriol
@CreepySkeleton Hello and nice to see someone else ready to help people :-)
CreepySkeleton
@CreepySkeleton
Any idea how to increase the amount of someoneelses?
Denis Lisov
@tanriol
Not much. On the other hand, at the moment the amount of questions here is also rather low - maybe one in a week or even a few.
CreepySkeleton
@CreepySkeleton
Let me tell you a secret - the amount of question directed to the issue tracker is... not huge, but close to uncomfortable for some maintainers.
Diana
@DianaNites
Is there any way to do what I want TeXitoi/structopt#365? Some sort of default_occurrences_if, or a way to get default_value_if working for it?
amesgen
@amesgen
Are there plans for clap::App: Send? I think it would suffice to replace Rc by Arc here. I would be open to implementing this (behind a feature flag).
Denis Lisov
@tanriol
@amesgen What's your use case for it? Sounds to me like argument parsing usually happens well before starting additional threads, no?
amesgen
@amesgen
@tanriol Usually it does, but I use clap/structopt for parsing input commands of a chat bot. This usage seems to be intended if I interpret the comments on this correctly.
CreepySkeleton
@CreepySkeleton
@DianaNites Not that I would know about. Not with structopt at least