-
-
Notifications
You must be signed in to change notification settings - Fork 59
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
🐛 Bug report
When specifying both choices
and type
in parser.add_argument
, the tab completion for choices
will not work.
To reproduce
Create a simple script named example.py
with execute permission:
#! /bin/env python
from jsonargparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('x', type=str, choices=['a', 'b', 'c'])
args = parser.parse_args()
Open a shell, calling eval "`register-python-argcomplete example.py`"
, and type: ./example.py <TAB>
.
Expected behavior
Showing the following content as if using the vanilla argparse
package:
c b a --
--help -h -- show this help message and exit
Actual behavior
In zsh, nothing shows; in bash, the following content shows:
-h --help value not yet valid, expected type str
Environment
- jsonargparse version: 4.27.1
- Python version: 3.11.7
- How jsonargparse was installed:
pip install jsonargparse[signatures, omegaconf, argcomplete]
- OS: Linux (Ubuntu 22.04)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working