class_docstr: shorten help for long options that differ only in extra hyphens
  
  - collapse **long** options that are the same except for extra hyphens
  - special action attribute map_long_option allows surpressing additional
    long options
  - shortcut if there are only two options and one of them is a short one
  - cache result on action object as this is called at least 2 times
code: def _format_action_invocation(self, action):
      orgstr = argparse.HelpFormatter._format_action_invocation(
          self, action
      )
      if orgstr and orgstr[0] != "-":  # only optional arguments
          return orgstr
      res = getattr(action, "_formatted_action_invocation", None)
      if res:
          return res
      options = orgstr.split(", ")
      if len(options) == 2 and (
          len(options[0]) == 2 or len(options[1]) == 2
      ):
          # a shortcut for '-h, --help' or '--abc', '-a'
          action._formatted_action_invocation = orgstr
          return orgstr
      return_list = []
      option_map = getattr(action, "map_long_option", {})
      if option_map is None:
          option_map = {}
      short_long = {}
      for option in options:
          if len(option) == 2 or option[2] == " ":
              continue
          if not option.startswith("--"):
              raise ArgumentError(
                  'long optional argument without "--": [%s]'
                  % (option),
                  self,
              )
          xxoption = option[2:]
          if xxoption.split()[0] not in option_map:
              shortened = xxoption.replace("-", "")
              if shortened not in short_long or len(
                  short_long[shortened]
              ) < len(xxoption):
                  short_long[shortened] = xxoption
      # now short_long has been filled out to the longest with dashes
      # **and** we keep the right option ordering from add_argument
      for option in options:
          if len(option) == 2 or option[2] == " ":
              return_list.append(option)
          if option[2:] == short_long.get(option.replace("-", "")):
              return_list.append(option.replace(" ", "=", 1))
      action._formatted_action_invocation = ", ".join(return_list)
      return action._formatted_action_invocation
  
imports: import argparse
  import warnings
  import py
  import six
  from _pytest.config.exceptions import UsageError
label_desc: Use image node_id 1 for calling the DropShorterLongHelpFormatter obj's underlying member method code with example usage: obj._format_action_invocation(action) and returns: action, orgstr, res, orgstr