scripts: csv.py: Added --help-mods to help explain % modifiers

I guess in addition to its other utilities, csv.py is now also turning
into a sort of man database for some of the more complicated APIs in the
scripts:

  ./csv.py --help
  ./csv.py --help-exprs
  ./csv.py --help-mods

It's a bit minimal, but better than nothing.

Also dropped the %c modifier because this never actually worked.
This commit is contained in:
Christopher Haster
2025-02-28 03:21:40 -06:00
parent b2768becaa
commit 861dc3bd6a
5 changed files with 29 additions and 5 deletions

View File

@ -480,7 +480,7 @@ def punescape(s, attrs=None):
'|' '%u....'
'|' '%U........'
'|' '%\((?P<field>[^)]*)\)'
'(?P<format>[+\- #0-9\.]*[scdboxXfFeEgG])')
'(?P<format>[+\- #0-9\.]*[sdboxXfFeEgG])')
def unescape(m):
if m.group()[1] == '%': return '%'
elif m.group()[1] == 'n': return '\n'