Skip to content

Commit 1f0ef58

Browse files
committed
cli/docs: Expand and clean up clap doctext a bit
It seems like in clap one can document both the verb and the option structure. Change things to consistently document the verbs, and expand the text. Signed-off-by: Colin Walters <[email protected]>
1 parent 508f8c4 commit 1f0ef58

File tree

8 files changed

+67
-21
lines changed

8 files changed

+67
-21
lines changed

docs/src/man/bootc-container-lint.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ checks as part of a container build
1010
# DESCRIPTION
1111

1212
Perform relatively inexpensive static analysis checks as part of a
13-
container build
13+
container build.
14+
15+
This is intended to be invoked via e.g. \`RUN bootc container lint\` as
16+
part of a build process; it will error if any problems are detected.
1417

1518
# OPTIONS
1619

1720
**-h**, **\--help**
1821

19-
: Print help
22+
: Print help (see a summary with -h)
2023

2124
# VERSION
2225

docs/src/man/bootc-install-to-disk.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,16 @@ bootc-install-to-disk - Install to the target block device
1414

1515
# DESCRIPTION
1616

17-
Install to the target block device
17+
Install to the target block device.
18+
19+
This command must be invoked inside of the container, which will be
20+
installed. The container must be run in \`\--privileged\` mode, and
21+
hence will be able to see all block devices on the system.
22+
23+
The default storage layout uses the root filesystem type configured in
24+
the container image, alongside any required system partitions such as
25+
the EFI system partition. Use \`install to-filesystem\` for anything
26+
more complex such as RAID, LVM, LUKS etc.
1827

1928
# OPTIONS
2029

@@ -58,7 +67,8 @@ previous paragraph. See skopeo(1) for accepted formats.
5867

5968
**\--target-transport**=*TARGET_TRANSPORT* \[default: registry\]
6069

61-
: The transport; e.g. oci, oci-archive, containers-storage. Defaults to \`registry\`
70+
: The transport; e.g. oci, oci-archive, containers-storage. Defaults
71+
to \`registry\`
6272

6373
**\--target-imgref**=*TARGET_IMGREF*
6474

docs/src/man/bootc-install-to-existing-root.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# NAME
22

3-
bootc-install-to-existing-root - Perform an installation to the host
4-
root filesystem
3+
bootc-install-to-existing-root - Install to the host root filesystem
54

65
# SYNOPSIS
76

@@ -16,7 +15,13 @@ root filesystem
1615

1716
# DESCRIPTION
1817

19-
Perform an installation to the host root filesystem
18+
Install to the host root filesystem.
19+
20+
This is a variant of \`install to-filesystem\` that is designed to
21+
install \"alongside\" the running host root filesystem. Currently, the
22+
host root filesystems \`/boot\` partition will be wiped, but the content
23+
of the existing root will otherwise be retained, and will need to be
24+
cleaned up if desired when rebooted into the new root.
2025

2126
# OPTIONS
2227

@@ -48,7 +53,8 @@ previous paragraph. See skopeo(1) for accepted formats.
4853

4954
**\--target-transport**=*TARGET_TRANSPORT* \[default: registry\]
5055

51-
: The transport; e.g. oci, oci-archive, containers-storage. Defaults to \`registry\`
56+
: The transport; e.g. oci, oci-archive, containers-storage. Defaults
57+
to \`registry\`
5258

5359
**\--target-imgref**=*TARGET_IMGREF*
5460

docs/src/man/bootc-install-to-filesystem.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# NAME
22

3-
bootc-install-to-filesystem - Install to the target filesystem
3+
bootc-install-to-filesystem - Install to an externally created
4+
filesystem structure
45

56
# SYNOPSIS
67

@@ -16,7 +17,12 @@ bootc-install-to-filesystem - Install to the target filesystem
1617

1718
# DESCRIPTION
1819

19-
Install to the target filesystem
20+
Install to an externally created filesystem structure.
21+
22+
In this variant of installation, the root filesystem alongside any
23+
necessary platform partitions (such as the EFI system partition) are
24+
prepared and mounted by an external tool or script. The root filesystem
25+
is currently expected to be empty by default.
2026

2127
# OPTIONS
2228

@@ -75,7 +81,8 @@ previous paragraph. See skopeo(1) for accepted formats.
7581

7682
**\--target-transport**=*TARGET_TRANSPORT* \[default: registry\]
7783

78-
: The transport; e.g. oci, oci-archive, containers-storage. Defaults to \`registry\`
84+
: The transport; e.g. oci, oci-archive, containers-storage. Defaults
85+
to \`registry\`
7986

8087
**\--target-imgref**=*TARGET_IMGREF*
8188

docs/src/man/bootc-install.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ bootc-install-to-disk(8)
4242

4343
bootc-install-to-filesystem(8)
4444

45-
: Install to the target filesystem
45+
: Install to an externally created filesystem structure
4646

4747
bootc-install-to-existing-root(8)
4848

49-
: Perform an installation to the host root filesystem
49+
: Install to the host root filesystem
5050

5151
bootc-install-print-configuration(8)
5252

docs/src/man/bootc-switch.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ updates via container image tags; for example,
3232

3333
**\--transport**=*TRANSPORT* \[default: registry\]
3434

35-
: The transport; e.g. oci, oci-archive, containers-storage. Defaults to \`registry\`
35+
: The transport; e.g. oci, oci-archive, containers-storage. Defaults
36+
to \`registry\`
3637

3738
**\--enforce-container-sigpolicy**
3839

lib/src/cli.rs

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,37 @@ pub(crate) struct StatusOpts {
118118
pub(crate) booted: bool,
119119
}
120120

121-
/// Options for internal testing
122121
#[cfg(feature = "install")]
123122
#[derive(Debug, clap::Subcommand, PartialEq, Eq)]
124123
pub(crate) enum InstallOpts {
125-
/// Install to the target block device
124+
/// Install to the target block device.
125+
///
126+
/// This command must be invoked inside of the container, which will be
127+
/// installed. The container must be run in `--privileged` mode, and hence
128+
/// will be able to see all block devices on the system.
129+
///
130+
/// The default storage layout uses the root filesystem type configured
131+
/// in the container image, alongside any required system partitions such as
132+
/// the EFI system partition. Use `install to-filesystem` for anything more
133+
/// complex such as RAID, LVM, LUKS etc.
126134
ToDisk(crate::install::InstallToDiskOpts),
127-
/// Install to the target filesystem
135+
/// Install to an externally created filesystem structure.
136+
///
137+
/// In this variant of installation, the root filesystem alongside any necessary
138+
/// platform partitions (such as the EFI system partition) are prepared and mounted by an
139+
/// external tool or script. The root filesystem is currently expected to be empty
140+
/// by default.
128141
ToFilesystem(crate::install::InstallToFilesystemOpts),
142+
/// Install to the host root filesystem.
143+
///
144+
/// This is a variant of `install to-filesystem` that is designed to install "alongside"
145+
/// the running host root filesystem. Currently, the host root filesystem's `/boot` partition
146+
/// will be wiped, but the content of the existing root will otherwise be retained, and will
147+
/// need to be cleaned up if desired when rebooted into the new root.
129148
ToExistingRoot(crate::install::InstallToExistingRootOpts),
130149
/// Output JSON to stdout that contains the merged installation configuration
131150
/// as it may be relevant to calling processes using `install to-filesystem`
132-
/// that want to honor e.g. `root-fs-type`.
151+
/// that in particular want to discover the desired root filesystem type from the container image.
133152
///
134153
/// At the current time, the only output key is `root-fs-type` which is a string-valued
135154
/// filesystem name suitable for passing to `mkfs.$type`.
@@ -149,6 +168,9 @@ pub(crate) struct ManOpts {
149168
pub(crate) enum ContainerOpts {
150169
/// Perform relatively inexpensive static analysis checks as part of a container
151170
/// build.
171+
///
172+
/// This is intended to be invoked via e.g. `RUN bootc container lint` as part
173+
/// of a build process; it will error if any problems are detected.
152174
Lint,
153175
}
154176

lib/src/install.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ pub(crate) struct InstallConfigOpts {
161161
pub(crate) generic_image: bool,
162162
}
163163

164-
/// Perform an installation to a block device.
165164
#[derive(Debug, Clone, clap::Parser, Serialize, Deserialize, PartialEq, Eq)]
166165
pub(crate) struct InstallToDiskOpts {
167166
#[clap(flatten)]
@@ -244,7 +243,6 @@ pub(crate) struct InstallTargetFilesystemOpts {
244243
pub(crate) skip_finalize: bool,
245244
}
246245

247-
/// Perform an installation to a mounted filesystem.
248246
#[derive(Debug, Clone, clap::Parser, PartialEq, Eq)]
249247
pub(crate) struct InstallToFilesystemOpts {
250248
#[clap(flatten)]
@@ -260,7 +258,6 @@ pub(crate) struct InstallToFilesystemOpts {
260258
pub(crate) config_opts: InstallConfigOpts,
261259
}
262260

263-
/// Perform an installation to the host root filesystem.
264261
#[derive(Debug, Clone, clap::Parser, PartialEq, Eq)]
265262
pub(crate) struct InstallToExistingRootOpts {
266263
/// Configure how existing data is treated.

0 commit comments

Comments
 (0)