diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-04-28 15:06:00 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2022-04-28 15:11:25 +0200 |
commit | cb9a45630f270f825f2285541aefbf5ded37cdae (patch) | |
tree | 92eedf8b439cfe0a24a530d1725e5050dedba142 /cmd/podman/common/completion_test.go | |
parent | 8be97815865ccf265923e50fe66d7739200ec20d (diff) | |
download | podman-cb9a45630f270f825f2285541aefbf5ded37cdae.tar.gz podman-cb9a45630f270f825f2285541aefbf5ded37cdae.tar.bz2 podman-cb9a45630f270f825f2285541aefbf5ded37cdae.zip |
shell completion --format: use anonymous struct field once
We should not include the anonymous twice in the suggestions.
one example is `podman network ls --format {{.` it will also show
`{{.Network` but since Network is the actual struct all fields are
already shown so there is no need for it to be suggested.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'cmd/podman/common/completion_test.go')
-rw-r--r-- | cmd/podman/common/completion_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/podman/common/completion_test.go b/cmd/podman/common/completion_test.go index bfff9a96e..ae117a173 100644 --- a/cmd/podman/common/completion_test.go +++ b/cmd/podman/common/completion_test.go @@ -79,12 +79,12 @@ func TestAutocompleteFormat(t *testing.T) { { "fist level struct field name", "{{.", - []string{"{{.Name}}", "{{.Age}}", "{{.Car.", "{{.Car2.", "{{.Anonymous.", "{{.Hello}}"}, + []string{"{{.Name}}", "{{.Age}}", "{{.Car.", "{{.Car2.", "{{.Hello}}"}, }, { "fist level struct field name", "{{ .", - []string{"{{ .Name}}", "{{ .Age}}", "{{ .Car.", "{{ .Car2.", "{{ .Anonymous.", "{{ .Hello}}"}, + []string{"{{ .Name}}", "{{ .Age}}", "{{ .Car.", "{{ .Car2.", "{{ .Hello}}"}, }, { "fist level struct field name", |