code: def test_fail_with_short_help():
      out = StringIO()
      with assert_raises(SystemExit) as cme:
          fail_with_short_help(exit_code=3, out=out)
      assert_equal(cme.value.code, 3)
      assert_equal(out.getvalue(), "")
  
      out = StringIO()
      with assert_raises(SystemExit) as cme:
          fail_with_short_help(msg="Failed badly", out=out)
      assert_equal(cme.value.code, 1)
      assert_equal(out.getvalue(), "error: Failed badly\n")
  
      # Suggestions, hint, etc
      out = StringIO()
      with assert_raises(SystemExit) as cme:
          fail_with_short_help(
              msg="Failed badly",
              known=["mother", "mutter", "father", "son"],
              provided="muther",
              hint="You can become one",
              exit_code=0,  # no one forbids
              what="parent",
              out=out,
          )
      assert_equal(cme.value.code, 0)
      assert_equal(
          out.getvalue(),
          "error: Failed badly\n"
          "datalad: Unknown parent 'muther'.  See 'datalad --help'.\n\n"
          "Did you mean any of these?\n"
          "        mutter\n"
          "        mother\n"
          "        father\n"
          "Hint: You can become one\n",
      )
  
imports: from io import StringIO
  from unittest.mock import patch
  from datalad.tests.utils_pytest import assert_equal, assert_in, assert_raises
  from ..parser import fail_with_short_help, setup_parser
label_desc: Use image node_id 1 for calling a global function with example usage: test_fail_with_short_help() without return types