Skip to content

cmd/list, doc, test/system: Add 'ls' as an alias for 'list' - #1837

Open
NewtonChutney wants to merge 1 commit into
containers:mainfrom
NewtonChutney:ls-alias-for-list
Open

cmd/list, doc, test/system: Add 'ls' as an alias for 'list'#1837
NewtonChutney wants to merge 1 commit into
containers:mainfrom
NewtonChutney:ls-alias-for-list

Conversation

@NewtonChutney

Copy link
Copy Markdown

Summary

Adds ls as an alias for the toolbox list command, since many users
reach for ls out of habit from everyday Unix usage.

  • src/cmd/list.go: add ls to listCmd.Aliases (Cobra's built-in
    alias mechanism), so flags (--containers/-c, --images/-i),
    error handling and shell completion (GenBashCompletionV2,
    GenFishCompletion, GenZshCompletion) all keep working exactly as
    they 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 smoke
    and unknown-flag tests for toolbox ls, mirroring existing list
    tests.

Fixes #1836

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
@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed.
https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/local/buildset/cd5805043fc34acc8ebe02bb787783cd

✔️ unit-test SUCCESS in 2m 14s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 11s
✔️ unit-test-restricted SUCCESS in 2m 21s
✔️ system-test-fedora-rawhide-commands-options SUCCESS in 42m 07s
✔️ system-test-fedora-rawhide-runtime-environment-arch-fedora SUCCESS in 30m 18s
✔️ system-test-fedora-rawhide-runtime-environment-ubuntu SUCCESS in 8m 21s
✔️ system-test-fedora-44-commands-options SUCCESS in 38m 03s
✔️ system-test-fedora-44-runtime-environment-arch-fedora SUCCESS in 28m 41s
✔️ system-test-fedora-44-runtime-environment-ubuntu SUCCESS in 8m 03s
✔️ system-test-fedora-43-commands-options SUCCESS in 35m 38s
✔️ system-test-fedora-43-runtime-environment-arch-fedora SUCCESS in 26m 52s
✔️ system-test-fedora-43-runtime-environment-ubuntu SUCCESS in 7m 20s
✔️ system-test-fedora-42-commands-options SUCCESS in 32m 39s
✔️ system-test-fedora-42-runtime-environment-arch-fedora SUCCESS in 23m 21s
✔️ system-test-fedora-42-runtime-environment-ubuntu SUCCESS in 6m 20s
system-test-fedora-coreos-next-commands-options NODE_FAILURE Node(set) request 200-0000179611 failed in 0s
system-test-fedora-coreos-next-runtime-environment-arch-fedora NODE_FAILURE Node(set) request 200-0000179612 failed in 0s
system-test-fedora-coreos-next-runtime-environment-ubuntu NODE_FAILURE Node(set) request 200-0000179613 failed in 0s
✔️ system-test-fedora-coreos-stable-commands-options SUCCESS in 38m 08s
✔️ system-test-fedora-coreos-stable-runtime-environment-arch-fedora SUCCESS in 29m 38s
✔️ system-test-fedora-coreos-stable-runtime-environment-ubuntu SUCCESS in 8m 30s
system-test-fedora-coreos-testing-commands-options NODE_FAILURE Node(set) request 200-0000179617 failed in 0s
system-test-fedora-coreos-testing-runtime-environment-arch-fedora NODE_FAILURE Node(set) request 200-0000179618 failed in 0s
system-test-fedora-coreos-testing-runtime-environment-ubuntu NODE_FAILURE Node(set) request 200-0000179619 failed in 0s

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
@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed.
https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/local/buildset/ec222ddce12c47a69cc70366d15a8c5a

✔️ unit-test SUCCESS in 2m 26s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 18s
✔️ unit-test-restricted SUCCESS in 2m 12s
✔️ system-test-fedora-rawhide-commands-options SUCCESS in 48m 25s
✔️ system-test-fedora-rawhide-runtime-environment-arch-fedora SUCCESS in 36m 12s
✔️ system-test-fedora-rawhide-runtime-environment-ubuntu SUCCESS in 8m 21s
✔️ system-test-fedora-44-commands-options SUCCESS in 43m 24s
✔️ system-test-fedora-44-runtime-environment-arch-fedora SUCCESS in 35m 37s
✔️ system-test-fedora-44-runtime-environment-ubuntu SUCCESS in 7m 42s
✔️ system-test-fedora-43-commands-options SUCCESS in 45m 49s
✔️ system-test-fedora-43-runtime-environment-arch-fedora SUCCESS in 32m 21s
✔️ system-test-fedora-43-runtime-environment-ubuntu SUCCESS in 7m 44s
✔️ system-test-fedora-42-commands-options SUCCESS in 37m 17s
✔️ system-test-fedora-42-runtime-environment-arch-fedora SUCCESS in 32m 21s
✔️ system-test-fedora-42-runtime-environment-ubuntu SUCCESS in 7m 06s
system-test-fedora-coreos-next-commands-options NODE_FAILURE Node(set) request 200-0000179739 failed in 0s
system-test-fedora-coreos-next-runtime-environment-arch-fedora NODE_FAILURE Node(set) request 200-0000179740 failed in 0s
system-test-fedora-coreos-next-runtime-environment-ubuntu NODE_FAILURE Node(set) request 200-0000179741 failed in 0s
✔️ system-test-fedora-coreos-stable-commands-options SUCCESS in 48m 53s
✔️ system-test-fedora-coreos-stable-runtime-environment-arch-fedora SUCCESS in 40m 26s
✔️ system-test-fedora-coreos-stable-runtime-environment-ubuntu SUCCESS in 12m 54s
system-test-fedora-coreos-testing-commands-options NODE_FAILURE Node(set) request 200-0000179745 failed in 0s
system-test-fedora-coreos-testing-runtime-environment-arch-fedora NODE_FAILURE Node(set) request 200-0000179746 failed in 0s
system-test-fedora-coreos-testing-runtime-environment-ubuntu NODE_FAILURE Node(set) request 200-0000179747 failed in 0s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ls as an alias of list

1 participant