diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2010-11-04 17:04:03 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2010-11-04 17:04:03 +0000 |
commit | 74f7c9e4b7e27787e2052166eeedfbac5814200b (patch) | |
tree | cee6808436f575172f4b198f41c1c344a08231e0 /fish/help.c | |
parent | 7e3d76e41b3c2862ae04744b01e5e23b245393e4 (diff) | |
download | libguestfs-74f7c9e4b7e27787e2052166eeedfbac5814200b.tar.gz libguestfs-74f7c9e4b7e27787e2052166eeedfbac5814200b.tar.xz libguestfs-74f7c9e4b7e27787e2052166eeedfbac5814200b.zip |
fish: Make the 'help' command more helpful.
Diffstat (limited to 'fish/help.c')
-rw-r--r-- | fish/help.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/fish/help.c b/fish/help.c new file mode 100644 index 00000000..47609e9d --- /dev/null +++ b/fish/help.c @@ -0,0 +1,58 @@ +/* guestfish - the filesystem interactive shell + * Copyright (C) 2010 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <config.h> + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include "fish.h" + +/* The "help" command. This used to just list all commands, but + * that's not very useful. Instead display some useful + * context-sensitive help. This could be improved if we knew how many + * drives had been added already, and whether anything was mounted. + */ +void +display_help (void) +{ + if (guestfs_is_config (g)) + printf (_( +"Add disk images to examine using the -a or -d options, or the 'add' command.\n" +"Or create a new disk image using -N, or the 'alloc' or 'sparse' commands.\n" +"Once you have done this, use the 'run' command.\n" + )); + else + printf (_( +"Find out what filesystems are available using 'list-filesystems' and then\n" +"mount them to examine or modify the contents using 'mount-ro' or\n" +"'mount-options'.\n" + )); + + printf ("\n"); + + printf (_( +"For more information about a command, use 'help cmd'.\n" +"\n" +"To read the manual, type 'man'.\n" + )); + + printf ("\n"); +} |