New argument processing code merged into devel

2023-06-15 Thread Edward K. Ream
PR #3382 is now part of devel. The new code: - resolves the problems discussed in #3382 , - produces better messages, - is generally simpler and more flexible. The code has only been

Re: Discuss: don't use argparse to handle command-line arguments

2023-06-15 Thread Edward K. Ream
On Thu, Jun 15, 2023 at 7:50 AM Thomas Passin wrote: I say, if you don't need all the complexity of argparse don't use it! *Nobody *needs all that complexity :-) The argparse module is founded on a design mistake that python was created to avoid. In effect, argparse creates a specialized

Re: Discuss: don't use argparse to handle command-line arguments

2023-06-15 Thread Thomas Passin
Just for general interest, here's my little argument parser: import sys def getopt (param, default=None): """Return a named parameter value from the command line. The parameter and its value must be of the form -param value The parameter string and its following value are

Re: Discuss: don't use argparse to handle command-line arguments

2023-06-15 Thread Thomas Passin
I wrote my own a few years ago. It was simple to use and understand. It was too simple, perhaps, but it did what I needed for a range of small programs. The only thing it doesn't do is to flag unknown options: it ignores them instead. I say, if you don't need all the complexity of argparse

Re: Discuss: don't use argparse to handle command-line arguments

2023-06-15 Thread Edward K. Ream
On Thursday, June 15, 2023 at 3:36:13 AM UTC-5 Edward K. Ream wrote: I plan to rewrite LM.scanOptions without argparse. Initial work is promising. *Everything* seems easier w/o argparse! See PR #3382 . Edward -- You received this message

Discuss: don't use argparse to handle command-line arguments

2023-06-15 Thread Edward K. Ream
Leo issue #3351 reports a problem with how Leo handles --trace arguments. Last night I marked this issue Can'tFix because I could see no *easy* way to make python's argparse module do what