main: Add --debug option to increase verbosity.
[matthijs/projects/backupninja.git] / src / backupninja
index e351c62acd9afd171be82135dc554d74e2b8145e..1c2d71c26cdce22620c60ed7c3494cec0d14c7bc 100755 (executable)
@@ -35,7 +35,35 @@ log = logging.getLogger()
 def make_option_parser():
     description = """%prog checks for scheduled actions and runs them when needed."""
     parser = optparse.OptionParser(description=description)
-
+    parser.add_option( "-c", "--confdir"
+                     , help="Load configuration from CONFIG_DIR "
+                            "instead of '%default'. When "
+                            "the --conffile or --actionsdir options "
+                            "specify relative paths, they are taken "
+                            "relative to this directory."
+                     , default="/etc/backupninja"
+                     , dest="config_dir"
+                     , metavar="CONFIG_DIR")
+    parser.add_option( "-f", "--conffile"
+                     , help="Load the main configuration from FILE instead "
+                            "of '%default'. If FILE is a relative path, it "
+                            "is interpreted relative to CONFIG_DIR."
+                     , default='backupninja.conf'
+                     , dest="global_config"
+                     , metavar="FILE")
+    parser.add_option( "-a", "--actionsdir"
+                     , help="Load action configurations from ACTIONS_DIR "
+                            "instead of '%default'. If ACTIONS_DIR is a "
+                            "relative path, it is interpreted relative to "
+                            "CONFIG_DIR."
+                     , default="actions"
+                     , dest="actions_dir"
+                     , metavar="ACTIONS_DIR")
+    parser.add_option( "-d", "--debug"
+                     , help="Run in debug mode. This only means logging is "
+                            "more verbose."
+                     , action="store_true"
+                     , dest="debug")
     return parser
  
 def main(argv):