Skip to content

Latest commit

 

History

History
62 lines (45 loc) · 1.64 KB

File metadata and controls

62 lines (45 loc) · 1.64 KB
title attr deprecated
categories core
version 0.109.0
core Attribute for marking a command or flag as deprecated.
usage Attribute for marking a command or flag as deprecated.
editLink false
contributors false

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