Commit 490c2caa authored by Arie Peterson's avatar Arie Peterson 🐚
Browse files

Create option struct outside while loop

parent 3fea892d
......@@ -25,18 +25,18 @@ void set_config_from_arguments(int argc, char ** argv)
char * notify_command = "";
char * root_device = NULL;
static struct option long_options[] =
{
{"crypt-name" , required_argument, 0, 'c'},
{"notify-command", required_argument, 0, 'n'},
{"root-device" , required_argument, 0, 'r'},
{0, 0, 0, 0}
};
int option_index = 0;
int c;
while (true)
{
static struct option long_options[] =
{
{"crypt-name" , required_argument, 0, 'c'},
{"notify-command", required_argument, 0, 'n'},
{"root-device" , required_argument, 0, 'r'},
{0, 0, 0, 0}
};
int option_index = 0;
c = getopt_long(argc, argv, "c:n:r:", long_options, &option_index);
// Check if we have dealt with all options.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment