args for OptionsParser defaults to sys.argv
[dbuscron] / dbuscron / parser.py
index b004fb7..0d26c85 100644 (file)
@@ -78,8 +78,13 @@ class CrontabParser(object):
                     yield ruled, command
 
 class OptionsParser(dict):
-    def __init__(self, args, opts):
+    def __init__(self, opts, args=None):
         super(OptionsParser, self).__init__()
+
+        if args is None:
+            import sys
+            args = sys.argv[1:]
+
         from getopt import getopt
         go, _ = getopt(args, opts)