Skip to content

v4.15.0

Choose a tag to compare

@BrianPugh BrianPugh released this 21 May 12:23

Features

  • AddedApp.synonym, which declares alternate command name(s) that trigger a "Did you mean..." suggestion without registering the command under those names. Useful when a user types a semantically-equivalent word (e.g. remove vs uninstall) that the built-in fuzzy matcher would miss because the words aren't spelled similarly. Accepts a single str or an iterable of strings. Synonyms are not runnable and are hidden from --help.
    @app.command(synonym=["remove", "rm"])
    def uninstall(name: str): ...
    $ my-script remove mypackage
    Unknown command "remove". Did you mean "uninstall"? Available commands: uninstall.
    If multiple commands declare the same synonym, all matching commands are suggested (Did you mean "uninstall" or "purge"?).
    By @BrianPugh in #815

Full Changelog: v4.14.1...v4.15.0