question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parsed args (argv/opts) always to be the 1st param of action

See original GitHub issue

Heya. 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:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lukeedcommented, Mar 2, 2018

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 😇

0reactions
tunnckoCorecommented, Mar 2, 2018

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. ☕ 👌

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found