damccorm commented on code in PR #36072:
URL: https://github.com/apache/beam/pull/36072#discussion_r2334469252


##########
sdks/python/apache_beam/options/pipeline_options.py:
##########
@@ -449,11 +450,31 @@ def from_dictionary(cls, options):
 
     return cls(flags)
 
+  @staticmethod
+  def _warn_on_unknown_options(unknown_args, parser):
+    if not unknown_args:
+      return
+
+    all_known_options = [
+        opt for action in parser._actions for opt in action.option_strings
+    ]
+
+    for arg in unknown_args:
+      if not arg.startswith('--'):
+        continue
+      arg_name = arg.split('=', 1)[0]
+      suggestions = difflib.get_close_matches(arg_name, all_known_options)
+      msg = f"Unparseable argument: {arg}"
+      if suggestions:
+        msg += f". Did you mean '{suggestions[0]}'?"
+      _LOGGER.warning(msg)

Review Comment:
   Yeah, short options are ignored now (so we probably want to catch them here)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to