Print the mypy command in mypy wrapper
diff --git a/scripts/mypy b/scripts/mypy
index 8475a1d9510a..7e3892313086 100755
--- a/scripts/mypy
+++ b/scripts/mypy
@@ -22,7 +22,8 @@ import os
 import os.path
 import sys
 import tempfile
-from typing import List
+import shlex
+from typing import List, Iterable
 
 import click
 import mypy.main as mypy_main
@@ -32,6 +33,14 @@ PATHS = ["lib/streamlit/", "scripts/*", "e2e/scripts/*"]
 EXCLUDE_FILES = {"scripts/add_license_headers.py", "e2e/scripts/st_reuse_label.py"}
 
 
+def shlex_join(split_command: Iterable[str]):
+    """Return a shell-escaped string from *split_command*.
+
+    This function is backported from Python 3.8 - shlex.join
+    """
+    return ' '.join(shlex.quote(arg) for arg in split_command)
+
+
 class Module:
     _COLUMNS = (56, 5, 5, 7)
     _HEADERS = ("Module", "Lines", "Typed", "Percent")
@@ -92,7 +101,15 @@ def process_report(path: str) -> None:
 
 @click.command()
 @click.option("--report", is_flag=True, help="Emit line coverage report for all files")
-def main(report: bool = False) -> None:
+@click.option(
+  "--verbose",
+  '-v',
+  is_flag=True,
+  help=(
+    "Verbose mode. Causes this command to print mypy command being executed."
+  )
+)
+def main(report: bool = False, verbose: bool = False) -> None:
     paths: List[str] = []
     for path in PATHS:
         if "*" in path:
@@ -109,6 +126,9 @@ def main(report: bool = False) -> None:
     args.append("--")
     args.extend(paths)
 
+    if verbose:
+      shell_command = shlex_join(itertools.chain(['mypy'], args))
+      print("Executing command:", shell_command)
     mypy_main.main(None, sys.stdout, sys.stderr, args=args)
     if report:
         process_report(os.path.join(tempdir.name, "lineprecision.txt"))

<!--
Before contributing (PLEASE READ!)

⚠️ If your contribution is more than a few lines of code, then prior to starting to code on it please post in the issue saying you want to volunteer, then wait for a positive response. And if there is no issue for it yet, create it first.

This helps make sure:

  1. Two people aren't working on the same thing
  2. This is something Streamlit's maintainers believe should be implemented/fixed
  3. Any API, UI, or deeper architectural changes that need to be implemented have been fully thought through by Streamlit's maintainers
  4. Your time is well spent!

More information in our wiki: https://github.com/streamlit/streamlit/wiki/Contributing
-->

## 📚 Context

In our project, calling a myypy is not standard and therefore we have a wrapper that makes it easy.
For more advanced use cases, there's a need to run it directly. To make this possible, I printed the commands on sys.stdout, so you can copy and paste them into a terminal to modify later to suit your requirements.

<img width="1785" alt="Screenshot 2022-08-30 at 19 36 00" src="https://user-images.githubusercontent.com/78743291/187505568-6afd3e80-6853-4c42-af7c-ecaa71216ebb.png">

It also helps to troubleshoot this script.

_Please describe the project or issue background here_

- What kind of change does this PR introduce?

  - [ ] Bugfix
  - [ ] Feature
  - [ ] Refactoring
  - [ ] Other, please describe:

## 🧠 Description of Changes

- _Add bullet points summarizing your changes here_

  - [ ] This is a breaking API change
  - [ ] This is a visible (user-facing) change

**Revised:**

_Insert screenshot of your updated UI/code here_

**Current:**

_Insert screenshot of existing UI/code here_

## 🧪 Testing Done

- [ ] Screenshots included
- [ ] Added/Updated unit tests
- [ ] Added/Updated e2e tests

## 🌐 References

_Does this depend on other work, documents, or tickets?_

- **Issue**: Closes #XXXX

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
