Replies: 1 comment 1 reply
-
structopt was a wrapper for clap v2. In case you weren't aware, we have a structopt to clap v3 migration guide. You can then use the clap v3 to v4 migration guide. This would likely help in identifying changes in parsing behavior and possible workarounds, if any. For example, this line item from the v3 -> v4 subtle breaking change list is likely what you saw
What is it you'd like to get out of accepting a function? |
Beta Was this translation helpful? Give feedback.
-
I'm currently in the process of porting choose (https://github.com/theryangeary/choose) from
structopt
toclap
, but I've noticed an issue where structopt'sallow_hyphen_values
doesn't seem to match the behavior of clap (?). It seems thatstructopt
stops when it encounters other flags, clap doesn't, and indeed clap's behavior is more correct.Like:
Looking at the docs, I found that
value_terminator
is a function that stopshyphen_values
from going on, but it's very limited in its use case (it can only accept strings), and it would be nice if it could accept a function that returns a boolstructopt -> clap branch: https://github.com/AOSC-Tracking/choose/tree/aosc/switch-to-clap
Like (Probably not a very clear thinking idea):
Beta Was this translation helpful? Give feedback.
All reactions