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


##########
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:
   I remember we disabled argument abbreviation in #34934. Does this mean short 
options `-x` are no longer relevant? cc: @tvalentyn @damccorm 



-- 
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: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to