add --version and --help
This commit is contained in:
parent
dd5b24727f
commit
78d2adaa15
6
Makefile
6
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
|
||||
|
||||
|
@ -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 <procps-feedback@lists.sf.net>
|
||||
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
|
||||
|
@ -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
|
||||
|
14
sysctl.c
14
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. */
|
||||
|
Loading…
Reference in New Issue
Block a user