From 0c261637f95c75cd571e4ba4ff5b12e8f0b37a4e Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Mon, 12 Aug 2019 14:12:11 +0200 Subject: [PATCH] Fix small issues in documentations of APIs - fix names of arguments & optional arguments in C<..> markers - use https for URLs where possible - fix links to other guestfs APIs - use more C<..> markers for special tests, shell commands, values of arguments, and names of fields - link to command man pages where an explicit command is mentioned - fix few incorrect documentation bits --- generator/actions_augeas.ml | 4 +- generator/actions_core.ml | 126 ++++++++++----------- generator/actions_core_deprecated.ml | 22 ++-- generator/actions_inspection.ml | 8 +- generator/actions_inspection_deprecated.ml | 10 +- generator/actions_properties.ml | 6 +- 6 files changed, 88 insertions(+), 88 deletions(-) diff --git a/generator/actions_augeas.ml b/generator/actions_augeas.ml index 3c419e2fc..bb0fe4db0 100644 --- a/generator/actions_augeas.ml +++ b/generator/actions_augeas.ml @@ -118,7 +118,7 @@ Defines a variable C whose value is the result of evaluating C. If C evaluates to an empty nodeset, a node is created, -equivalent to calling C C, C. +equivalent to calling C C, C. C will be the nodeset containing that single node. On success this returns a pair containing the @@ -146,7 +146,7 @@ matches exactly one node, the C is returned." }; ]; shortdesc = "set Augeas path to value"; longdesc = "\ -Set the value associated with C to C. +Set the value associated with C to C. In the Augeas API, it is possible to clear a node by setting the value to NULL. Due to an oversight in the libguestfs API diff --git a/generator/actions_core.ml b/generator/actions_core.ml index 7b6568b90..8443ae79e 100644 --- a/generator/actions_core.ml +++ b/generator/actions_core.ml @@ -490,12 +490,12 @@ domain is not running (unless C is true). In a future version we will try to acquire the libvirt lock on each disk. Disks must be accessible locally. This often means that adding disks -from a remote libvirt connection (see L) +from a remote libvirt connection (see L) will fail unless those disks are accessible via the same device path locally too. The optional C parameter sets the libvirt URI -(see L). If this is not set then +(see L). If this is not set then we connect to the default libvirt URI (or one set through an environment variable, see the libvirt documentation for full details). @@ -582,7 +582,7 @@ domain is not running (unless C is true). In a future version we will try to acquire the libvirt lock on each disk. Disks must be accessible locally. This often means that adding disks -from a remote libvirt connection (see L) +from a remote libvirt connection (see L) will fail unless those disks are accessible via the same device path locally too. @@ -955,7 +955,7 @@ C is the list of files from this directory. On return you get a flat list of xattr structs which must be interpreted sequentially. The first xattr struct always has a zero-length C. C in this struct is zero-length -to indicate there was an error doing C for this +to indicate there was an error doing C for this file, I is a C string which is a decimal number (the number of following attributes for this file, which could be C<\"0\">). Then after the first xattr struct are the @@ -1005,7 +1005,7 @@ list a directory contents without making many round-trips." }; shortdesc = "list the files in a directory"; longdesc = "\ List the files in F (relative to the root directory, -there is no cwd). The '.' and '..' entries are not returned, but +there is no cwd). The C<.> and C<..> entries are not returned, but hidden files are shown." }; { defaults with @@ -1271,7 +1271,7 @@ There are two common places that you might call C: In an interactive text-based program, you might call it from a C signal handler so that pressing C<^C> cancels the current -operation. (You also need to call L so that +operation. (You also need to call C so that child processes don't receive the C<^C> signal). In a graphical program, when the main thread is displaying a progress @@ -1585,7 +1585,7 @@ file types such as directories, symbolic links, block special etc." }; shortdesc = "list the files in a directory (long format)"; longdesc = "\ List the files in F (relative to the root directory, -there is no cwd) in the format of 'ls -la'. +there is no cwd) in the format of C. This command is mostly useful for interactive sessions. It is I intended that you try to parse the output string." }; @@ -2574,27 +2574,27 @@ for the C command. =item C -Compute the MD5 hash (using the C program). +Compute the MD5 hash (using the L program). =item C -Compute the SHA1 hash (using the C program). +Compute the SHA1 hash (using the L program). =item C -Compute the SHA224 hash (using the C program). +Compute the SHA224 hash (using the L program). =item C -Compute the SHA256 hash (using the C program). +Compute the SHA256 hash (using the L program). =item C -Compute the SHA384 hash (using the C program). +Compute the SHA384 hash (using the L program). =item C -Compute the SHA512 hash (using the C program). +Compute the SHA512 hash (using the L program). =back @@ -2854,7 +2854,7 @@ group (if any)." }; This wipes a physical volume C so that LVM will no longer recognise it. -The implementation uses the C command which refuses to +The implementation uses the L command which refuses to wipe physical volumes that contain any volume groups, so you have to remove those first." }; @@ -2958,7 +2958,7 @@ caveats in L. =item * -This uses C from the host. Unfortunately grub is +This uses L from the host. Unfortunately grub is not always compatible with itself, so this only works in rather narrow circumstances. Careful testing with each guest version is advisable. @@ -3054,7 +3054,7 @@ See also: C." }; This instructs the guest kernel to drop its page cache, and/or dentries and inode caches. The parameter C tells the kernel what precisely to drop, see -L +L Setting C to 3 should drop everything. @@ -3070,7 +3070,7 @@ so that the maximum guest memory is freed." }; ]; shortdesc = "return kernel messages"; longdesc = "\ -This returns the kernel messages (C output) from +This returns the kernel messages (L output) from the guest kernel. This is sometimes useful for extended debugging of problems. @@ -3682,7 +3682,7 @@ If the parameter C is a positive number, this returns the last C lines of the file C. If the parameter C is a negative number, this returns lines -from the file C, starting with the C<-nrlines>th line. +from the file C, starting with the C<-nrlines>'th line. If the parameter C is zero, this returns an empty list." }; @@ -3692,7 +3692,7 @@ If the parameter C is zero, this returns an empty list." }; test_excuse = "tricky to test because it depends on the exact format of the 'df' command and other imponderables"; shortdesc = "report file system disk space usage"; longdesc = "\ -This command runs the C command to report disk space used. +This command runs the L command to report disk space used. This command is mostly useful for interactive sessions. It is I intended that you try to parse the output string. @@ -4167,7 +4167,7 @@ for full details." }; ]; shortdesc = "return lines matching a pattern"; longdesc = "\ -This calls the external C program and returns the +This calls the external L program and returns the matching lines. The optional flags are: @@ -4190,7 +4190,7 @@ Match case-insensitive. This is the same as using the I<-i> flag. =item C -Use C instead of C. This allows the input to be +Use L instead of L. This allows the input to be compress- or gzip-compressed. =back" }; @@ -4220,7 +4220,7 @@ returned path has no C<.>, C<..> or symbolic link path elements." }; ]; shortdesc = "create a hard link"; longdesc = "\ -This command creates a hard link using the C command." }; +This command creates a hard link." }; { defaults with name = "ln_f"; added = (1, 0, 66); @@ -4235,8 +4235,8 @@ This command creates a hard link using the C command." }; ]; shortdesc = "create a hard link"; longdesc = "\ -This command creates a hard link using the C command. -The I<-f> option removes the link (C) if it exists already." }; +This command creates a hard link, removing the link C +if it exists already." }; { defaults with name = "ln_s"; added = (1, 0, 66); @@ -4623,7 +4623,7 @@ they were created. In Windows itself this would not be a problem. Bug or feature? You decide: -L +L C attempts to resolve the true case of each element in the path. It will return a resolved path if either the @@ -4744,10 +4744,10 @@ file of zeroes, use C instead." }; This command sets the timestamps of a file with nanosecond precision. -C are the last access time (atime) in secs and +C, C are the last access time (atime) in secs and nanoseconds from the epoch. -C are the last modification time (mtime) in +C, C are the last modification time (mtime) in secs and nanoseconds from the epoch. If the C<*nsecs> field contains the special value C<-1> then @@ -4890,9 +4890,9 @@ Possible values for C are: =over 4 -=item B +=item C -=item B +=item C Intel EFI / GPT partition table. @@ -4900,9 +4900,9 @@ This is recommended for >= 2 TB partitions that will be accessed from Linux and Intel-based Mac OS X. It also has limited backwards compatibility with the C format. -=item B +=item C -=item B +=item C The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and Windows. This partition type will B work @@ -4916,37 +4916,37 @@ supported include: =over 4 -=item B +=item C AIX disk labels. -=item B +=item C -=item B +=item C Amiga \"Rigid Disk Block\" format. -=item B +=item C BSD disk labels. -=item B +=item C DASD, used on IBM mainframes. -=item B +=item C MIPS/SGI volumes. -=item B +=item C Old Mac partition format. Modern Macs use C. -=item B +=item C NEC PC-98 format, common in Japan apparently. -=item B +=item C Sun disk labels. @@ -5052,20 +5052,20 @@ The fields in the returned structure are: =over 4 -=item B +=item C Partition number, counting from 1. -=item B +=item C Start of the partition I. To get sectors you have to divide by the device’s sector size, see C. -=item B +=item C End of the partition in bytes. -=item B +=item C Size of the partition in bytes. @@ -5344,7 +5344,7 @@ checksums supported see the C command." }; shortdesc = "expand an LV to fill free space"; longdesc = "\ This expands an existing logical volume C so that it fills -C% of the remaining free space in the volume group. Commonly +C % of the remaining free space in the volume group. Commonly you would call this with pc = 100 which expands the logical volume as much as possible, using all remaining free space in the volume group." }; @@ -5683,7 +5683,7 @@ of the underlying block device." }; longdesc = "\ This command erases existing data on C and formats the device as a LUKS encrypted device. C is the -initial key, which is added to key slot C. (LUKS +initial key, which is added to key slot C. (LUKS supports 8 key slots, numbered 0-7)." }; { defaults with @@ -6115,7 +6115,7 @@ See also: C, C, L." }; longdesc = "\ This command is the same as C, but the filesystem is resized to its minimum size. This works like the I<-M> option -to the C command. +to the L command. To get the resulting size of the filesystem you should call C and read the C and C @@ -6463,18 +6463,18 @@ The optional parameters are: =item C Force tune2fs to complete the operation even in the face of errors. -This is the same as the tune2fs C<-f> option. +This is the same as the L C<-f> option. =item C Set the number of mounts after which the filesystem is checked by L. If this is C<0> then the number of mounts is -disregarded. This is the same as the tune2fs C<-c> option. +disregarded. This is the same as the L C<-c> option. =item C Set the number of times the filesystem has been mounted. -This is the same as the tune2fs C<-C> option. +This is the same as the L C<-C> option. =item C @@ -6483,12 +6483,12 @@ Possible values currently are: C, C, C. In practice these options don't really make any difference, particularly for write errors. -This is the same as the tune2fs C<-e> option. +This is the same as the L C<-e> option. =item C Set the group which can use reserved filesystem blocks. -This is the same as the tune2fs C<-g> option except that it +This is the same as the L C<-g> option except that it can only be specified as a number. =item C @@ -6497,27 +6497,27 @@ Adjust the maximal time between two filesystem checks (in seconds). If the option is passed as C<0> then time-dependent checking is disabled. -This is the same as the tune2fs C<-i> option. +This is the same as the L C<-i> option. =item C Set the percentage of the filesystem which may only be allocated by privileged processes. -This is the same as the tune2fs C<-m> option. +This is the same as the L C<-m> option. =item C Set the last mounted directory. -This is the same as the tune2fs C<-M> option. +This is the same as the L C<-M> option. =item C Set the number of reserved filesystem blocks. -This is the same as the tune2fs C<-r> option. +This is the same as the L C<-r> option. =item C Set the user who can use the reserved filesystem blocks. -This is the same as the tune2fs C<-u> option except that it +This is the same as the L C<-u> option except that it can only be specified as a number. =back @@ -6578,8 +6578,8 @@ The chunk size in bytes. =item C The RAID level, which can be one of: -I, I, I<0>, I, I, I<1>, I, -I, I<4>, I, I<5>, I, I<6>, I, I<10>. +C, C, C<0>, C, C, C<1>, C, +C, C<4>, C, C<5>, C, C<6>, C, C<10>. Some of these are synonymous, and more levels may be added in future. If not set, this defaults to C. @@ -6601,7 +6601,7 @@ List all Linux md devices." }; optional = Some "mdadm"; shortdesc = "obtain metadata for an MD device"; longdesc = "\ -This command exposes the output of 'mdadm -DY EmdE'. +This command exposes the output of CmdE>. The following fields are usually present in the returned hash. Other fields may also be present. @@ -6908,7 +6908,7 @@ with the I<-d> option on the host to analyze ISO files, instead of going through libguestfs. For information on the primary volume descriptor fields, see -L" }; +L" }; { defaults with name = "isoinfo"; added = (1, 17, 19); @@ -8232,7 +8232,7 @@ Set the type GUID of numbered GPT partition C to C. Return an error if the partition table of C isn't GPT, or if C is not a valid GUID. -See L +See L for a useful list of type GUIDs." }; { defaults with @@ -8624,7 +8624,7 @@ This function is used internally when testing the appliance." }; Copy the attributes of a path (which can be a file or a directory) to another path. -By default C attribute is copied, so make sure to specify any +By default B attribute is copied, so make sure to specify any (or C to copy everything). The optional arguments specify which attributes can be copied: diff --git a/generator/actions_core_deprecated.ml b/generator/actions_core_deprecated.ml index 93c716627..6f2a9192f 100644 --- a/generator/actions_core_deprecated.ml +++ b/generator/actions_core_deprecated.ml @@ -154,14 +154,14 @@ partitions on block devices. C should be a block device, for example F. C, C and C are the number of cylinders, heads -and sectors on the device, which are passed directly to sfdisk as -the I<-C>, I<-H> and I<-S> parameters. If you pass C<0> for any +and sectors on the device, which are passed directly to L +as the I<-C>, I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the corresponding parameter is omitted. Usually for ‘large’ disks, you can just pass C<0> for these, but for small -(floppy-sized) disks, sfdisk (or rather, the kernel) cannot work +(floppy-sized) disks, L (or rather, the kernel) cannot work out the right geometry and you will need to tell it. -C is a list of lines that we feed to C. For more +C is a list of lines that we feed to L. For more information refer to the L manpage. To create a single partition occupying the whole disk, you would @@ -370,10 +370,10 @@ and C" }; deprecated_by = Replaced_by "file"; shortdesc = "determine file type inside a compressed file"; longdesc = "\ -This command runs F after first decompressing C -using C. +This command runs L after first decompressing C +using C. -C must be one of C, C or C. +C must be one of C, C or C. Since 1.0.63, use C instead which can now process compressed files." }; @@ -390,7 +390,7 @@ process compressed files." }; ]; shortdesc = "return lines matching a pattern"; longdesc = "\ -This calls the external C program and returns the +This calls the external L program and returns the matching lines." }; { defaults with @@ -405,7 +405,7 @@ matching lines." }; ]; shortdesc = "return lines matching a pattern"; longdesc = "\ -This calls the external C program and returns the +This calls the external L program and returns the matching lines." }; { defaults with @@ -465,7 +465,7 @@ matching lines." }; ]; shortdesc = "return lines matching a pattern"; longdesc = "\ -This calls the external C program and returns the +This calls the external L program and returns the matching lines." }; { defaults with @@ -778,7 +778,7 @@ it to local file C (as an xz compressed tar archive)." }; deprecated_by = Replaced_by "lgetxattrs"; shortdesc = "list the files in a directory (long format with SELinux contexts)"; longdesc = "\ -List the files in F in the format of 'ls -laZ'. +List the files in F in the format of C. This command is mostly useful for interactive sessions. It is I intended that you try to parse the output string." }; diff --git a/generator/actions_inspection.ml b/generator/actions_inspection.ml index 7c033ae4f..809344c8c 100644 --- a/generator/actions_inspection.ml +++ b/generator/actions_inspection.ml @@ -632,8 +632,8 @@ The application structure contains the following fields: =item C -The name of the application. For Red Hat-derived and Debian-derived -Linux guests, this is the package name. +The name of the application. For Linux guests, this is the package +name. =item C @@ -763,8 +763,8 @@ required size. =item * Extracting icons from Windows guests requires the external -C program from the C package, and -several programs (C, C, C) +L program from the C package, and +several programs (L, L, L) from the C package. These must be installed separately. =item * diff --git a/generator/actions_inspection_deprecated.ml b/generator/actions_inspection_deprecated.ml index 0d5b48c49..8a6749eec 100644 --- a/generator/actions_inspection_deprecated.ml +++ b/generator/actions_inspection_deprecated.ml @@ -50,8 +50,8 @@ The application structure contains the following fields: =item C -The name of the application. For Red Hat-derived and Debian-derived -Linux guests, this is the package name. +The name of the application. For Linux guests, this is the package +name. =item C @@ -136,16 +136,16 @@ installer CDs. This API would return: =over 4 -=item \"installed\" +=item C This is an installed operating system. -=item \"installer\" +=item C The disk image being inspected is not an installed operating system, but a I install disk, live CD, or similar. -=item \"unknown\" +=item C The format of this disk image is not known. diff --git a/generator/actions_properties.ml b/generator/actions_properties.ml index a713609ae..bbda430bb 100644 --- a/generator/actions_properties.ml +++ b/generator/actions_properties.ml @@ -600,9 +600,9 @@ Get the handle identifier. See C." }; longdesc = "\ Get the directory used by the handle to store temporary socket files. -This is different from C, as we need shorter paths for -sockets (due to the limited buffers of filenames for UNIX sockets), -and C may be too long for them. +This is different from C, as we need shorter +paths for sockets (due to the limited buffers of filenames for UNIX +sockets), and C may be too long for them. The environment variable C controls the default value: If C is set, then that is the default.