Skip to main content
Skip to main content

AG002: Usage Entry Missing Description

PropertyValue
CodeAG002
SeverityError
Sincev0.1.0

Description

Every non-separator entry in the usage=() array must have a description string. The description is rendered in the command's --help output. An entry that is not a group separator but lacks a description is an error.

Example

This triggers AG002:

main() {
local -a usage=(
"deploy" # missing description
"status" "Show current status"
)
:usage "My CLI" "${@}"
}

How to Fix

Add a description string after each command name:

main() {
local -a usage=(
"deploy" "Deploy the application"
"status" "Show current status"
)
:usage "My CLI" "${@}"
}

How to Suppress

# argsh disable=AG002
"deploy"

Or file-wide:

# argsh disable-file=AG002
Was this section helpful?