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

Question: get order of parameters (not arguments) #1427

Closed
benboeck opened this issue Nov 17, 2019 · 1 comment
Closed

Question: get order of parameters (not arguments) #1427

benboeck opened this issue Nov 17, 2019 · 1 comment

Comments

@benboeck
Copy link

benboeck commented Nov 17, 2019

An application modifies text files by applying a chain of functions to each line. The order of the parameters (not arguments) matters.

filterapp input.txt -a +b -c -d...

How is it possible to get the order of the supplied parameters (-a, +b, -c, -d) as supplied on the command line?

I tried click.get_current_context().params but the dictionary is not an OrderedDict so the positions change each run (older Python3 where standard dictionaries are still unordered).

Thank you
kind regards

Ben

@davidism
Copy link
Member

Click intentionally does not support the ordered option style shown here. There are existing discussions on this such as #567.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants