Spec-Zone.ru › Nushell

attr deprecated for core

Attribute for marking a command or flag as deprecated.

Signature

> attr deprecated {flags} (message)

Flags

  • --flag {string}: Mark a flag as deprecated rather than the command.
  • --since, -s {string}: Denote a version when this item was deprecated.
  • --remove, -r {string}: Denote a version when this item will be removed.
  • --report {string}: How to warn about this item. One of: first (default), every

Parameters

  • message: Help message to include with deprecation warning.

Input/output types:

input output
nothing record

Examples

Add a deprecation warning to a custom command.

> @deprecated
    def outdated [] {}

Add a deprecation warning with a custom message.

> @deprecated "Use my-new-command instead."
    @category deprecated
    def my-old-command [] {}
Use my-new-command instead.

Notes

Mark a command (default) or flag/switch (--flag) as deprecated. By default, only the first usage will trigger a deprecation warning.

A help message can be included to provide more context for the deprecation, such as what to use as a replacement.

Also consider setting the category to deprecated with @category deprecated

Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/attr_deprecated.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API