Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ foreach section, pages: manuals
)
endforeach
endforeach

install_data(
'toolbox-ls.1',
install_dir: get_option('mandir') / 'man1',
)
2 changes: 2 additions & 0 deletions doc/toolbox-list.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ toolbox\-list - List existing Toolbx containers and images
## SYNOPSIS
**toolbox list** [*--containers* | *-c*] [*--images* | *-i*]

**toolbox ls** [*--containers* | *-c*] [*--images* | *-i*]

## DESCRIPTION

Lists existing Toolbx containers and images. These are OCI containers and
Expand Down
1 change: 1 addition & 0 deletions doc/toolbox-ls.1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.so man1/toolbox-list.1
3 changes: 2 additions & 1 deletion doc/toolbox.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ Initialize a running container.

**toolbox-list(1)**

List existing Toolbx containers and images.
List existing Toolbx containers and images. Can also be invoked as
`toolbox ls`.

**toolbox-rm(1)**

Expand Down
1 change: 1 addition & 0 deletions src/cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var (

var listCmd = &cobra.Command{
Use: "list",
Aliases: []string{"ls"},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ls alias is not expected to show up in the shell completion, right? ie., toolbox l<TAB><TAB> will result in toolbox list . If so, then perfect, because it would be slightly annoying to choose between list and ls.

I am always nervous when looking at the shell completions because of the complex machinery involved.

@NewtonChutney NewtonChutney Sep 5, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, let me test and confirm. And if ls does show up, if it is similar to how podman image ls is an auto completion, it shouldn't be an issue?
And I think I corrected my authorship? Lemme verify

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can make out, podman image l<TAB><TAB> includes only list, not ls.

@NewtonChutney NewtonChutney Sep 5, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh.. Okay then

So, it's with other tools and short flags that there's a shortcut

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed with the updated binary: toolbox __complete l offers only list, not ls. Once the alias is typed, toolbox __complete ls --c correctly offers --containers. So the alias does not add a duplicate top-level completion choice.

Short: "List existing Toolbx containers and images",
RunE: list,
ValidArgsFunction: completionEmpty,
Expand Down
22 changes: 22 additions & 0 deletions test/system/002-help.bats
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,28 @@ teardown_file() {
assert [ ${#stderr_lines[@]} -eq 2 ]
}

@test "help: Try 'list' with unknown flag (using the 'ls' alias)" {
run --keep-empty-lines --separate-stderr "$TOOLBX" ls --foo

assert_failure
assert [ ${#lines[@]} -eq 0 ]
lines=("${stderr_lines[@]}")
assert_line --index 0 "Error: unknown flag: --foo"
assert_line --index 1 "Run 'toolbox --help' for usage."
assert [ ${#stderr_lines[@]} -eq 2 ]
}

@test "help: Try 'list' with unknown flag (using the 'ls' alias, forwarded to host)" {
run -1 --keep-empty-lines --separate-stderr "$TOOLBX" run toolbox ls --foo

assert_failure
assert [ ${#lines[@]} -eq 0 ]
lines=("${stderr_lines[@]}")
assert_line --index 0 "Error: unknown flag: --foo"
assert_line --index 1 "Run 'toolbox --help' for usage."
assert [ ${#stderr_lines[@]} -eq 2 ]
}

@test "help: Try 'rm' with unknown flag" {
run --keep-empty-lines --separate-stderr "$TOOLBX" rm --foo

Expand Down
8 changes: 8 additions & 0 deletions test/system/102-list.bats
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ teardown() {
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "list: Smoke test (using the 'ls' alias)" {
run --keep-empty-lines --separate-stderr "$TOOLBX" ls

assert_success
assert [ ${#lines[@]} -eq 0 ]
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "list: Smoke test (using --containers)" {
run --keep-empty-lines --separate-stderr "$TOOLBX" list --containers

Expand Down