Skip to main content

COMMAND LIST

Syntax

COMMAND LIST [FILTERBY <ACLCAT category | PATTERN pattern | MODULE module>]

Module

admin

Categories

admin slow

Description

Get the list of command names. Allows for filtering by ACL category or glob pattern.

Options

FILTERBY - An optional condition used to filter the response. ACLCAT filters by the provided acl category string. PATTERN filters the response by the provided glob pattern. MODULE filters the response by the provided SugarDB module.

Examples

Get a list of all the loaded commands:

db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
commands, err := db.CommandList(sugardb.CommandListOptions{})

Get a list of all commands with the "fast" ACL category:

db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
commands, err := db.CommandList(sugardb.CommandListOptions{ACLCAT: "fast"})

Get a list of all commands which satisfy the "z*" glob pattern:

db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
commands, err := db.CommandList(sugardb.CommandListOptions{PATTERN: "z*"})

Get a list of all the commands in the "set" module:

db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
commands, err := db.CommandList(sugardb.CommandListOptions{MODULE: "set"})