changeset 757:af7b427b3b83

print config option
author Jeff Hammel <k0scist@gmail.com>
date Thu, 06 Aug 2015 18:06:35 -0700
parents 12f0be02e9cc
children 88f19ebb43ea
files python/dlna.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/python/dlna.py	Wed Aug 05 08:44:23 2015 -0700
+++ b/python/dlna.py	Thu Aug 06 18:06:35 2015 -0700
@@ -31,6 +31,9 @@
     parser.add_argument('-v', '--videos', dest='videos', nargs='+',
                         help="videos")
     parser.add_argument('audio', nargs='+')
+    parser.add_argument('--print', '--print-config', dest='print_config',
+                        action='store_true', default=False,
+                        help="write config to stdout and exit")
     options = parser.parse_args(args)
 
     # dlna location
@@ -50,6 +53,9 @@
     config = '\n'.join(['{}={}'.format(*line) for line in lines])
     print (config)
 
+    if options.print_config:
+        parser.exit()
+
     fd, name = tempfile.mkstemp()
     os.write(fd, config)
     os.close(fd)