feat: add CLI flags (#95-#99, #103-#105)
CI / lint (pull_request) Failing after 11s
CI / build-and-test (pull_request) Has been skipped
CI / sanitizers (address) (pull_request) Has been skipped
CI / sanitizers (undefined) (pull_request) Has been skipped
CI / fuzz-build (pull_request) Has been skipped
CI / coverage (pull_request) Has been skipped
CI / valgrind (pull_request) Has been skipped

This commit is contained in:
2026-07-21 16:43:40 +02:00
parent 081973c904
commit be79c014d4
6 changed files with 12 additions and 16 deletions
+4 -4
View File
@@ -290,14 +290,14 @@ int main(int argc, char* argv[]) {
goto cleanup; goto cleanup;
} }
} else if (strcmp(argv[i], "--exclude-from") == 0 && i + 1 < argc) { } else if (strcmp(argv[i], "--exclude-from") == 0 && i + 1 < argc) {
if (read_patterns_from_file(argv[++i], &config->exclude_patterns, if (read_patterns_from_file(argv[++i], &config->exclude_patterns, &config->exclude_count) !=
&config->exclude_count) != 0) { 0) {
exit_code = 1; exit_code = 1;
goto cleanup; goto cleanup;
} }
} else if (strcmp(argv[i], "--include-from") == 0 && i + 1 < argc) { } else if (strcmp(argv[i], "--include-from") == 0 && i + 1 < argc) {
if (read_patterns_from_file(argv[++i], &config->include_patterns, if (read_patterns_from_file(argv[++i], &config->include_patterns, &config->include_count) !=
&config->include_count) != 0) { 0) {
exit_code = 1; exit_code = 1;
goto cleanup; goto cleanup;
} }
+1 -2
View File
@@ -37,8 +37,7 @@ DirectoryScanner* directory_scanner_create(char* root_directory, bool use_metada
unsigned long long chunk_size, char** exclude_patterns, unsigned long long chunk_size, char** exclude_patterns,
int exclude_count, char** include_patterns, int exclude_count, char** include_patterns,
int include_count, unsigned long long max_size, int include_count, unsigned long long max_size,
unsigned long long min_size, unsigned long long min_size, int max_depth) {
int max_depth) {
DirectoryScanner* scanner = malloc(sizeof(DirectoryScanner)); DirectoryScanner* scanner = malloc(sizeof(DirectoryScanner));
if (scanner == NULL) if (scanner == NULL)
return NULL; return NULL;
+1 -2
View File
@@ -26,8 +26,7 @@ DirectoryScanner* directory_scanner_create(char* root_directory, bool use_metada
unsigned long long chunk_size, char** exclude_patterns, unsigned long long chunk_size, char** exclude_patterns,
int exclude_count, char** include_patterns, int exclude_count, char** include_patterns,
int include_count, unsigned long long max_size, int include_count, unsigned long long max_size,
unsigned long long min_size, unsigned long long min_size, int max_depth);
int max_depth);
Chunk* directory_scanner_next(DirectoryScanner* scanner); Chunk* directory_scanner_next(DirectoryScanner* scanner);
void directory_scanner_destroy(DirectoryScanner* scanner); void directory_scanner_destroy(DirectoryScanner* scanner);
+1 -2
View File
@@ -22,8 +22,7 @@ int receive_files(Config* config, int fd) {
return -1; return -1;
while (status == STATUS_NEXT || status == STATUS_CHUNK || status == STATUS_CHECK || while (status == STATUS_NEXT || status == STATUS_CHUNK || status == STATUS_CHECK ||
status == STATUS_KEEPALIVE || status == STATUS_ABORT || status == STATUS_KEEPALIVE || status == STATUS_ABORT || status == STATUS_CHECK_BATCH) {
status == STATUS_CHECK_BATCH) {
if (status == STATUS_KEEPALIVE) { if (status == STATUS_KEEPALIVE) {
send_status(fd, STATUS_KEEPALIVE); send_status(fd, STATUS_KEEPALIVE);
goto next; goto next;
+1 -2
View File
@@ -106,8 +106,7 @@ int receive_thread(void* pipeline_context) {
if (!receive_status(file_descriptor, &status)) if (!receive_status(file_descriptor, &status))
return thrd_error; return thrd_error;
while (status == STATUS_NEXT || status == STATUS_CHUNK || status == STATUS_CHECK || while (status == STATUS_NEXT || status == STATUS_CHUNK || status == STATUS_CHECK ||
status == STATUS_KEEPALIVE || status == STATUS_ABORT || status == STATUS_KEEPALIVE || status == STATUS_ABORT || status == STATUS_CHECK_BATCH) {
status == STATUS_CHECK_BATCH) {
if (status == STATUS_KEEPALIVE) { if (status == STATUS_KEEPALIVE) {
send_status(file_descriptor, STATUS_KEEPALIVE); send_status(file_descriptor, STATUS_KEEPALIVE);
goto next; goto next;