1.1 --- a/fsaccess/fsaccess.c Wed Mar 16 22:44:46 2022 +0100
1.2 +++ b/fsaccess/fsaccess.c Fri Mar 18 00:14:07 2022 +0100
1.3 @@ -20,8 +20,10 @@
1.4 */
1.5
1.6 #include <stdio.h>
1.7 +#include <unistd.h>
1.8
1.9 #include "ops.h"
1.10 +#include "session.h"
1.11
1.12
1.13
1.14 @@ -30,11 +32,6 @@
1.15 char help_text[] = "\
1.16 Usage: %s [ <options> ] <operation> <filename>...\n\
1.17 \n\
1.18 -File ownership options:\n\
1.19 -\n\
1.20 - -g GID Set group identifier for new files\n\
1.21 - -u UID Set user identifier for new files\n\
1.22 -\n\
1.23 File permission options:\n\
1.24 \n\
1.25 -m MASK Set mode/permissions mask for new directories\n\
1.26 @@ -65,11 +62,13 @@
1.27 {"copy-out", copy_out},
1.28 #endif
1.29 {"ls", list_objects},
1.30 + {"mkdir", make_dirs},
1.31 #if 0
1.32 - {"mkdir", make_dirs},
1.33 {"rm", remove_non_dirs},
1.34 {"rmdir", remove_dirs},
1.35 +#endif
1.36 {"script", run_script},
1.37 +#if 0
1.38 {"stat", stat_objects},
1.39 #endif
1.40 {NULL, NULL},
1.41 @@ -85,8 +84,13 @@
1.42 int num_args;
1.43 enum op_results op_result;
1.44
1.45 - args = &argv[1];
1.46 - num_args = argc - 1;
1.47 + /* Parse program options and initialise the argument details. */
1.48 +
1.49 + if (parse_options(argc, argv))
1.50 + return 1;
1.51 +
1.52 + args = &argv[optind];
1.53 + num_args = argc - optind;
1.54
1.55 if (num_args < 2)
1.56 {