Version 1.11.17.
[libguestfs.git] / fish / help.c
1 /* guestfish - the filesystem interactive shell
2  * Copyright (C) 2010 Red Hat Inc.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  */
18
19 #include <config.h>
20
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24 #include <unistd.h>
25
26 #include "fish.h"
27
28 /* The "help" command.  This used to just list all commands, but
29  * that's not very useful.  Instead display some useful
30  * context-sensitive help.  This could be improved if we knew how many
31  * drives had been added already, and whether anything was mounted.
32  */
33 void
34 display_help (void)
35 {
36   if (guestfs_is_config (g))
37     printf (_(
38 "Add disk images to examine using the -a or -d options, or the 'add' command.\n"
39 "Or create a new disk image using -N, or the 'alloc' or 'sparse' commands.\n"
40 "Once you have done this, use the 'run' command.\n"
41               ));
42   else
43     printf (_(
44 "Find out what filesystems are available using 'list-filesystems' and then\n"
45 "mount them to examine or modify the contents using 'mount-ro' or\n"
46 "'mount-options'.\n"
47               ));
48
49   printf ("\n");
50
51   printf (_(
52 "For more information about a command, use 'help cmd'.\n"
53 "\n"
54 "To read the manual, type 'man'.\n"
55             ));
56
57   printf ("\n");
58 }