From a1b77e545c9f5a12d4aba53efe9dfdf36b362083 Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Mon, 8 Jul 2013 15:36:13 +0200 Subject: [PATCH] patch: saned-help Squashed commit of the following: commit 06a8563916e974210aea9f1d356b142ef3c64bf9 Author: Nils Philippsen Date: Mon Jul 8 15:09:51 2013 +0200 Add short help message to saned (cherry picked from commit fab378a6817c5df72b3991d160d48a23f24a1111) Conflicts: doc/saned.man --- doc/saned.man | 5 +++++ frontend/saned.c | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/doc/saned.man b/doc/saned.man index ad4f535..4f79510 100644 --- a/doc/saned.man +++ b/doc/saned.man @@ -10,6 +10,7 @@ saned \- SANE network daemon .I [ n ] .B | \-s .I [ n ] +.B | \-h .B ] .SH DESCRIPTION .B saned @@ -61,6 +62,10 @@ requests using syslog. If .B saned is run from inetd or xinetd, no option can be given. +.PP +The +.B \-h +flag displays a short help message. .SH CONFIGURATION First and foremost: .B saned diff --git a/frontend/saned.c b/frontend/saned.c index 252b51e..f9787a0 100644 --- a/frontend/saned.c +++ b/frontend/saned.c @@ -3254,6 +3254,15 @@ main (int argc, char *argv[]) } else if (strncmp (argv[1], "-s", 2) == 0) run_mode = SANED_RUN_DEBUG; + else + { + printf ("Usage: saned [ -a [ username ] | -d [ n ] | -s [ n ] ] | -h\n"); + if ((strncmp (argv[1], "-h", 2) == 0) || + (strncmp (argv[1], "--help", 6) == 0)) + exit (EXIT_SUCCESS); + else + exit (EXIT_FAILURE); + } } if (run_mode == SANED_RUN_DEBUG) -- 1.8.3.1