Skip to content

Conversation

@ericwb
Copy link
Contributor

@ericwb ericwb commented Nov 19, 2025

The suggest_on_error, introduced in Python 3.14 enables argparse to automatically suggest argument names when a user types one in error.

Note, this is only available in Python 3.14

https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds automatic CLI argument suggestion on error using argparse's suggest_on_error parameter, which helps users by suggesting correct argument names when they make typos. The change also updates the copyright year in one file.

  • Adds suggest_on_error=True to ArgumentParser instances in CLI modules
  • Updates copyright year from 2024 to 2025 in init.py

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
precli/cli/main.py Adds suggest_on_error=True parameter to the main CLI ArgumentParser
precli/cli/init.py Adds suggest_on_error=True parameter to the init CLI ArgumentParser and updates copyright year to 2025

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The suggest_on_error, introduced in Python 3.14 enables
argparse to automatically suggest argument names when
a user types one in error.

Note, this is only available in Python 3.14

https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser

Signed-off-by: Eric Brown <eric.brown@securesauce.dev>
@ericwb ericwb merged commit 920ab5c into securesauce:main Nov 19, 2025
21 checks passed
@ericwb ericwb deleted the suggest_on_error branch November 19, 2025 02:08
formatter_class=argparse.RawDescriptionHelpFormatter,
)
if sys.version_info >= (3, 14):
parser.suggest_on_error = True
Copy link
Contributor

@qheck qheck Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. How does this work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants