diff options
-rwxr-xr-x | firstaidkit | 5 | ||||
-rw-r--r-- | pyfirstaidkit/configuration.py | 1 | ||||
-rw-r--r-- | pyfirstaidkit/interpret.py | 4 |
3 files changed, 9 insertions, 1 deletions
diff --git a/firstaidkit b/firstaidkit index 29d60db..fda590d 100755 --- a/firstaidkit +++ b/firstaidkit @@ -54,13 +54,14 @@ def usage(name): -v - verbose mode -l <method> - select different log method -x <plugin> - exclude plugin from run + -F <flag> - set startup flag -g <gui> - frontend to show results -h - help --print-config - print resulting config file """ % (name, name, name) if __name__=="__main__": - params, rest = getopt.getopt(sys.argv[1:], "ftc:r:vl:x:g:P:h", ["flow", "task", "config=", "root=", "verbose", "log=", "exclude=", "gui=", "plugin-path=", "print-config", "help"]) + params, rest = getopt.getopt(sys.argv[1:], "ftc:r:vl:x:F:g:P:h", ["flow", "task", "config=", "root=", "verbose", "log=", "exclude=", "flag=", "gui=", "plugin-path=", "print-config", "help"]) for key,val in params: if key in ("-t", "--task"): Config.operation.mode = "task" @@ -77,6 +78,8 @@ if __name__=="__main__": elif key in ("-x", "--exclude"): Config.plugin.disabled = Config.plugin.disabled + ' "%s"' % (val.encode("string-escape")) print "Excluding plugin %s\n" % (val,) + elif key in ("-F", "--flag"): + Config.operation.flags = Config.operation.flags + ' "%s"' % (val.encode("string-escape")) elif key in ("-r", "--root"): Config.system.root = val elif key in ("-g", "--gui"): diff --git a/pyfirstaidkit/configuration.py b/pyfirstaidkit/configuration.py index 1f1194d..285ef81 100644 --- a/pyfirstaidkit/configuration.py +++ b/pyfirstaidkit/configuration.py @@ -29,6 +29,7 @@ else: def createDefaultConfig(config): """Create the default config with the object.""" config.system.root = "/mnt/sysimage" + config.operation.flags = "" config.operation.mode = "auto" config.operation.help = "False" config.operation.gui = "console" diff --git a/pyfirstaidkit/interpret.py b/pyfirstaidkit/interpret.py index 08128ad..e45c0d8 100644 --- a/pyfirstaidkit/interpret.py +++ b/pyfirstaidkit/interpret.py @@ -72,6 +72,10 @@ class Tasker: def run(self): pluginSystem = self.pluginSystem + #initialize the startup set of flags + for flag in self._config.operation._list("flags"): + self._provide.provide(flag) + if self._config.operation.mode == "auto": oldlist = set() actlist = set(pluginSystem.list()) |