add `list` as an alias to list networks

this makes it consistent with other commands,
but also makes the example actually work

Signed-off-by: Evgeni Golov <evgeni@golov.de>
This commit is contained in:
Evgeni Golov 2024-04-17 14:25:25 +02:00
parent 4817811cb7
commit 7b3456b5d9
2 changed files with 3 additions and 0 deletions

View File

@ -22,6 +22,7 @@ var (
networklistDescription = `List networks`
networklistCommand = &cobra.Command{
Use: "ls [options]",
Aliases: []string{"list"},
Args: validate.NoArgs,
Short: "List networks",
Long: networklistDescription,

View File

@ -10,6 +10,8 @@ load helpers.network
heading="NETWORK *ID *NAME *DRIVER"
run_podman network ls
assert "${lines[0]}" =~ "^$heading\$" "network ls header missing"
run_podman network list
assert "${lines[0]}" =~ "^$heading\$" "network list header missing"
run_podman network ls --noheading
assert "$output" !~ "$heading" "network ls --noheading shows header anyway"