Skip to content

Conversation

@jhscheer
Copy link
Contributor

make clap support -R in addition to -r

.long(OPT_RECURSIVE)
.help("remove directories and their contents recursively")
)
.arg(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could use the --alias option ?
https://docs.rs/clap/2.33.3/clap/struct.Arg.html#method.alias

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also thought clap's visible_alias function could be use for this. However, I as far as I can tell it is not possible to mimic GNU's behaviour with alias. The problem is that alias is only for the long flag, i.e. with .visible_alias("R") the user would have to type --R.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, TIL :)

Could you please add a comment to make it explicit in the code? thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@sylvestre sylvestre merged commit 6a109a5 into uutils:master Mar 17, 2021
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

Successfully merging this pull request may close these issues.

2 participants