diff options
author | jozan <jozan@noemail.net> | 2020-11-04 12:52:30 +0000 |
---|---|---|
committer | jozan <jozan@noemail.net> | 2020-11-04 12:52:30 +0000 |
commit | b1e43dbc99a8d1cfc7116a1a3d9e2acb1f859629 (patch) | |
tree | a7a9c4e7836214c6f6b1e495beda820c3c05478a | |
parent | I'll see norm later (diff) | |
download | unixize-b1e43dbc99a8d1cfc7116a1a3d9e2acb1f859629.tar.gz unixize-b1e43dbc99a8d1cfc7116a1a3d9e2acb1f859629.tar.bz2 unixize-b1e43dbc99a8d1cfc7116a1a3d9e2acb1f859629.tar.xz unixize-b1e43dbc99a8d1cfc7116a1a3d9e2acb1f859629.tar.zst unixize-b1e43dbc99a8d1cfc7116a1a3d9e2acb1f859629.zip |
In progress
FossilOrigin-Name: f147216aea46f8ba720c9730bcc37b1984145e9970687669f86917bec91fc3ca
-rw-r--r-- | src/c_opts.c | 6 | ||||
-rw-r--r-- | src/c_opts.h | 3 | ||||
-rw-r--r-- | src/c_unixize.c | 2 | ||||
-rw-r--r-- | src/c_unixize.h | 2 |
4 files changed, 11 insertions, 2 deletions
diff --git a/src/c_opts.c b/src/c_opts.c index 7c8170e..77c55b1 100644 --- a/src/c_opts.c +++ b/src/c_opts.c @@ -65,6 +65,9 @@ c_opts(struct opts_s* opts, int argc, const char* argv[]) else if (opt == 'v') { opts->verbose = TRUE; } + else if (opt == 'p') { + opts->pretend = TRUE; + } else if (opt == '?') { dprintf( STDERR_FILENO, @@ -74,6 +77,9 @@ c_opts(struct opts_s* opts, int argc, const char* argv[]) exit(1); } } + if (opts->pretend == TRUE) { + opts->verbose = TRUE; + } if (optind < argc && argv[optind] != NULL) { printf("arg: %s\n", argv[optind]); } diff --git a/src/c_opts.h b/src/c_opts.h index a63e898..6704f0d 100644 --- a/src/c_opts.h +++ b/src/c_opts.h @@ -50,9 +50,12 @@ #include "c_unixize.h" +#define C_OPTS "Rvp" + struct opts_s { bool_t recursive; bool_t verbose; + bool_t pretend; }; void c_opts(struct opts_s*, int, const char*[]); diff --git a/src/c_unixize.c b/src/c_unixize.c index 5381880..5ae3d2f 100644 --- a/src/c_unixize.c +++ b/src/c_unixize.c @@ -65,6 +65,8 @@ main(int argc, const char* argv[]) printf("Recursive\n"); if (opts.verbose == TRUE) printf("Verbose\n"); + if (opts.pretend == TRUE) + printf("Verbose\n"); return (0); } diff --git a/src/c_unixize.h b/src/c_unixize.h index 4447c81..77a9ce0 100644 --- a/src/c_unixize.h +++ b/src/c_unixize.h @@ -46,8 +46,6 @@ #ifndef __C_UNIXIZE_H__ #define __C_UNIXIZE_H__ -#define C_OPTS ":Rv" - typedef enum bool_e { FALSE, TRUE |