Commits

Michał Górny committed f8e28db

Always abort on argument parser errors.

When ambiguous or invalid arguments are passed, abort completely rather
than performing a partial job. Warnings are still non-fatal unless
--strict.

  • Participants
  • Parent commits f724027

Comments (0)

Files changed (1)

File lib/flaggie/cli.py

 				raise
 			else:
 				actset.append(act)
-		except (ParserError, ParserWarning) as e:
+		except ParserError as e:
+			output.write('At argv[%d]=\'%s\': %s\n' % (i + 1, a, e))
+			output.write('Aborting.\n')
+			return None
+		except ParserWarning as e:
 			if not quiet or strict:
 				output.write('At argv[%d]=\'%s\': %s\n' % (i + 1, a, e))
 			if strict:
-				if not quiet:
-					output.write('Strict mode, aborting.\n')
+				output.write('Strict mode, aborting.\n')
 				return None
 
 	if actset and (actset.pkgs or not had_pkgs):