From: albert <> Date: Thu, 12 Dec 2002 04:49:39 +0000 (+0000) Subject: add --version and --help X-Git-Tag: v3.3.0~294 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78d2adaa15c33d7f06e69017a62f143c12c582ba;p=procps-ng add --version and --help --- diff --git a/Makefile b/Makefile index 1baafb03..5970ef17 100644 --- a/Makefile +++ b/Makefile @@ -18,9 +18,9 @@ VERSION := 3 SUBVERSION := 1 -MINORVERSION := 2 -TARVERSION := 3.1.2 -LIBVERSION := 3.1.2 +MINORVERSION := 3 +TARVERSION := 3.1.3 +LIBVERSION := 3.1.3 ############ vars diff --git a/procps.lsm b/procps.lsm index 52d24370..12d66895 100644 --- a/procps.lsm +++ b/procps.lsm @@ -1,15 +1,15 @@ Begin4 Title: procps -Version: 3.1.2 -Entered-date: 2002-12-08 +Version: 3.1.3 +Entered-date: 2002-12-11 Description: Linux system utilities Keywords: procps /proc libproc sysctl pmap ps uptime tload free w top vmstat watch skill snice kill pgrep pkill Author: Albert Cahalan, Michael K. Johnson, Jim Warner, etc. Maintained-by: various Primary-site: http://procps.sf.net/ - 236kB procps-3.1.2.tar.gz + 236kB procps-3.1.3.tar.gz Alternate-site: http://www.debian.org/Packages/unstable/base/procps.html - 236kB procps-3.1.2.tar.gz + 236kB procps-3.1.3.tar.gz Copying-policy: mixed End diff --git a/procps.spec b/procps.spec index e781c6de..f73d540d 100644 --- a/procps.spec +++ b/procps.spec @@ -3,7 +3,7 @@ Summary: System and process monitoring utilities Name: procps %define major_version 3 %define minor_version 1 -%define revision 2 +%define revision 3 %define version %{major_version}.%{minor_version}.%{revision} Version: %{version} Release: 1 diff --git a/sysctl.c b/sysctl.c index 4952f9f5..356f04fb 100644 --- a/sysctl.c +++ b/sysctl.c @@ -379,12 +379,24 @@ int main(int argc, char **argv) { if (argc < 2) { return Usage(me); - } /* endif */ + } argv++; for (; argv && *argv && **argv; argv++) { if (SwitchesAllowed && **argv == '-') { /* we have a switch */ + if ((*argv)[1] && (*argv)[2]){ // don't yet handle "sysctl -ew" + if (!strcmp("--help",*argv)) { + Usage(me); + exit(0); + } + if (!strcmp("--version",*argv)) { + fprintf(stdout, "sysctl (%s)\n",procps_version); + exit(0); + } + fprintf(stderr, ERR_UNKNOWN_PARAMETER, *argv); + return Usage(me); + } switch((*argv)[1]) { case 'b': /* This is "binary" format, which means more for BSD. */