Added "--discard" option.

This commit is contained in:
Andrew Wood
2023-08-28 21:05:45 +01:00
parent 2cd74c7ff7
commit 9e5bdeb3a4
12 changed files with 45 additions and 12 deletions
+6 -1
View File
@@ -172,6 +172,7 @@ opts_t opts_parse(unsigned int argc, char **argv)
{ "stop-at-size", 0, NULL, (int) 'S' },
{ "sync", 0, NULL, (int) 'Y' },
{ "direct-io", 0, NULL, (int) 'K' },
{ "discard", 0, NULL, (int) 'X' },
{ "remote", 1, NULL, (int) 'R' },
{ "pidfile", 1, NULL, (int) 'P' },
{ "watchfd", 1, NULL, (int) 'd' },
@@ -184,7 +185,7 @@ opts_t opts_parse(unsigned int argc, char **argv)
/*@+nullassign@ */
int option_index = 0;
#endif /* HAVE_GETOPT_LONG */
char *short_options = "hVpteIrab8TA:fnqcWD:s:l0i:w:H:N:F:L:B:CESYKR:P:d:m:"
char *short_options = "hVpteIrab8TA:fnqcWD:s:l0i:w:H:N:F:L:B:CESYKXR:P:d:m:"
#ifdef ENABLE_DEBUGGING
"!:"
#endif
@@ -464,6 +465,10 @@ opts_t opts_parse(unsigned int argc, char **argv)
case 'K':
opts->direct_io = true;
break;
case 'X':
opts->discard_input = true;
opts->no_splice = true;
break;
case 'R':
opts->remote = pv_getnum_ui(optarg);
break;