mirror of
https://github.com/containers/skopeo.git
synced 2025-08-13 04:09:40 +00:00
Don't offer the tarball: transport in completions
... per #2338 . Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
658c16afa3
commit
6d813c8ddf
@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/containers/image/v5/tarball"
|
||||||
"github.com/containers/image/v5/transports"
|
"github.com/containers/image/v5/transports"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@ -10,7 +11,12 @@ func autocompleteSupportedTransports(cmd *cobra.Command, args []string, toComple
|
|||||||
tps := transports.ListNames()
|
tps := transports.ListNames()
|
||||||
suggestions := make([]string, 0, len(tps))
|
suggestions := make([]string, 0, len(tps))
|
||||||
for _, tp := range tps {
|
for _, tp := range tps {
|
||||||
suggestions = append(suggestions, tp+":")
|
// ListNames is generally expected to filter out deprecated transports.
|
||||||
|
// tarball: is not deprecated, but it is only usable from a Go caller (using tarball.ConfigUpdater),
|
||||||
|
// so don’t offer it on the CLI.
|
||||||
|
if tp != tarball.Transport.Name() {
|
||||||
|
suggestions = append(suggestions, tp+":")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return suggestions, cobra.ShellCompDirectiveNoFileComp
|
return suggestions, cobra.ShellCompDirectiveNoFileComp
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user