]> git.ipfire.org Git - pakfire.git/commitdiff
pakfire: execute: Add --non-interactive switch
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 8 Dec 2021 17:28:58 +0000 (17:28 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 8 Dec 2021 17:28:58 +0000 (17:28 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/scripts/pakfire.in

index a9afd87848e027c939f027af5edecd1b1571a662..ac228f14b1f1ba70a323882c985bc1b4a748d671 100644 (file)
@@ -75,6 +75,8 @@ class Cli(object):
                        help=_("Executes a command in the pakfire environment (useful for development)"))
                execute.add_argument("--bind", action="append", default=[], dest="binds",
                        help=_("Bind-mounts the given directory"))
+               execute.add_argument("--non-interactive", action="store_false", dest="interactive",
+                       help=_("Run in non-interactive mode"))
                execute.add_argument("command", nargs=argparse.REMAINDER)
                execute.set_defaults(func=self._execute)
 
@@ -302,7 +304,8 @@ class Cli(object):
                        else:
                                sys.stdout.write("%s\n" % line)
 
-               return p.execute(args.command, logging_callback=logging_callback)
+               return p.execute(args.command,
+                       interactive=args.interactive, logging_callback=logging_callback)
 
        def _info(self, p, args):
                for pkg in p.search(args.package, name_only=True):