Why does subcommand returns (&str, Option<&ArgMatches<'a>>) and not Option<(&str, &ArgMatches<'a>)> ? #2047
-
I noticed that Is there a reason for this ? For example is it possible to have |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Doesn't seem so. This is a good question. I'd say historical reasons are operative here: this was apparently the way it had been done initially, and nobody seemed to care enough to raise the question afterwards. Okay, I agree that having both Addressed in #2048 |
Beta Was this translation helpful? Give feedback.
Doesn't seem so.
This is a good question. I'd say historical reasons are operative here: this was apparently the way it had been done initially, and nobody seemed to care enough to raise the question afterwards.
Okay, I agree that having both
name
andmatches
wrapped inOption
would be better. Additionally, we wouldn't needArgMatches
to be wrapped in its ownOption
; I never saw anybody using it in a way that wasn't a logical equivalent to "unwrap or ignore".Addressed in #2048