Skip to content

Only print warning once

Ash McKenzie requested to merge ashmckenzie/did-you-mean-tidy-up into main

What does this merge request do and why?

This MR aims to improve the user messaging by not printing the warning message more than once when the user makes a mistake when a command is not found:

Before

$ gdk rstart
⚠️  WARNING: rstart is not a GDK command.
⚠️  WARNING: Did you mean?  restart
⚠️  WARNING:                start

ℹ️  See 'gdk help' for more detail.

After

$ gdk rstart
⚠️  WARNING: rstart is not a GDK command, did you mean - 'gdk restart' or 'gdk start'?

ℹ️  See 'gdk help' for more detail.

How to set up and validate locally

  1. Using the main branch for a GDK checkout, run gdk rstart and observe:

    $ gdk rstart
    ⚠️  WARNING: rstart is not a GDK command.
    ⚠️  WARNING: Did you mean?  restart
    ⚠️  WARNING:                start
    
    ℹ️  See 'gdk help' for more detail.
  2. Using the ashmckenzie/did-you-mean-tidy-up branch, run gdk rstart and observe:

    $ gdk rstart
    ⚠️  WARNING: rstart is not a GDK command, did you mean - 'gdk restart' or 'gdk start'?
    
    ℹ️  See 'gdk help' for more detail.

Impacted categories

The following categories relate to this merge request:

Merge request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise an issue to follow-up.
  • Documentation added/updated, if needed.
  • gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.

Merge request reports

Loading