mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-08-12 12:00:21 +02:00
Convert static declarations of struct option to use new macros from
getopt.h: no_argument, required_argument, and optional_argument.
This commit is contained in:
@@ -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}
|
||||
};
|
||||
|
||||
|
||||
@@ -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}
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -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}
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -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}
|
||||
};
|
||||
|
||||
|
||||
+2
-2
@@ -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}
|
||||
};
|
||||
|
||||
|
||||
@@ -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}
|
||||
};
|
||||
|
||||
|
||||
@@ -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}
|
||||
};
|
||||
|
||||
|
||||
@@ -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}
|
||||
};
|
||||
|
||||
|
||||
+6
-6
@@ -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}
|
||||
};
|
||||
|
||||
|
||||
@@ -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}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user