X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Fcmds.c;h=c802f90bc03b3281b3d67264e3a3a3a158ffd124;hb=e492608f2f3809a824cb70ee03ff305964b69dd7;hp=8c35eea2550ab9f6601fc1aacda1cf784d3310c6;hpb=ad8a256f54a6cb99f89bb444c8597a152a793dce;p=libguestfs.git diff --git a/fish/cmds.c b/fish/cmds.c index 8c35eea..c802f90 100644 --- a/fish/cmds.c +++ b/fish/cmds.c @@ -67,9 +67,12 @@ void list_commands (void) printf ("%-20s %s\n", "cp", "copy a file"); printf ("%-20s %s\n", "cp-a", "copy a file or directory recursively"); printf ("%-20s %s\n", "debug", "debugging and internals"); + printf ("%-20s %s\n", "df", "report file system disk space usage"); + printf ("%-20s %s\n", "df-h", "report file system disk space usage (human readable)"); printf ("%-20s %s\n", "dmesg", "return kernel messages"); printf ("%-20s %s\n", "download", "download a file to the local machine"); printf ("%-20s %s\n", "drop-caches", "drop kernel page cache, dentries and inodes"); + printf ("%-20s %s\n", "du", "estimate file space usage"); printf ("%-20s %s\n", "e2fsck-f", "check an ext2/ext3 filesystem"); printf ("%-20s %s\n", "equal", "test if two files have equal contents"); printf ("%-20s %s\n", "exists", "test if file or directory exists"); @@ -86,6 +89,8 @@ void list_commands (void) printf ("%-20s %s\n", "get-verbose", "get verbose mode"); printf ("%-20s %s\n", "glob-expand", "expand a wildcard path"); printf ("%-20s %s\n", "grub-install", "install GRUB"); + printf ("%-20s %s\n", "head", "return first 10 lines of a file"); + printf ("%-20s %s\n", "head-n", "return first N lines of a file"); printf ("%-20s %s\n", "hexdump", "dump a file in hexadecimal"); printf ("%-20s %s\n", "is-busy", "is busy processing a command"); printf ("%-20s %s\n", "is-config", "is in configuration state"); @@ -108,6 +113,7 @@ void list_commands (void) printf ("%-20s %s\n", "lvs-full", "list the LVM logical volumes (LVs)"); printf ("%-20s %s\n", "mkdir", "create a directory"); printf ("%-20s %s\n", "mkdir-p", "create a directory and parents"); + printf ("%-20s %s\n", "mkdtemp", "create a temporary directory"); printf ("%-20s %s\n", "mkfs", "make a filesystem"); printf ("%-20s %s\n", "mount", "mount a guest disk at a position in the filesystem"); printf ("%-20s %s\n", "mount-options", "mount a guest disk with mount options"); @@ -127,6 +133,9 @@ void list_commands (void) printf ("%-20s %s\n", "rm", "remove a file"); printf ("%-20s %s\n", "rm-rf", "remove a file or directory recursively"); printf ("%-20s %s\n", "rmdir", "remove a directory"); + printf ("%-20s %s\n", "scrub-device", "scrub (securely wipe) a device"); + printf ("%-20s %s\n", "scrub-file", "scrub (securely wipe) a file"); + printf ("%-20s %s\n", "scrub-freespace", "scrub (securely wipe) free space"); printf ("%-20s %s\n", "set-append", "add options to kernel command line"); printf ("%-20s %s\n", "set-autosync", "set autosync mode"); printf ("%-20s %s\n", "set-e2label", "set the ext2/3/4 filesystem label"); @@ -147,6 +156,8 @@ void list_commands (void) printf ("%-20s %s\n", "strings", "print the printable strings in a file"); printf ("%-20s %s\n", "strings-e", "print the printable strings in a file"); printf ("%-20s %s\n", "sync", "sync disks, writes are flushed through to the disk image"); + printf ("%-20s %s\n", "tail", "return last 10 lines of a file"); + printf ("%-20s %s\n", "tail-n", "return last N lines of a file"); printf ("%-20s %s\n", "tar-in", "unpack tarfile to directory"); printf ("%-20s %s\n", "tar-out", "pack directory into tarfile"); printf ("%-20s %s\n", "tgz-in", "unpack compressed tarball to directory"); @@ -162,6 +173,9 @@ void list_commands (void) printf ("%-20s %s\n", "vgremove", "remove an LVM volume group"); printf ("%-20s %s\n", "vgs", "list the LVM volume groups (VGs)"); printf ("%-20s %s\n", "vgs-full", "list the LVM volume groups (VGs)"); + printf ("%-20s %s\n", "wc-c", "count characters in a file"); + printf ("%-20s %s\n", "wc-l", "count lines in a file"); + printf ("%-20s %s\n", "wc-w", "count words in a file"); printf ("%-20s %s\n", "write-file", "create a file"); printf ("%-20s %s\n", "zero", "write zeroes to the device"); printf ("%-20s %s\n", "zerofree", "zero unused inodes and disk blocks on ext2/3 filesystem"); @@ -177,7 +191,7 @@ void display_command (const char *cmd) pod2text ("kill-subprocess - kill the qemu subprocess", " kill-subprocess\n\nThis kills the qemu subprocess. You should never need to call this."); else if (strcasecmp (cmd, "add_drive") == 0 || strcasecmp (cmd, "add-drive") == 0 || strcasecmp (cmd, "add") == 0) - pod2text ("add-drive - add an image to examine or modify", " add-drive \n\nThis function adds a virtual machine disk image C to the\nguest. The first time you call this function, the disk appears as IDE\ndisk 0 (C) in the guest, the second time as C, and\nso on.\n\nYou don't necessarily need to be root when using libguestfs. However\nyou obviously do need sufficient permissions to access the filename\nfor whatever operations you want to perform (ie. read access if you\njust want to read the image or write access if you want to modify the\nimage).\n\nThis is equivalent to the qemu parameter C<-drive file=filename>.\n\nNote that this call checks for the existence of C. This\nstops you from specifying other types of drive which are supported\nby qemu such as C and C URLs. To specify those, use\nthe general C call instead.\n\nYou can use 'add' as an alias for this command."); + pod2text ("add-drive - add an image to examine or modify", " add-drive \n\nThis function adds a virtual machine disk image C to the\nguest. The first time you call this function, the disk appears as IDE\ndisk 0 (C) in the guest, the second time as C, and\nso on.\n\nYou don't necessarily need to be root when using libguestfs. However\nyou obviously do need sufficient permissions to access the filename\nfor whatever operations you want to perform (ie. read access if you\njust want to read the image or write access if you want to modify the\nimage).\n\nThis is equivalent to the qemu parameter C<-drive file=filename,cache=off>.\n\nNote that this call checks for the existence of C. This\nstops you from specifying other types of drive which are supported\nby qemu such as C and C URLs. To specify those, use\nthe general C call instead.\n\nYou can use 'add' as an alias for this command."); else if (strcasecmp (cmd, "add_cdrom") == 0 || strcasecmp (cmd, "add-cdrom") == 0 || strcasecmp (cmd, "cdrom") == 0) pod2text ("add-cdrom - add a CD-ROM disk image to examine", " add-cdrom \n\nThis function adds a virtual CD-ROM disk image to the guest.\n\nThis is equivalent to the qemu parameter C<-cdrom filename>.\n\nNote that this call checks for the existence of C. This\nstops you from specifying other types of drive which are supported\nby qemu such as C and C URLs. To specify those, use\nthe general C call instead.\n\nYou can use 'cdrom' as an alias for this command."); @@ -486,7 +500,7 @@ void display_command (const char *cmd) pod2text ("fsck - run the filesystem checker", " fsck \n\nThis runs the filesystem checker (fsck) on C which\nshould have filesystem type C.\n\nThe returned integer is the status. See L for the\nlist of status codes from C.\n\nNotes:\n\n=over 4\n\n=item *\n\nMultiple status codes can be summed together.\n\n=item *\n\nA non-zero return code can mean \"success\", for example if\nerrors have been corrected on the filesystem.\n\n=item *\n\nChecking or repairing NTFS volumes is not supported\n(by linux-ntfs).\n\n=back\n\nThis command is entirely equivalent to running C."); else if (strcasecmp (cmd, "zero") == 0) - pod2text ("zero - write zeroes to the device", " zero \n\nThis command writes zeroes over the first few blocks of C.\n\nHow many blocks are zeroed isn't specified (but it's I enough\nto securely wipe the device). It should be sufficient to remove\nany partition tables, filesystem superblocks and so on."); + pod2text ("zero - write zeroes to the device", " zero \n\nThis command writes zeroes over the first few blocks of C.\n\nHow many blocks are zeroed isn't specified (but it's I enough\nto securely wipe the device). It should be sufficient to remove\nany partition tables, filesystem superblocks and so on.\n\nSee also: C."); else if (strcasecmp (cmd, "grub_install") == 0 || strcasecmp (cmd, "grub-install") == 0) pod2text ("grub-install - install GRUB", " grub-install \n\nThis command installs GRUB (the Grand Unified Bootloader) on\nC, with the root directory being C."); @@ -528,7 +542,7 @@ void display_command (const char *cmd) pod2text ("pvresize - resize an LVM physical volume", " pvresize \n\nThis resizes (expands or shrinks) an existing LVM physical\nvolume to match the new size of the underlying device."); else if (strcasecmp (cmd, "sfdisk_N") == 0 || strcasecmp (cmd, "sfdisk-N") == 0) - pod2text ("sfdisk-N - modify a single partition on a block device", " sfdisk-N \n\nThis runs L option to modify just the single\npartition C (note: C counts from 1).\n\nFor other parameters, see C. You should usually\npass C<0> for the cyls/heads/sectors parameters.\n\nB."); + pod2text ("sfdisk-N - modify a single partition on a block device", " sfdisk-N \n\nThis runs L option to modify just the single\npartition C (note: C counts from 1).\n\nFor other parameters, see C. You should usually\npass C<0> for the cyls/heads/sectors parameters.\n\nB."); else if (strcasecmp (cmd, "sfdisk_l") == 0 || strcasecmp (cmd, "sfdisk-l") == 0) pod2text ("sfdisk-l - display the partition table", " sfdisk-l \n\nThis displays the partition table on C, in the\nhuman-readable output of the L command. It is\nnot intended to be parsed."); @@ -572,6 +586,48 @@ void display_command (const char *cmd) if (strcasecmp (cmd, "glob_expand") == 0 || strcasecmp (cmd, "glob-expand") == 0) pod2text ("glob-expand - expand a wildcard path", " glob-expand \n\nThis command searches for all the pathnames matching\nC according to the wildcard expansion rules\nused by the shell.\n\nIf no paths match, then this returns an empty list\n(note: not an error).\n\nIt is just a wrapper around the C L function\nwith flags C.\nSee that manual page for more details."); else + if (strcasecmp (cmd, "scrub_device") == 0 || strcasecmp (cmd, "scrub-device") == 0) + pod2text ("scrub-device - scrub (securely wipe) a device", " scrub-device \n\nThis command writes patterns over C to make data retrieval\nmore difficult.\n\nIt is an interface to the L program. See that\nmanual page for more details.\n\nB."); + else + if (strcasecmp (cmd, "scrub_file") == 0 || strcasecmp (cmd, "scrub-file") == 0) + pod2text ("scrub-file - scrub (securely wipe) a file", " scrub-file \n\nThis command writes patterns over a file to make data retrieval\nmore difficult.\n\nThe file is I after scrubbing.\n\nIt is an interface to the L program. See that\nmanual page for more details."); + else + if (strcasecmp (cmd, "scrub_freespace") == 0 || strcasecmp (cmd, "scrub-freespace") == 0) + pod2text ("scrub-freespace - scrub (securely wipe) free space", " scrub-freespace \n\nThis command creates the directory C and then fills it\nwith files until the filesystem is full, and scrubs the files\nas for C, and deletes them.\nThe intention is to scrub any free space on the partition\ncontaining C.\n\nIt is an interface to the L program. See that\nmanual page for more details."); + else + if (strcasecmp (cmd, "mkdtemp") == 0) + pod2text ("mkdtemp - create a temporary directory", " mkdtemp