diff --git a/keyring/completion.py b/keyring/completion.py index 33fe36f..e49bc3d 100644 --- a/keyring/completion.py +++ b/keyring/completion.py @@ -1,4 +1,5 @@ import argparse +import sys try: import shtab @@ -10,8 +11,8 @@ class _MissingCompletionAction(argparse.Action): def __call__(self, parser, namespace, values, option_string): - print("Install keyring[completion] for completion support.") - parser.exit(0) + print("Install keyring[completion] for completion support.", file=sys.stderr) + parser.exit(1) def add_completion_notice(parser): diff --git a/newsfragments/671.bugfix.rst b/newsfragments/671.bugfix.rst new file mode 100644 index 0000000..1aa324b --- /dev/null +++ b/newsfragments/671.bugfix.rst @@ -0,0 +1 @@ +When completion is unavailable, exit with non-zero status and emit message to stderr. \ No newline at end of file