Skip to content

Commit

Permalink
Improve the documentation of boolean flags
Browse files Browse the repository at this point in the history
The Go behavior of boolean flags is as follows:

Accepted values are --flag, which is the same as --flag=true, and --flag=false,
which is the default (except for OptionalBoolFlag).
--flag {false,true} is parsed as --flag=true with a non-option {false,true} argument.

So, for almost all flags, document them just as --flag, not
mentioning the [={false,true}] part, because users can just
omit =true, or the whole flag instead of =false.

OTOH, for tls-verify, document only the tls-verify={true,false}
variant, because the primary use is tls-verify=false, and because
tls-verify is not "the default", but equivalent to an explicit
tls-verify=true (overriding registries.conf).

Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac committed Feb 1, 2022
1 parent 8fb4551 commit 004519f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions docs/skopeo-copy.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ Key to be used for decryption of images. Key can point to keys and/or certificat

Credentials for accessing the source registry.

**--dest-compress** _bool-value_
**--dest-compress**

Compress tarball image layers when saving to directory using the 'dir' transport. (default is same compression type as source).

**--dest-decompress** _bool-value_
**--dest-decompress**

Decompress tarball image layers when saving to directory using the 'dir' transport. (default is same compression type as source).

**--dest-oci-accept-uncompressed-layers** _bool-value_
**--dest-oci-accept-uncompressed-layers**

Allow uncompressed image layers when saving to an OCI image using the 'oci' transport. (default is to compress things that aren't compressed).

Expand All @@ -133,23 +133,23 @@ Credentials for accessing the destination registry.

Use certificates at _path_ (*.crt, *.cert, *.key) to connect to the source registry or daemon.

**--src-no-creds** _bool-value_
**--src-no-creds**

Access the registry anonymously.

**--src-tls-verify** _bool-value_
**--src-tls-verify**=_bool_

Require HTTPS and verify certificates when talking to container source registry or daemon. Default to source registry setting.

**--dest-cert-dir** _path_

Use certificates at _path_ (*.crt, *.cert, *.key) to connect to the destination registry or daemon.

**--dest-no-creds** _bool-value_
**--dest-no-creds**

Access the registry anonymously.

**--dest-tls-verify** _bool-value_
**--dest-tls-verify**=_bool_

Require HTTPS and verify certificates when talking to container destination registry or daemon. Default to destination registry setting.

Expand Down Expand Up @@ -179,7 +179,7 @@ Bearer token for accessing the source registry.

Bearer token for accessing the destination registry.

**--dest-precompute-digests** _bool-value_
**--dest-precompute-digests**

Precompute digests to ensure layers are not uploaded that already exist on the destination registry. Layers with initially unknown digests (ex. compressing "on the fly") will be temporarily streamed to disk.

Expand Down
2 changes: 1 addition & 1 deletion docs/skopeo-delete.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Use docker daemon host at _host_ (`docker-daemon:` transport only)

Print usage statement

**--no-creds** _bool-value_
**--no-creds**

Access the registry anonymously.

Expand Down
2 changes: 1 addition & 1 deletion docs/skopeo-inspect.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ The username to access the registry.

The password to access the registry.

**--no-tags**, **-n**=_bool_
**--no-tags**, **-n**

Do not list the available tags from the repository in the output. When `true`, the `RepoTags` array will be empty. Defaults to `false`, which includes all available tags.

Expand Down
2 changes: 1 addition & 1 deletion docs/skopeo-list-tags.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Use certificates at _path_ (\*.crt, \*.cert, \*.key) to connect to the registry.

Print usage statement

**--no-creds** _bool-value_
**--no-creds**

Access the registry anonymously.

Expand Down
8 changes: 4 additions & 4 deletions docs/skopeo-sync.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ Print usage statement.

**--src-cert-dir** _path_ Use certificates (*.crt, *.cert, *.key) at _path_ to connect to the source registry or daemon.

**--src-no-creds** _bool-value_ Access the registry anonymously.
**--src-no-creds** Access the registry anonymously.

**--src-tls-verify** _bool-value_ Require HTTPS and verify certificates when talking to a container source registry or daemon. Default to source registry entry in registry.conf setting.
**--src-tls-verify**=_bool_ Require HTTPS and verify certificates when talking to a container source registry or daemon. Default to source registry entry in registry.conf setting.

**--dest-cert-dir** _path_ Use certificates (*.crt, *.cert, *.key) at _path_ to connect to the destination registry or daemon.

**--dest-no-creds** _bool-value_ Access the registry anonymously.
**--dest-no-creds** Access the registry anonymously.

**--dest-tls-verify** _bool-value_ Require HTTPS and verify certificates when talking to a container destination registry or daemon. Default to destination registry entry in registry.conf setting.
**--dest-tls-verify**=_bool_ Require HTTPS and verify certificates when talking to a container destination registry or daemon. Default to destination registry entry in registry.conf setting.

**--src-registry-token** _Bearer token_ for accessing the source registry.

Expand Down

0 comments on commit 004519f

Please sign in to comment.