]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Convert static declarations of struct option to use new macros from
authorJim Meyering <jim@meyering.net>
Wed, 2 Dec 1992 18:51:53 +0000 (18:51 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 2 Dec 1992 18:51:53 +0000 (18:51 +0000)
getopt.h: no_argument, required_argument, and optional_argument.

src/env.c
src/id.c
src/nice.c
src/pathchk.c
src/stty.c
src/su.c
src/tee.c
src/tty.c
src/uname.c
src/who.c

index 9633180233580be77aa0ddce1988a71a0731ede6..f802856046578e21f8f49543e83276a6c513736f 100644 (file)
--- a/src/env.c
+++ b/src/env.c
@@ -94,8 +94,8 @@ char *program_name;
 
 static struct option const longopts[] =
 {
-  {"ignore-environment", 0, NULL, 'i'},
-  {"unset", 1, NULL, 'u'},
+  {"ignore-environment", no_argument, NULL, 'i'},
+  {"unset", required_argument, NULL, 'u'},
   {NULL, 0, NULL, 0}
 };
 
index e7aa8835d0ce313214d088e4bad585ff171db24e..a6708fbe4e2c1d1c29ab24818bebfa0a965f2fcc 100644 (file)
--- a/src/id.c
+++ b/src/id.c
@@ -92,11 +92,11 @@ static int problems = 0;
 
 static struct option const longopts[] =
 {
-  {"group", 0, NULL, 'g'},
-  {"name", 0, NULL, 'n'},
-  {"real", 0, NULL, 'r'},
-  {"user", 0, NULL, 'u'},
-  {"groups", 0, NULL, 'G'},
+  {"group", no_argument, NULL, 'g'},
+  {"name", no_argument, NULL, 'n'},
+  {"real", no_argument, NULL, 'r'},
+  {"user", no_argument, NULL, 'u'},
+  {"groups", no_argument, NULL, 'G'},
   {NULL, 0, NULL, 0}
 };
 
index 52d79efcf4355d1d79bd6e2f20163eae4936de51..6386e519a8b2a921c3a0bfe5903f6b2e550be1ff 100644 (file)
@@ -36,7 +36,7 @@ char *program_name;
 
 static struct option const longopts[] =
 {
-  {"adjustment", 1, NULL, 'n'},
+  {"adjustment", required_argument, NULL, 'n'},
   {NULL, 0, NULL, 0}
 };
 
index a5f7767738a1af15eae20b414b288894a33e4e47..6a0bf7965af5ace064d2514b50558e6c9e132743 100644 (file)
@@ -98,7 +98,7 @@ char *program_name;
 
 static struct option const longopts[] =
 {
-  {"portability", 0, NULL, 'p'},
+  {"portability", no_argument, NULL, 'p'},
   {NULL, 0, NULL, 0}
 };
 
index f06a9759c871185cf9d62b50f7223046aed798cb..4fb8158299f1d7d80dd1fe903752018854b1b3f5 100644 (file)
@@ -361,8 +361,8 @@ static int current_col;
 
 static struct option longopts[] =
 {
-  {"all", 0, NULL, 'a'},
-  {"save", 0, NULL, 'g'},
+  {"all", no_argument, NULL, 'a'},
+  {"save", no_argument, NULL, 'g'},
   {NULL, 0, NULL, 0}
 };
 
index bc33f1539c2d747faf3eee161c92bfc921a95710..ff2bfe5fce6b9cade0afa3b228b060a7050b992f 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -164,11 +164,11 @@ static int change_environment;
 
 static struct option const longopts[] =
 {
-  {"command", 1, 0, 'c'},
-  {"fast", 0, &fast_startup, 1},
-  {"login", 0, &simulate_login, 1},
-  {"preserve-environment", 0, &change_environment, 0},
-  {"shell", 1, 0, 's'},
+  {"command", required_argument, 0, 'c'},
+  {"fast", no_argument, &fast_startup, 1},
+  {"login", no_argument, &simulate_login, 1},
+  {"preserve-environment", no_argument, &change_environment, 0},
+  {"shell", required_argument, 0, 's'},
   {0, 0, 0, 0}
 };
 
index b06afa8d6bceb64eda9d70ff2761a1eb41a54676..b97821c8dd5527f861fa4c2ef164c50ba5612099 100644 (file)
--- a/src/tee.c
+++ b/src/tee.c
@@ -40,8 +40,8 @@ char *program_name;
 
 static struct option const long_options[] =
 {
-  {"append", 0, NULL, 'a'},
-  {"ignore-interrupts", 0, NULL, 'i'},
+  {"append", no_argument, NULL, 'a'},
+  {"ignore-interrupts", no_argument, NULL, 'i'},
   {NULL, 0, NULL, 0}
 };
 
index 7549149a99d32c3de755b8a51f3843d45dc71843..12ead35b0c87fef1aeda915c7d0f8dd8eb619049 100644 (file)
--- a/src/tty.c
+++ b/src/tty.c
@@ -36,8 +36,8 @@ static int silent;
 
 static struct option const longopts[] =
 {
-  {"silent", 0, NULL, 's'},
-  {"quiet", 0, NULL, 's'},
+  {"silent", no_argument, NULL, 's'},
+  {"quiet", no_argument, NULL, 's'},
   {NULL, 0, NULL, 0}
 };
 
index 5ddd63101d592c254c6eedf5bd3cecb8bd92f2d8..71d3112075d34e9ee1a447141fef965144a78563 100644 (file)
@@ -63,12 +63,12 @@ char *program_name;
 
 static struct option const long_options[] =
 {
-  {"sysname", 0, NULL, 's'},
-  {"nodename", 0, NULL, 'n'},
-  {"release", 0, NULL, 'r'},
-  {"version", 0, NULL, 'v'},
-  {"machine", 0, NULL, 'm'},
-  {"all", 0, NULL, 'a'},
+  {"sysname", no_argument, NULL, 's'},
+  {"nodename", no_argument, NULL, 'n'},
+  {"release", no_argument, NULL, 'r'},
+  {"version", no_argument, NULL, 'v'},
+  {"machine", no_argument, NULL, 'm'},
+  {"all", no_argument, NULL, 'a'},
   {NULL, 0, NULL, 0}
 };
 
index aa90c022ac3891de383f75dbc84e09f56e102a81..381a51f505d4c9440394928f293ab949b7215a31 100644 (file)
--- a/src/who.c
+++ b/src/who.c
@@ -94,12 +94,12 @@ static int include_mesg;
 
 static struct option const longopts[] =
 {
-  {"count", 0, NULL, 'q'},
-  {"idle", 0, NULL, 'u'},
-  {"heading", 0, NULL, 'H'},
-  {"message", 0, NULL, 'T'},
-  {"mesg", 0, NULL, 'T'},
-  {"writable", 0, NULL, 'T'},
+  {"count", no_argument, NULL, 'q'},
+  {"idle", no_argument, NULL, 'u'},
+  {"heading", no_argument, NULL, 'H'},
+  {"message", no_argument, NULL, 'T'},
+  {"mesg", no_argument, NULL, 'T'},
+  {"writable", no_argument, NULL, 'T'},
   {NULL, 0, NULL, 0}
 };