- file-tool: added option to show sub directory content

pull/93/head
Michael Zillgith 7 years ago
parent 1d61afaa8b
commit 3b577fbf3a

@ -118,6 +118,7 @@ printHelp()
printf(" -p portnumber\n"); printf(" -p portnumber\n");
printf(" Operations\n"); printf(" Operations\n");
printf(" dir - show directory\n"); printf(" dir - show directory\n");
printf(" subdir <dirname> - show sub directory\n");
printf(" info <filename> - show file info\n"); printf(" info <filename> - show file info\n");
printf(" del <filename> - delete file\n"); printf(" del <filename> - delete file\n");
printf(" get <filename> - get file\n"); printf(" get <filename> - get file\n");
@ -146,6 +147,10 @@ parseOptions(int argc, char** argv)
else if (strcmp(argv[currentArgc], "dir") == 0) { else if (strcmp(argv[currentArgc], "dir") == 0) {
operation = FileOperationType_Dir; operation = FileOperationType_Dir;
} }
else if (strcmp(argv[currentArgc], "subdir") == 0) {
operation = FileOperationType_Dir;
filename = argv[++currentArgc];
}
else if (strcmp(argv[currentArgc], "info") == 0) { else if (strcmp(argv[currentArgc], "info") == 0) {
operation = FileOperationType_Info; operation = FileOperationType_Info;
filename = argv[++currentArgc]; filename = argv[++currentArgc];
@ -176,7 +181,7 @@ showDirectory(IedConnection con)
/* Get the root directory */ /* Get the root directory */
LinkedList rootDirectory = LinkedList rootDirectory =
IedConnection_getFileDirectory(con, &error, NULL); IedConnection_getFileDirectory(con, &error, filename);
if (error != IED_ERROR_OK) { if (error != IED_ERROR_OK) {
printf("Error retrieving file directory\n"); printf("Error retrieving file directory\n");

Loading…
Cancel
Save