-
Notifications
You must be signed in to change notification settings - Fork 152
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
Retain/keep help arguments sorting? #421
Comments
(I tried to think of a MergeRequest, but I can't find any obvious places like a use of HashMap / HashSet. Not sure what's the source of reordering.) |
Define "argument-sorting"? I don't understand the question; some examples might help. |
I mean in the I get an output like this: https://gitlab.memri.io/memri/pod/snippets/1 As you see, even though "port" is defined first in the source code ( Would it be possible or a better idea to preserve ordering? |
( The problem persists if |
|
@TeXitoi oh nice, thanks a lot! It works! Is there a reason to not "enable" it by default? |
That's clap default. But I personally prefer this default, as it makes search in the help message easier. |
So many men, so many minds. Some prefer alphabetical sorting, some like "as declared" sorting. It's just happened that the former is default, the latter is opt-in, and I also think alphabetical is more common. |
@CreepySkeleton that is not alphabetical sort in the first example sort though, is it? https://gitlab.memri.io/memri/pod/snippets/1 |
That's... weird. I swear I saw the "alphabetical order" in clap docs, lemme check... nope, I'm not delusional
Well, I guess you're going to have to live with it until clap 3.0 is out, sorry. |
Is it a bug in clap then? I'm a bit lost. It would seem that the latest version of structopt already uses clap 2.33.0, but options are not listed alphabetically in |
Yes, this is a bug in clap 2.33. Unfortunately, it's unlikely to ever be fixed because all time we have we put into 3.0; clap 2.x is essentially frozen. You don't seem to be affected by the bug because you use I'll make sure this is fixed in 3.0. |
Thanks, understood, all clear now! |
Hi, thanks for the awesome project!
Is it possible to keep arguments sorting the same as written in the underlying
struct
? I think there are cases when you want to write arguments in a certain order, and I think it'd be nice to retain this order.The text was updated successfully, but these errors were encountered: