cmd/list, doc, test/system: Add 'ls' as an alias for 'list' - #1837
Open
NewtonChutney wants to merge 1 commit into
Open
cmd/list, doc, test/system: Add 'ls' as an alias for 'list'#1837NewtonChutney wants to merge 1 commit into
NewtonChutney wants to merge 1 commit into
Conversation
NewtonChutney
added a commit
to NewtonChutney/toolbox
that referenced
this pull request
Aug 24, 2026
Many users are used to typing 'ls' from everyday Unix usage and expect it to work as a shorthand for listing things. Add 'ls' as an alias for the 'toolbox list' command, using Cobra's built-in Aliases mechanism so that flags, shell completion and error handling all keep working exactly as they do for 'list'. Fixes: containers#1836 containers#1837
NewtonChutney
force-pushed
the
ls-alias-for-list
branch
from
August 24, 2026 10:33
654b65f to
9676560
Compare
Many users are used to typing 'ls' from everyday Unix usage and expect it to work as a shorthand for listing things. Add 'ls' as an alias for the 'toolbox list' command, using Cobra's built-in Aliases mechanism so that flags, shell completion and error handling all keep working exactly as they do for 'list'. Fixes: containers#1836 containers#1837
NewtonChutney
force-pushed
the
ls-alias-for-list
branch
from
August 24, 2026 11:43
9676560 to
e605b0e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
lsas an alias for thetoolbox listcommand, since many usersreach for
lsout of habit from everyday Unix usage.src/cmd/list.go: addlstolistCmd.Aliases(Cobra's built-inalias mechanism), so flags (
--containers/-c,--images/-i),error handling and shell completion (
GenBashCompletionV2,GenFishCompletion,GenZshCompletion) all keep working exactly asthey do for
list, with no other code changes needed.doc/toolbox-list.1.md,doc/toolbox.1.md: document the alias.test/system/102-list.bats,test/system/002-help.bats: add smokeand unknown-flag tests for
toolbox ls, mirroring existinglisttests.
Fixes #1836