iddb: The program now uses a pager to display the help text.
Warning, cannot access the index:
_darcs/index: opening of '_darcs/index' failed: permission denied (Permission denied)
diff -rN -u old-bii_scripts/bin/iddb new-bii_scripts/bin/iddb
--- old-bii_scripts/bin/iddb 2022-09-26 06:13:36.993689254 +0200
+++ new-bii_scripts/bin/iddb 2022-09-26 06:13:36.993689254 +0200
@@ -5,6 +5,7 @@
import os
import argparse
import re
+import pydoc
import socket
import http
@@ -593,7 +594,7 @@
# -----------------------------------------------
# main program
-def process(args, rest):
+def process(args, rest, parser):
"""do all the work.
"""
#print("args:",args)
@@ -604,6 +605,10 @@
if args.summary:
print_summary()
sys.exit(0)
+ if args.help:
+ helptext= parser.format_help()
+ pydoc.pager(helptext)
+ sys.exit(0)
dbobj= None
if args.file:
@@ -770,6 +775,7 @@
usage= USAGE,
description= DESC,
formatter_class=argparse.RawDescriptionHelpFormatter,
+ add_help= False
)
parser.add_argument('--version', action='version', version='%%(prog)s %s' % VERSION)
@@ -777,6 +783,11 @@
action="store_true",
help="print a summary of the function of the program",
)
+ parser.add_argument("-h","--help",
+ action="store_true",
+ help="Print help (with pager)",
+ )
+
parser.add_argument("-S", "--sort-by",
help="specify the SORTCOLUMN",
metavar="SORTCOLUMN"
@@ -833,7 +844,7 @@
print_summary()
sys.exit(0)
- process(args, rest)
+ process(args, rest, parser)
sys.exit(0)
if __name__ == "__main__":
patch b5e24f6b6eaf27446b5f8b89aff398dfea0d756a
Author: Goetz Pfeiffer <Goetz.Pfeiffer@helmholtz-berlin.de>
Date: Wed Dec 15 08:50:24 CET 2021
* iddb: The program now uses a pager to display the help text