- if (strcasecmp (cmd, "alloc") == 0)
- printf ("alloc - allocate an image\n"
- " alloc <filename> <size>\n"
- "\n"
- " This creates an empty (zeroed) file of the given size,\n"
- " and then adds so it can be further examined.\n"
- "\n"
- " For more advanced image creation, see qemu-img utility.\n"
- "\n"
- " Size can be specified (where <nn> means a number):\n"
- " <nn> number of kilobytes\n"
- " eg: 1440 standard 3.5\" floppy\n"
- " <nn>K or <nn>KB number of kilobytes\n"
- " <nn>M or <nn>MB number of megabytes\n"
- " <nn>G or <nn>GB number of gigabytes\n"
- " <nn>sects number of 512 byte sectors\n");
- else if (strcasecmp (cmd, "help") == 0)
- printf ("help - display a list of commands or help on a command\n"
- " help cmd\n"
- " help\n");
- else if (strcasecmp (cmd, "quit") == 0)
- printf ("quit - quit guestfish\n"
- " quit\n");
+ if (STRCASEEQ (cmd, "alloc") ||
+ STRCASEEQ (cmd, "allocate"))
+ printf (_("alloc - allocate an image\n"
+ " alloc <filename> <size>\n"
+ "\n"
+ " This creates an empty (zeroed) file of the given size,\n"
+ " and then adds so it can be further examined.\n"
+ "\n"
+ " For more advanced image creation, see qemu-img utility.\n"
+ "\n"
+ " Size can be specified using standard suffixes, eg. '1M'.\n"
+ ));
+ else if (STRCASEEQ (cmd, "echo"))
+ printf (_("echo - display a line of text\n"
+ " echo [<params> ...]\n"
+ "\n"
+ " This echos the parameters to the terminal.\n"));
+ else if (STRCASEEQ (cmd, "edit") ||
+ STRCASEEQ (cmd, "vi") ||
+ STRCASEEQ (cmd, "emacs"))
+ printf (_("edit - edit a file in the image\n"
+ " edit <filename>\n"
+ "\n"
+ " This is used to edit a file.\n"
+ "\n"
+ " It is the equivalent of (and is implemented by)\n"
+ " running \"cat\", editing locally, and then \"write\".\n"
+ "\n"
+ " Normally it uses $EDITOR, but if you use the aliases\n"
+ " \"vi\" or \"emacs\" you will get those editors.\n"
+ "\n"
+ " NOTE: This will not work reliably for large files\n"
+ " (> 2 MB) or binary files containing \\0 bytes.\n"));
+ else if (STRCASEEQ (cmd, "lcd"))
+ printf (_("lcd - local change directory\n"
+ " lcd <directory>\n"
+ "\n"
+ " Change guestfish's current directory. This command is\n"
+ " useful if you want to download files to a particular\n"
+ " place.\n"));
+ else if (STRCASEEQ (cmd, "glob"))
+ printf (_("glob - expand wildcards in command\n"
+ " glob <command> [<args> ...]\n"
+ "\n"
+ " Glob runs <command> with wildcards expanded in any\n"
+ " command args. Note that the command is run repeatedly\n"
+ " once for each expanded argument.\n"));
+ else if (STRCASEEQ (cmd, "man") ||
+ STRCASEEQ (cmd, "manual"))
+ printf (_("man - read the manual\n"
+ " man\n"
+ "\n"
+ " Opens the manual page for guestfish.\n"));
+ else if (STRCASEEQ (cmd, "help"))
+ printf (_("help - display a list of commands or help on a command\n"
+ " help cmd\n"
+ " help\n"));
+ else if (STRCASEEQ (cmd, "more") ||
+ STRCASEEQ (cmd, "less"))
+ printf (_("more - view a file in the pager\n"
+ " more <filename>\n"
+ "\n"
+ " This is used to view a file in the pager.\n"
+ "\n"
+ " It is the equivalent of (and is implemented by)\n"
+ " running \"cat\" and using the pager.\n"
+ "\n"
+ " Normally it uses $PAGER, but if you use the alias\n"
+ " \"less\" then it always uses \"less\".\n"
+ "\n"
+ " NOTE: This will not work reliably for large files\n"
+ " (> 2 MB) or binary files containing \\0 bytes.\n"));
+ else if (STRCASEEQ (cmd, "quit") ||
+ STRCASEEQ (cmd, "exit") ||
+ STRCASEEQ (cmd, "q"))
+ printf (_("quit - quit guestfish\n"
+ " quit\n"));
+ else if (STRCASEEQ (cmd, "reopen"))
+ printf (_("reopen - close and reopen the libguestfs handle\n"
+ " reopen\n"
+ "\n"
+ "Close and reopen the libguestfs handle. It is not necessary to use\n"
+ "this normally, because the handle is closed properly when guestfish\n"
+ "exits. However this is occasionally useful for testing.\n"));
+ else if (STRCASEEQ (cmd, "sparse"))
+ printf (_("sparse - allocate a sparse image file\n"
+ " sparse <filename> <size>\n"
+ "\n"
+ " This creates an empty sparse file of the given size,\n"
+ " and then adds so it can be further examined.\n"
+ "\n"
+ " In all respects it works the same as the 'alloc'\n"
+ " command, except that the image file is allocated\n"
+ " sparsely, which means that disk blocks are not assigned\n"
+ " to the file until they are needed. Sparse disk files\n"
+ " only use space when written to, but they are slower\n"
+ " and there is a danger you could run out of real disk\n"
+ " space during a write operation.\n"
+ "\n"
+ " For more advanced image creation, see qemu-img utility.\n"
+ "\n"
+ " Size can be specified using standard suffixes, eg. '1M'.\n"
+ ));
+ else if (STRCASEEQ (cmd, "time"))
+ printf (_("time - measure time taken to run command\n"
+ " time <command> [<args> ...]\n"
+ "\n"
+ " This runs <command> as usual, and prints the elapsed\n"
+ " time afterwards.\n"));