Repository: scrapy/scrapy

Issue:
scrapy parse -h throws error
### Description
running `scrapy parse -h` from inside of a project throws an error.

### Steps to Reproduce
1.  `scrapy startproject example`
2.  `cd example`
3.  `scrapy parse -h`

**Expected behavior:**  It should show the help message output for the `parse` command
**Actual behavior:**  Throws error and displays traceback information
**Reproduces how often:**  Every time I tried it.

### Versions
v2.6.1

### Additional context

I identified the issue and will submit a PR shortly. 


Discussion:
I can reproduce. For completeness, here's the full output I'm getting:

```
$ scrapy parse -h
Traceback (most recent call last):
  File "/home/eugenio/zyte/scrapy/venv-scrapy/bin/scrapy", line 33, in <module>
    sys.exit(load_entry_point('Scrapy', 'console_scripts', 'scrapy')())
  File "/home/eugenio/zyte/scrapy/scrapy/cmdline.py", line 141, in execute
    opts, args = parser.parse_known_args(args=argv[1:])
  File "/usr/local/lib/python3.9/argparse.py", line 1851, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/local/lib/python3.9/argparse.py", line 2060, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/usr/local/lib/python3.9/argparse.py", line 2000, in consume_optional
    take_action(action, args, option_string)
  File "/usr/local/lib/python3.9/argparse.py", line 1928, in take_action
    action(self, namespace, argument_values, option_string)
  File "/usr/local/lib/python3.9/argparse.py", line 1092, in __call__
    parser.print_help()
  File "/usr/local/lib/python3.9/argparse.py", line 2548, in print_help
    self._print_message(self.format_help(), file)
  File "/usr/local/lib/python3.9/argparse.py", line 2532, in format_help
    return formatter.format_help()
  File "/usr/local/lib/python3.9/argparse.py", line 283, in format_help
    help = self._root_section.format_help()
  File "/usr/local/lib/python3.9/argparse.py", line 214, in format_help
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/local/lib/python3.9/argparse.py", line 214, in <listcomp>
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/local/lib/python3.9/argparse.py", line 214, in format_help
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/local/lib/python3.9/argparse.py", line 214, in <listcomp>
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/local/lib/python3.9/argparse.py", line 530, in _format_action
    help_text = self._expand_help(action)
  File "/usr/local/lib/python3.9/argparse.py", line 626, in _expand_help
    return self._get_help_string(action) % params
TypeError: %d format: a number is required, not dict
```

I suspect this was valid with `optparse` and broke on the move to `argparse` (#5374)

Resolving patch:
diff --git a/scrapy/commands/parse.py b/scrapy/commands/parse.py
--- a/scrapy/commands/parse.py
+++ b/scrapy/commands/parse.py
@@ -51,7 +51,7 @@ def add_options(self, parser):
         parser.add_argument("--cbkwargs", dest="cbkwargs",
                             help="inject extra callback kwargs into the Request, it must be a valid raw json string")
         parser.add_argument("-d", "--depth", dest="depth", type=int, default=1,
-                            help="maximum depth for parsing requests [default: %default]")
+                            help="maximum depth for parsing requests [default: %(default)s]")
         parser.add_argument("-v", "--verbose", dest="verbose", action="store_true",
                             help="print each depth level one by one")
 


Test patch:
diff --git a/tests/test_commands.py b/tests/test_commands.py
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -930,3 +930,17 @@ def start_requests(self):
         args = ['-o', 'example1.json', '-O', 'example2.json']
         log = self.get_log(spider_code, args=args)
         self.assertIn("error: Please use only one of -o/--output and -O/--overwrite-output", log)
+
+
+class HelpMessageTest(CommandTest):
+
+    def setUp(self):
+        super().setUp()
+        self.commands = ["parse", "startproject", "view", "crawl", "edit",
+                         "list", "fetch", "settings", "shell", "runspider",
+                         "version", "genspider", "check", "bench"]
+
+    def test_help_messages(self):
+        for command in self.commands:
+            _, out, _ = self.proc(command, "-h")
+            self.assertIn("Usage", out)