From b394fe1a87551a0ddb31d2e5b1b5ca79d289f358 Mon Sep 17 00:00:00 2001 From: goldlinker Date: Thu, 16 Oct 2025 15:25:34 +0800 Subject: [PATCH] chore: remove repetitive word in cmd/podman/README.md Signed-off-by: goldlinker --- cmd/podman/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/podman/README.md b/cmd/podman/README.md index 29b5f86430..d2fdeffbad 100644 --- a/cmd/podman/README.md +++ b/cmd/podman/README.md @@ -112,7 +112,7 @@ The complete set can be found in the `validate` package, here are some examples: ## Adding CLI flags -When adding adding a new cli option that accepts a string array, there are two options to choose from: `StringSlice()` and `StringArray()`. +When adding a new cli option that accepts a string array, there are two options to choose from: `StringSlice()` and `StringArray()`. They differ slightly in their behavior: `StringSlice()` allows the values to be comma separated so `--opt v1,v2 --opt v3` results in `[]string{"v1", "v2", "v3"}`, while `StringArray()` would result in `[]string{"v1,v2", "v3"}`. Thus it is impossible to use values with comma in `StringSlice()`, which makes it unsuitable for flags that accept arbitrary values such as file paths as example. Also, because `StringSlice()` uses the csv lib to parse the values, it has special escaping rules for things like quotes, see https://github.com/containers/podman/issues/20064 for an example of how complicated things can get because of this. Thus use `StringSlice()` only when the option accepts predefined values that do not contain special characters, for example `--cap-add` and `--cap-drop` are a good example for this. Using `--cap-add NET_ADMIN,NET_RAW` is equal to `--cap-add NET_ADMIN --cap-add NET_RAW` so it is better suited to save some typing for users.