summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2012-04-24 08:56:26 -0400
committerColin Walters <walters@verbum.org>2012-04-24 08:56:26 -0400
commit8312b26c3733a04583084ee3bae9148db84c8b00 (patch)
tree1539dcbc265af575d0d9d03211ca9f914f118ca4
parent89e30f023676530525414ed41afb261f6baf5529 (diff)
downloadlinux-user-chroot-8312b26c3733a04583084ee3bae9148db84c8b00.tar.gz
Add --help and --version arguments
-rw-r--r--src/linux-user-chroot.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/linux-user-chroot.c b/src/linux-user-chroot.c
index 66285e5..7c2e678 100644
--- a/src/linux-user-chroot.c
+++ b/src/linux-user-chroot.c
@@ -24,6 +24,8 @@
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include "config.h"
+
#define _GNU_SOURCE
#include <unistd.h>
#include <stdio.h>
@@ -145,7 +147,17 @@ main (int argc,
fatal ("Too many mounts (maximum of %u)", n_mounts);
n_mounts++;
- if (strcmp (arg, "--mount-bind") == 0)
+ if (strcmp (arg, "--help") == 0)
+ {
+ printf ("%s\n", "See \"man linux-user-chroot\"");
+ exit (0);
+ }
+ else if (strcmp (arg, "--version") == 0)
+ {
+ printf ("%s\n", PACKAGE_STRING);
+ exit (0);
+ }
+ else if (strcmp (arg, "--mount-bind") == 0)
{
if ((argc - after_mount_arg_index) < 3)
fatal ("--mount-bind takes two arguments");