diff roundup/admin.py @ 7546:534f8bdb8f94

Add -P pragma=value command line option to roundup-admin. To set pragmas when using non-interactive mode, or set on command line when going into interactive mode. Also changed specification test to use command line pragma setting rather than interactive. This tests the -P option without having to run an extra test. Docs updated as well.
author John Rouillard <rouilj@ieee.org>
date Fri, 14 Jul 2023 00:30:44 -0400
parents 939fcfdfa370
children c8c4514f4c3e
line wrap: on
line diff
--- a/roundup/admin.py	Fri Jul 14 00:10:42 2023 -0400
+++ b/roundup/admin.py	Fri Jul 14 00:30:44 2023 -0400
@@ -173,6 +173,8 @@
  -S <string>       -- when outputting lists of data, string-separate them
  -s                -- when outputting lists of data, space-separate them.
                       Same as '-S " "'.
+ -P pragma=value   -- Set a pragma on command line rather than interactively.
+                      Can be used multiple times.
  -V                -- be verbose when importing
  -v                -- report Roundup and Python versions (and quit)
 
@@ -2114,7 +2116,7 @@
 
     def main(self):
         try:
-            opts, args = getopt.getopt(sys.argv[1:], 'i:u:hcdsS:vV')
+            opts, args = getopt.getopt(sys.argv[1:], 'i:u:hcdP:sS:vV')
         except getopt.GetoptError as e:
             self.usage(str(e))
             return 1
@@ -2160,6 +2162,8 @@
                 self.separator = ' '
             elif opt == '-d':
                 self.print_designator = 1
+            elif opt == '-P':
+                self.do_pragma([arg])
             elif opt == '-u':
                 login_opt = arg.split(':')
                 self.name = login_opt[0]

Roundup Issue Tracker: http://roundup-tracker.org/