Re:Tools I use: argparse builder
by metalliqaz on Thursday October 08, 2020 @12:17PM
(#24720570)
Looking at that link, argparse is very similar to structopt. It just uses the syntax and idioms of a different language. The structopt attributes appear to be approx. the same complexity as argparse functions.
Indeed. My guess would be that structopt's design was based on Python's argparse, which itself derived from lessons learned from the earlier Python module optparse, which was created around 20 years ago. I'm not sure where declarative CLI argument parsing originated, but I first encountered it in optparse.
There are multiple alternatives for argparse if you look for third-party libraries.
The thing that makes argparse particularly useful is because it is in stdlib, so if you use you can create a Python script without external dependencies.
Isn't there anything like structopt https://docs.rs/structopt/0.3.19/structopt/ for Python?