Parsed args (argv/opts) always to be the 1st param of action
See original GitHub issueHeya. Currently you always get the argv (what’s called “opts” everywhere in readme - i don’t like that) from mri
as last parameter of the action function. It’s pretty much not comfortable in anyway.
It not make sense to be last. It is the only guaranteed param that can exist, so the best position of is to be always first. Working with variable position arguments is not feeling good any way.
Adding option for that would work too.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
argparse — Parser for command-line options, arguments and ...
The program defines what arguments it requires, and argparse will figure out how to parse those out of sys.argv . The argparse module...
Read more >python - Argparse: Required arguments listed under "optional ...
In general, the argparse module assumes that flags like -f and --bar indicate optional arguments, which can always be omitted at the command ......
Read more >Advanced Python: Parsing Command-Line Arguments
argparse is the advanced option: it's a library that uses sys.argv to create a user-friendly way to create and work with arguments. 3...
Read more >argparse — Command-Line Option and Argument Parsing
The first step when using argparse is to create a parser object and tell it what ... The default action is to store...
Read more >Command Line Argument Parsing in Python - DataCamp
Notice that the first argument is always the name of the Python file. ... the filename argv = sys.argv[1:] sum = 0 try:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Great! Yeah, I didn’t think there was really much of an issue 😅 Seemed like a super weird edge case… or just strong preference.
Going to go ahead & close the other issue too – I forgot about it. There’s no need to expose it because Sade if self-contained. Exposing it is just asking for trouble and weird edge cases. It works and does what it’s meant to do 😇
Ha! With fresh mind and cup of coffee… Rethinking it, makes the things easier and no need for any changes. Even the #13 is not needed so much, but still can be good addition for someone else. ☕ 👌