-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "Did You Mean This" Extension #1536
Add "Did You Mean This" Extension #1536
Conversation
ai |
with self.command_group('ai-did-you-mean-this') as g: | ||
g.custom_command('version', 'show_extension_version') | ||
|
||
with self.command_group('ai-did-you-mean-this', is_preview=True): | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe combine them?
with self.command_group('ai-did-you-mean-this') as g: | |
g.custom_command('version', 'show_extension_version') | |
with self.command_group('ai-did-you-mean-this', is_preview=True): | |
pass | |
with self.command_group('ai-did-you-mean-this', is_preview=True) as g: | |
g.custom_command('version', 'show_extension_version') |
src/ai-did-you-mean-this/README.rst
Outdated
|
||
Improve user experience by suggesting recovery options for common CLI failures. | ||
|
||
This extension extends the default error handling behavior to include recommendations for recovery. Recommendations are based on how other users were successful after they encountered the same failure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding some instructions and usage scenarios? Like what kind of error can trigger this extension.
def should_enable_styling(): | ||
try: | ||
if sys.stdout.isatty(): | ||
return True | ||
except AttributeError: | ||
pass | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also honor the no_color setting: Azure/azure-cli#12601
New extension (in preview) which uses the Aladdin service to generate and show failure recovery recommendations on command failure. This extension makes use of the hook added to
parser.py
in CLI version2.4.0
. For more information, see this CLI PR.This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally?For new extensions: