cmd/podman/common/completion.go: fix FIXMEs

There is no good way to recommend labels for podman container runlabel.

Add the missing max-size log option. These are the only documented
options so the completion should not suggest something different.

Add proper --stop-signal completion. It will now complete all supported
signal names both upper and lowercase depending on the user input. Also
it work with and without the SIG prefix.

Fixing the TODOs in this file are more complicated since they describe
bigger features.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2022-05-23 19:37:13 +02:00
parent 7391bdfbbc
commit 70f147d019
6 changed files with 39 additions and 20 deletions

View File

@ -16,12 +16,12 @@ const (
SIGWINCH = syscall.SIGWINCH
)
// signalMap is a map of Linux signals.
// SignalMap is a map of Linux signals.
// These constants are sourced from the Linux version of golang.org/x/sys/unix
// (I don't see much risk of this changing).
// This should work as long as Podman only runs containers on Linux, which seems
// a safe assumption for now.
var signalMap = map[string]syscall.Signal{
var SignalMap = map[string]syscall.Signal{
"ABRT": syscall.Signal(0x6),
"ALRM": syscall.Signal(0xe),
"BUS": syscall.Signal(0x7),