Python argparse help formatter that keeps new lines and doesn't break words (so URLs are preserved), but still wraps lines. Use with: `argparse.ArgumentParser(formatter_class=SmartFormatter)`

Python argparse help formatter that keeps new lines and doesn't break words (so URLs are preserved), but still wraps lines. Use with: `argparse.ArgumentParser(formatter_class=SmartFormatter)` -...

Gist
Had an enjoyable afternoon building a custom #cli #parser to replace #argparse in our internal tooling. I like its ease of use. But it is a custom parser and works only for my specific use case, but for use case it does more than argparse can and is simpler to use. #comandline #python

@sumanthvepa

argparse is maybe-okay for simple things, but I don't use it for pretty much anything anymore. Have you tried one of the other extant packages that provide higher-level, more-powerful option handling?

I use `click` extensively for complex multiple-command CLI tools.

#click #optparse #argparse #CLI

It's probably a case of #bikesheding, but I've been really unhappy with the #python 's #argparse library for a while now. It's okay for run of the mill tools, but fails for more complex command line tools that have subcommands and complex options like --no-except to negate an option.

This is my first cut writing a command line parser for a #cli

https://github.com/sumanthvepa/experiments/tree/develop/python/parse-dralithus-cmdline

experiments/python/parse-dralithus-cmdline at develop · sumanthvepa/experiments

Experiments is a repository of programming experiments that I written to explore various aspects of programming and technology - sumanthvepa/experiments

GitHub

Migrated my user-space environement over to #Python 3.14.0b1 today.

Nice to see the majority of the packages I use work without issue, so far.

Plus, I get that all that pretty colored output from #argparse!

#EyeCandy #Terminal #CLI

Huh, there is really no way in #Python #argparse to say "print full help, not only usage when an error occurs"?

I mean, besides
```
parser = argparse.ArgumentParser()
parser.format_usage = parser.format_help
```
(or similar monstrosities)

GitHub - scheehan/gen_flask_web_app_with_script

Contribute to scheehan/gen_flask_web_app_with_script development by creating an account on GitHub.

GitHub
【Python3.14】getoptとoptparseが非推奨でなくなった - Qiita

Pythonにはコマンドライン引数をパースする標準モジュールがgetopt・optparse・argparseの3種類あります。このうちoptparseは14年も前の2011/02/20にリリース…

Qiita

TIL: #Python's #argparse module cannot parse arguments that start with a dash. It always expects them to be a flag and then throws an error if that flag is not defined.

https://github.com/python/cpython/issues/61252

My use case: I have a command with subparsers/subcommands, and I'd like one of these subcommands to just take all of argv that follows its name and pass it on to someplace else.

mycmd subcmd foo -bar --baz

subcmd.add_argument("args", nargs="*") doesn't work.

Guess I'll have to resort to a hack.

argparse.REMAINDER doesn't work as first argument · Issue #61252 · python/cpython

BPO 17050 Nosy @rhettinger, @miss-islington, @shihai1991, @dHannasch PRs #18661#20363 Files argparse_example.py: Script demonstrating what works and what does not work. Note: these values reflect t...

GitHub

🎉 Please welcome @savannah as the newest member of the Python core team!

She has recently been doing lots of excellent work on the new JIT and giving argparse some long-overdue attention.

https://discuss.python.org/t/vote-to-promote-savannah-ostrowski/70302

Savannah is the 9th new team member so far this year, which is the most we've had since 2012 🚀

https://hugovk.github.io/python-core-devs/by-year.html

#Python #CPython #PythonCoreTeam #JIT #argparse

Vote to promote Savannah Ostrowski

Carol Willing and I would like to promote Savannah Ostrowski (@savannahostrowski on GitHub) to the core development team. Since becoming active in the project over a year ago, Savannah has personally authored over 70 issues and pull requests, and has been involved in over 120 issues and pull requests created by others. She has been a part of the triage team since May, and has authored patches in a wide range of areas: the subtle C code required to handle jumps in debuggers without crashing, ini...

Discussions on Python.org