diff --git a/plugins/yum_pkgs.py b/plugins/yum_pkgs.py index f845fb4..5e2b55b 100644 --- a/plugins/yum_pkgs.py +++ b/plugins/yum_pkgs.py @@ -227,3 +227,21 @@ class Backup(object): with open(self.output, 'wb') as f: f.write(self.pkglist) return() + +if __name__ == '__main__': + import argparse + args = argparse.ArgumentParser(description = 'Parse and report installed packages') + args.add_argument('-x', '--no-explicit', + dest = 'explicit_only', + action = 'store_false', + help = ('If specified, catalogue ALL installed packages, ' + 'not ones only explicitly-installed (implies -i/--includes)')) + args.add_argument('-i', '--includes', + dest = 'include_deps', + action = 'store_true', + help = ('If specified, include packages installed as dependencies')) + args.add_argument('output', + help = 'The file to write the XML output to.') + args = vars(args.parse_args()) + b = Backup(**args) +