New GitHub issue #119021 from mathgeniuszach:<br>
<hr>
<pre>
# Bug report
### Bug description:
Consider the following code,
```python
import argparse
parser = argparse.ArgumentParser(prog="prog")
subparsers = parser.add_subparsers(metavar="mode")
a = subparsers.add_parser("option-a-here", help="helpful help")
b = subparsers.add_parser("option-b-here", help="super helpful help")
parser.parse_args()
```
Which produces this output, where even though there is more than enough room to print the descriptions after the arguments, it places them on the next line instead.
```
usage: prog [-h] mode ...
positional arguments:
mode
option-a-here
helpful help
option-b-here
super helpful help
options:
-h, --help show this help message and exit
```
While with this code instead,
```python
import argparse
parser = argparse.ArgumentParser(prog="prog")
parser.add_argument("--option-a", help="helpful help")
parser.add_argument("--option-b", help="super helpful help")
parser.parse_args()
```
The program correctly places them on the same line:
```
usage: prog [-h] [--option-a OPTION_A] [--option-b OPTION_B]
options:
-h, --help show this help message and exit
--option-a OPTION_A helpful help
--option-b OPTION_B super helpful help
```
I believe this is an error with [ `HelpFormatter.add_argument()`](https://github.com/python/cpython/blob/e04cd964eb4eee1b0ae5b2c34727abce6c0fb7f0/Lib/argparse.py#L259), where the indent/dedent coming from `HelpFormatter._iter_indented_subactions()` is neither evaluated by [`_SubParserAction._get_subactions()`](https://github.com/python/cpython/blob/e04cd964eb4eee1b0ae5b2c34727abce6c0fb7f0/Lib/argparse.py#L1183) nor considered by [`self._current_indent`](https://github.com/python/cpython/blob/e04cd964eb4eee1b0ae5b2c34727abce6c0fb7f0/Lib/argparse.py#L270).
### CPython versions tested on:
3.11, 3.12, 3.13
### Operating systems tested on:
Linux
</pre>
<hr>
<a href="https://github.com/python/cpython/issues/119021">View on GitHub</a>
<p>Labels: type-bug</p>
<p>Assignee: </p>