aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjozan <jozan@noemail.net>2020-11-04 16:37:29 +0000
committerjozan <jozan@noemail.net>2020-11-04 16:37:29 +0000
commit33ac9fb19a680951364c2664ac440b96166b95e0 (patch)
tree5a384a2ae3d4b29ecd88b6003ded4433af5c5e78
parentIn progress (diff)
downloadunixize-33ac9fb19a680951364c2664ac440b96166b95e0.tar.gz
unixize-33ac9fb19a680951364c2664ac440b96166b95e0.tar.bz2
unixize-33ac9fb19a680951364c2664ac440b96166b95e0.tar.xz
unixize-33ac9fb19a680951364c2664ac440b96166b95e0.tar.zst
unixize-33ac9fb19a680951364c2664ac440b96166b95e0.zip
In progress
FossilOrigin-Name: 7845373df4c5e041847297f7b10d25d65002f566a6a14a33a5df4e100d39ef6d
-rw-r--r--src/c_opts.c7
-rw-r--r--src/c_opts.h6
-rw-r--r--src/c_unixize.c2
3 files changed, 11 insertions, 4 deletions
diff --git a/src/c_opts.c b/src/c_opts.c
index 77c55b1..98f60cb 100644
--- a/src/c_opts.c
+++ b/src/c_opts.c
@@ -58,6 +58,9 @@ c_opts(struct opts_s* opts, int argc, const char* argv[])
opts->recursive = FALSE;
opts->verbose = FALSE;
+ opts->pretend = FALSE;
+ opts->hidden = FALSE;
+ opts->hyphen = FALSE;
while ((opt = getopt(argc, (char *const *)argv, C_OPTS)) != -1) {
if (opt == 'R') {
opts->recursive = TRUE;
@@ -68,6 +71,10 @@ c_opts(struct opts_s* opts, int argc, const char* argv[])
else if (opt == 'p') {
opts->pretend = TRUE;
}
+ else if (opt == 'h') {
+ /* c_dump_usage(); */
+ exit(0);
+ }
else if (opt == '?') {
dprintf(
STDERR_FILENO,
diff --git a/src/c_opts.h b/src/c_opts.h
index 6704f0d..cbe2e54 100644
--- a/src/c_opts.h
+++ b/src/c_opts.h
@@ -41,8 +41,6 @@
* unixize: src/c_opts.h
* 2020-11-02 23:37
* Joe
- *
- * This is where we handle command line options
*/
#ifndef __C_OPTS_H__
@@ -50,12 +48,14 @@
#include "c_unixize.h"
-#define C_OPTS "Rvp"
+#define C_OPTS "hpnRv"
struct opts_s {
bool_t recursive;
bool_t verbose;
bool_t pretend;
+ bool_t hidden;
+ bool_t hyphen;
};
void c_opts(struct opts_s*, int, const char*[]);
diff --git a/src/c_unixize.c b/src/c_unixize.c
index 5ae3d2f..d05c78e 100644
--- a/src/c_unixize.c
+++ b/src/c_unixize.c
@@ -66,7 +66,7 @@ main(int argc, const char* argv[])
if (opts.verbose == TRUE)
printf("Verbose\n");
if (opts.pretend == TRUE)
- printf("Verbose\n");
+ printf("Pretend\n");
return (0);
}