summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-11-23 07:07:41 +0100
committerTyge Løvset <[email protected]>2021-11-23 07:07:41 +0100
commit083b37734c8cdfa285dcf2c665e172244dc23313 (patch)
tree7fad389a30690e2a7fefdf0403432b3046872a9f /examples
parentddeb0603e1ce90cee843e59708ce80c24589d14d (diff)
downloadSTC-modified-083b37734c8cdfa285dcf2c665e172244dc23313.tar.gz
STC-modified-083b37734c8cdfa285dcf2c665e172244dc23313.zip
BUGFIX: c_default_hash32() was buggy in ccommon.h - fixed.
Diffstat (limited to 'examples')
-rw-r--r--examples/option_mkdir.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/examples/option_mkdir.c b/examples/option_mkdir.c
index e28c09e9..b9f4ddea 100644
--- a/examples/option_mkdir.c
+++ b/examples/option_mkdir.c
@@ -14,13 +14,13 @@ int parseArgs(int argc, char *argv[], struct AppArgs *args)
{
const char *shortopts = "pvm:Z";
coption_long longopts[] = {
- {"mode", coption_required_argument, 'm'},
- {"parent", coption_no_argument, 'p'},
- {"verbose", coption_no_argument, 'v'},
- {"context", coption_optional_argument, 'Z'},
- {"help", coption_no_argument, 'H'},
- {"version", coption_no_argument, 'V'},
- {NULL}
+ {"mode", coption_required_argument, 'm'},
+ {"parent", coption_no_argument, 'p'},
+ {"verbose", coption_no_argument, 'v'},
+ {"context", coption_optional_argument, 'Z'},
+ {"help", coption_no_argument, 'H'},
+ {"version", coption_no_argument, 'V'},
+ {NULL}
};
*args = (struct AppArgs){NULL};
coption opt = coption_init();
@@ -32,28 +32,28 @@ int parseArgs(int argc, char *argv[], struct AppArgs *args)
case 'v': args->verbose = true; break;
case 'Z': args->context = opt.arg? opt.arg : "DEFAULT"; break;
case 'H':
- printf( "Usage: mkdir [OPTION]... DIRECTORY...\n"
- "Create the DIRECTORY(ies), if they do not already exist.\n\n"
- "Mandatory arguments to long options are mandatory for short options too.\n"
- " -m, --mode=MODE set file mode (as in chmod), not a=rwx - umask\n"
- " -p, --parents no error if existing, make parent directories as needed\n"
- " -v, --verbose print a message for each created directory\n"
- " -Z set SELinux security context of each created directory\n"
- " to the default type\n"
- " --context[=CTX] like -Z, or if CTX is specified then set the SELinux\n"
- " or SMACK security context to CTX\n"
- " --help display this help and exit\n"
- " --version output version information and exit\n\n"
- "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\n"
- "Full documentation at: <https://www.gnu.org/software/coreutils/mkdir>\n"
- "or available locally via: info '(coreutils) mkdir invocation'\n" );
+ printf("Usage: mkdir [OPTION]... DIRECTORY...\n"
+ "Create the DIRECTORY(ies), if they do not already exist.\n\n"
+ "Mandatory arguments to long options are mandatory for short options too.\n"
+ " -m, --mode=MODE set file mode (as in chmod), not a=rwx - umask\n"
+ " -p, --parents no error if existing, make parent directories as needed\n"
+ " -v, --verbose print a message for each created directory\n"
+ " -Z set SELinux security context of each created directory\n"
+ " to the default type\n"
+ " --context[=CTX] like -Z, or if CTX is specified then set the SELinux\n"
+ " or SMACK security context to CTX\n"
+ " --help display this help and exit\n"
+ " --version output version information and exit\n\n"
+ "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\n"
+ "Full documentation at: <https://www.gnu.org/software/coreutils/mkdir>\n"
+ "or available locally via: info '(coreutils) mkdir invocation'\n");
return 1;
case 'V':
- printf( "mkdir (GNU coreutils) 8.30\n"
- "Copyright (C) 2018 Free Software Foundation, Inc.\n"
- "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.\n"
- "This is free software: you are free to change and redistribute it.\n"
- "There is NO WARRANTY, to the extent permitted by law.\n" );
+ printf("mkdir (GNU coreutils) 8.30\n"
+ "Copyright (C) 2018 Free Software Foundation, Inc.\n"
+ "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.\n"
+ "This is free software: you are free to change and redistribute it.\n"
+ "There is NO WARRANTY, to the extent permitted by law.\n");
return 1;
case ':':
printf("mkdir: option '%s' requires an argument\n"