import sys
import pakfire
+import pakfire.errors
from pakfire.i18n import _
class Cli(object):
else:
sys.stdout.write("%s\n" % line)
- return p.execute(args.command,
- interactive=args.interactive, logging_callback=logging_callback)
+ try:
+ return p.execute(args.command,
+ interactive=args.interactive, logging_callback=logging_callback)
+
+ # Exit program with the command's exit code
+ except pakfire.errors.CommandExecutionError as e:
+ return e.args[0]
def _info(self, p, args):
for pkg in p.search(args.package, name_only=True):