Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to alias arguments #669

Closed
andreastt opened this issue Sep 23, 2016 · 1 comment
Closed

Ability to alias arguments #669

andreastt opened this issue Sep 23, 2016 · 1 comment

Comments

@andreastt
Copy link

It is possible to provide (hidden) aliases for subcommands currently, but not for regular arguments. When you have a program that needs to rename an argument it would be useful to have the ability to provide hidden aliases for it.

@afiune
Copy link
Contributor

afiune commented Sep 29, 2016

I wonder if someone is doing this work already.. 🤔 cc/ @kbknapp
Otherwise I would love to start looking at it and contribute at some point 😺

afiune pushed a commit to afiune/clap-rs that referenced this issue Sep 30, 2016
There are some cases where you need to have an argument to have an
alias, an example could be when you depricate one option in favor of
another one.

Now you are going to be able to alias arguments as follows:
```
Arg::with_name("opt")
    .long("opt")
    .short("o")
    .takes_value(true)
    .alias("invisible")
    .visible_alias("visible")
```

Closes clap-rs#669
afiune pushed a commit to afiune/clap-rs that referenced this issue Oct 4, 2016
There are some cases where you need to have an argument to have an
alias, an example could be when you depricate one option in favor of
another one.

Now you are going to be able to alias arguments as follows:
```
Arg::with_name("opt")
    .long("opt")
    .short("o")
    .takes_value(true)
    .alias("invisible")
    .visible_alias("visible")
```

Closes clap-rs#669
homu added a commit that referenced this issue Oct 4, 2016
feat(arg_aliases): Ability to alias arguments

There are some cases where you need to have an argument to have an
alias, an example could be when you deprecate one option in favor of
another one.

Now you are going to be able to alias arguments as follows:
```rust
Arg::with_name("opt")
    .long("opt")
    .short("o")
    .takes_value(true)
    .alias("invisible")
    .visible_alias("visible")
```

Closes #669

Also you can alias flags as follow:
```rust
Arg::with_name("flg")
    .long("flag")
    .short("f")
    .alias("not_visible_flag")
    .visible_alias("awesome_v_flag")
```
homu added a commit that referenced this issue Oct 4, 2016
feat(arg_aliases): Ability to alias arguments

There are some cases where you need to have an argument to have an
alias, an example could be when you deprecate one option in favor of
another one.

Now you are going to be able to alias arguments as follows:
```rust
Arg::with_name("opt")
    .long("opt")
    .short("o")
    .takes_value(true)
    .alias("invisible")
    .visible_alias("visible")
```

Closes #669

Also you can alias flags as follow:
```rust
Arg::with_name("flg")
    .long("flag")
    .short("f")
    .alias("not_visible_flag")
    .visible_alias("awesome_v_flag")
```
@homu homu closed this as completed in #674 Oct 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants