mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Using numerical options instead of chars for test.
This commit is contained in:
parent
064652aec7
commit
b417ae5f6e
1 changed files with 13 additions and 8 deletions
21
snapraid.c
21
snapraid.c
|
|
@ -64,6 +64,11 @@ void usage(void)
|
|||
printf(" " SWITCH_GETOPT_LONG("-V, --version ", "-V") " Version\n");
|
||||
}
|
||||
|
||||
#define OPT_TEST_SKIP_SELF 256
|
||||
#define OPT_TEST_KILL_AFTER_SYNC 257
|
||||
#define OPT_TEST_EXPECT_UNRECOVERABLE 258
|
||||
#define OPT_TEST_EXPECT_RECOVERABLE 259
|
||||
|
||||
#if HAVE_GETOPT_LONG
|
||||
struct option long_options[] = {
|
||||
{ "conf", 1, 0, 'c' },
|
||||
|
|
@ -78,10 +83,10 @@ struct option long_options[] = {
|
|||
{ "help", 0, 0, 'h' },
|
||||
{ "version", 0, 0, 'V' },
|
||||
/* test specific options, DO NOT USE! */
|
||||
{ "test-skip-self", 0, 0, 'S' },
|
||||
{ "test-kill-after-sync", 0, 0, 'K' },
|
||||
{ "test-expect-unrecoverable", 0, 0, 'U' },
|
||||
{ "test-expect-recoverable", 0, 0, 'R' },
|
||||
{ "test-skip-self", 0, 0, OPT_TEST_SKIP_SELF },
|
||||
{ "test-kill-after-sync", 0, 0, OPT_TEST_KILL_AFTER_SYNC },
|
||||
{ "test-expect-unrecoverable", 0, 0, OPT_TEST_EXPECT_UNRECOVERABLE },
|
||||
{ "test-expect-recoverable", 0, 0, OPT_TEST_EXPECT_RECOVERABLE },
|
||||
{ 0, 0, 0, 0 }
|
||||
};
|
||||
#endif
|
||||
|
|
@ -194,16 +199,16 @@ int main(int argc, char* argv[])
|
|||
case 'T' :
|
||||
speed();
|
||||
exit(EXIT_SUCCESS);
|
||||
case 'S' :
|
||||
case OPT_TEST_SKIP_SELF :
|
||||
test_skip_self = 1;
|
||||
break;
|
||||
case 'K' :
|
||||
case OPT_TEST_KILL_AFTER_SYNC :
|
||||
test_kill_after_sync = 1;
|
||||
break;
|
||||
case 'U' :
|
||||
case OPT_TEST_EXPECT_UNRECOVERABLE :
|
||||
test_expect_unrecoverable = 1;
|
||||
break;
|
||||
case 'R' :
|
||||
case OPT_TEST_EXPECT_RECOVERABLE :
|
||||
test_expect_recoverable = 1;
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue