From 42b6425098a42a8a1e6b5aeff1016b29d6e5819d Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Wed, 12 Oct 2022 17:00:27 +0200 Subject: [PATCH] docs: add missing options The new cobra update fixed a bug which caused some options to not be included in --help when there was already a option with the same name on a parent command. Signed-off-by: Paul Holzinger --- cmd/podman/pods/ps.go | 4 +++- docs/source/markdown/podman-build.1.md.in | 18 ++++++++++++++++++ docs/source/markdown/podman-pod-ps.1.md | 8 ++++---- test/e2e/ps_test.go | 2 +- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/cmd/podman/pods/ps.go b/cmd/podman/pods/ps.go index 681c9c42e0..cea2250332 100644 --- a/cmd/podman/pods/ps.go +++ b/cmd/podman/pods/ps.go @@ -13,6 +13,7 @@ import ( "github.com/containers/common/pkg/report" "github.com/containers/podman/v4/cmd/podman/common" "github.com/containers/podman/v4/cmd/podman/registry" + "github.com/containers/podman/v4/cmd/podman/utils" "github.com/containers/podman/v4/cmd/podman/validate" "github.com/containers/podman/v4/pkg/domain/entities" "github.com/docker/go-units" @@ -59,7 +60,6 @@ func init() { _ = psCmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(&ListPodReporter{})) flags.Bool("noheading", false, "Do not print headers") - flags.BoolVar(&psInput.Namespace, "namespace", false, "Display namespace information of the pod") flags.BoolVar(&psInput.Namespace, "ns", false, "Display namespace information of the pod") flags.BoolVar(&noTrunc, "no-trunc", false, "Do not truncate pod and container IDs") flags.BoolVarP(&psInput.Quiet, "quiet", "q", false, "Print the numeric IDs of the pods only") @@ -69,6 +69,8 @@ func init() { _ = psCmd.RegisterFlagCompletionFunc(sortFlagName, common.AutocompletePodPsSort) validate.AddLatestFlag(psCmd, &psInput.Latest) + + flags.SetNormalizeFunc(utils.AliasFlags) } func pods(cmd *cobra.Command, _ []string) error { diff --git a/docs/source/markdown/podman-build.1.md.in b/docs/source/markdown/podman-build.1.md.in index e1ef13a0da..6343188fb3 100644 --- a/docs/source/markdown/podman-build.1.md.in +++ b/docs/source/markdown/podman-build.1.md.in @@ -292,6 +292,18 @@ transports. Print usage statement +#### **--hooks-dir**=*path* + +Each *.json file in the path configures a hook for buildah build containers. For more details on the syntax of the JSON files and the semantics of hook injection. Buildah currently support both the 1.0.0 and 0.1.0 hook schemas, although the 0.1.0 schema is deprecated. + +This option may be set multiple times; paths from later options have higher precedence. + +For the annotation conditions, buildah uses any annotations set in the generated OCI configuration. + +For the bind-mount conditions, only mounts explicitly requested by the caller via --volume are considered. Bind mounts that buildah inserts by default (e.g. /dev/shm) are not considered. + +If --hooks-dir is unset for root callers, Buildah will currently default to /usr/share/containers/oci/hooks.d and /etc/containers/oci/hooks.d in order of increasing precedence. Using these defaults is deprecated, and callers should migrate to explicitly setting --hooks-dir. + #### **--http-proxy** Pass through HTTP Proxy environment variables. @@ -532,6 +544,12 @@ commands specified by the **RUN** instruction. Note: You can also override the default runtime by setting the BUILDAH\_RUNTIME environment variable. `export BUILDAH_RUNTIME=/usr/local/bin/runc` +#### **--runtime-flag**=*flag* + +Adds global flags for the container rutime. To list the supported flags, please consult the manpages of the selected container runtime. + +Note: Do not pass the leading -- to the flag. To pass the runc flag --log-format json to buildah build, the option given would be --runtime-flag log-format=json. + #### **--secret**=**id=id,src=path** Pass secret information to be used in the Containerfile for building images diff --git a/docs/source/markdown/podman-pod-ps.1.md b/docs/source/markdown/podman-pod-ps.1.md index ae249ecf00..d7cd79db2e 100644 --- a/docs/source/markdown/podman-pod-ps.1.md +++ b/docs/source/markdown/podman-pod-ps.1.md @@ -97,6 +97,10 @@ Print usage statement Show the latest pod created (all states) (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines) +#### **--namespace**, **--ns** + +Display namespace information of the pod + #### **--no-trunc** Do not truncate the output (default *false*). @@ -105,10 +109,6 @@ Do not truncate the output (default *false*). Omit the table headings from the listing of pods. -#### **--ns** - -Display namespace information of the pod - #### **--quiet**, **-q** Print the numeric IDs of the pods only diff --git a/test/e2e/ps_test.go b/test/e2e/ps_test.go index cc037545c1..bf5a0dfda3 100644 --- a/test/e2e/ps_test.go +++ b/test/e2e/ps_test.go @@ -226,7 +226,7 @@ var _ = Describe("Podman ps", func() { session := podmanTest.RunTopContainer("test1") session.WaitWithDefaultTimeout() - result := podmanTest.Podman([]string{"ps", "-a", "--namespace", "--format", + result := podmanTest.Podman([]string{"ps", "-a", "--ns", "--format", "{{with .Namespaces}}{{.Cgroup}}:{{.IPC}}:{{.MNT}}:{{.NET}}:{{.PIDNS}}:{{.User}}:{{.UTS}}{{end}}"}) result.WaitWithDefaultTimeout() Expect(result).Should(Exit(0))