aboutsummaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
Diffstat (limited to 'procps')
-rw-r--r--procps/fuser.c3
-rw-r--r--procps/iostat.c3
-rw-r--r--procps/pmap.c3
-rw-r--r--procps/ps.c8
-rw-r--r--procps/pstree.c3
-rw-r--r--procps/pwdx.c3
-rw-r--r--procps/watch.c6
7 files changed, 13 insertions, 16 deletions
diff --git a/procps/fuser.c b/procps/fuser.c
index 2585a4203..418f57b57 100644
--- a/procps/fuser.c
+++ b/procps/fuser.c
@@ -299,8 +299,7 @@ int fuser_main(int argc UNUSED_PARAM, char **argv)
break;
}
- opt_complementary = "-1"; /* at least one param */
- getopt32(argv, OPTION_STRING);
+ getopt32(argv, "^" OPTION_STRING "\0" "-1"/*at least one arg*/);
argv += optind;
pp = argv;
diff --git a/procps/iostat.c b/procps/iostat.c
index 608d41364..fbf685568 100644
--- a/procps/iostat.c
+++ b/procps/iostat.c
@@ -418,8 +418,7 @@ int iostat_main(int argc UNUSED_PARAM, char **argv)
/* Parse and process arguments */
/* -k and -m are mutually exclusive */
- opt_complementary = "k--m:m--k";
- opt = getopt32(argv, "cdtzkm");
+ opt = getopt32(argv, "^" "cdtzkm" "\0" "k--m:m--k");
if (!(opt & (OPT_c + OPT_d)))
/* Default is -cd */
opt |= OPT_c + OPT_d;
diff --git a/procps/pmap.c b/procps/pmap.c
index 3dc733974..5c2d1ad59 100644
--- a/procps/pmap.c
+++ b/procps/pmap.c
@@ -96,8 +96,7 @@ int pmap_main(int argc UNUSED_PARAM, char **argv)
unsigned opts;
int ret;
- opt_complementary = "-1"; /* min one arg */
- opts = getopt32(argv, "xq");
+ opts = getopt32(argv, "^" "xq" "\0" "-1"); /* min one arg */
argv += optind;
ret = 0;
diff --git a/procps/ps.c b/procps/ps.c
index afd981313..e004d25bb 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -718,9 +718,11 @@ int ps_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
/* -w is a bit complicated */
int w_count = 0;
make_all_argv_opts(argv);
- opt_complementary = "ww";
- opts = getopt32(argv, IF_SELINUX("Z")IF_FEATURE_SHOW_THREADS("T")IF_FEATURE_PS_LONG("l")
- "w", &w_count);
+ opts = getopt32(argv, "^"
+ IF_SELINUX("Z")IF_FEATURE_SHOW_THREADS("T")IF_FEATURE_PS_LONG("l")"w"
+ "\0" "ww",
+ &w_count
+ );
/* if w is given once, GNU ps sets the width to 132,
* if w is given more than once, it is "unlimited"
*/
diff --git a/procps/pstree.c b/procps/pstree.c
index 824907997..4fda1c21c 100644
--- a/procps/pstree.c
+++ b/procps/pstree.c
@@ -386,8 +386,7 @@ int pstree_main(int argc UNUSED_PARAM, char **argv)
G.output_width = get_terminal_width(0);
- opt_complementary = "?1";
- getopt32(argv, "p");
+ getopt32(argv, "^" "p" "\0" "?1");
argv += optind;
if (argv[0]) {
diff --git a/procps/pwdx.c b/procps/pwdx.c
index 84802bbcd..c72cf804a 100644
--- a/procps/pwdx.c
+++ b/procps/pwdx.c
@@ -28,8 +28,7 @@
int pwdx_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int pwdx_main(int argc UNUSED_PARAM, char **argv)
{
- opt_complementary = "-1";
- getopt32(argv, "");
+ getopt32(argv, "^" "" "\0" "-1");
argv += optind;
do {
diff --git a/procps/watch.c b/procps/watch.c
index 2bb7cca90..6fc9f7db7 100644
--- a/procps/watch.c
+++ b/procps/watch.c
@@ -62,9 +62,9 @@ int watch_main(int argc UNUSED_PARAM, char **argv)
xopen("/dev/null", O_RDONLY);
#endif
- opt_complementary = "-1"; // at least one param; -n NUM
- // "+": stop at first non-option (procps 3.x only)
- opt = getopt32(argv, "+dtn:+", &period);
+ // "+": stop at first non-option (procps 3.x only); -n NUM
+ // at least one param
+ opt = getopt32(argv, "^+" "dtn:+" "\0" "-1", &period);
argv += optind;
// watch from both procps 2.x and 3.x does concatenation. Example: