diff options
| author | David M. Syzdek <syzdek@bindlebinaries.com> | 2017-07-09 00:41:23 -0800 |
|---|---|---|
| committer | David M. Syzdek <syzdek@bindlebinaries.com> | 2017-07-09 00:42:17 -0800 |
| commit | ed3c099a91acee8330e0c0364b3ae1302d57ff5d (patch) | |
| tree | 5b2c79f1251f05c801883a34a3c3a2839f906b7a /src/securecoreutils.c | |
| parent | e5e22f34fb35442aa9cd78a41115afa513fb8b47 (diff) | |
| download | securecoreutils-ed3c099a91acee8330e0c0364b3ae1302d57ff5d.tar.gz securecoreutils-ed3c099a91acee8330e0c0364b3ae1302d57ff5d.tar.bz2 securecoreutils-ed3c099a91acee8330e0c0364b3ae1302d57ff5d.tar.xz securecoreutils-ed3c099a91acee8330e0c0364b3ae1302d57ff5d.zip | |
Adding help and version widgets
Diffstat (limited to 'src/securecoreutils.c')
| -rw-r--r-- | src/securecoreutils.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/securecoreutils.c b/src/securecoreutils.c index 880d410..75cbdd0 100644 --- a/src/securecoreutils.c +++ b/src/securecoreutils.c | |||
| @@ -86,6 +86,8 @@ int main(int argc, char * argv[]); | |||
| 86 | const char * scu_basename(const char * path); | 86 | const char * scu_basename(const char * path); |
| 87 | const scu_widget * scu_widget_lookup(const char * wname, int exact); | 87 | const scu_widget * scu_widget_lookup(const char * wname, int exact); |
| 88 | int scu_widget_syzdek(scu_config * cnf); | 88 | int scu_widget_syzdek(scu_config * cnf); |
| 89 | int scu_widget_version(scu_config * cnf); | ||
| 90 | int scu_widget_usage(scu_config * cnf); | ||
| 89 | 91 | ||
| 90 | 92 | ||
| 91 | ///////////////// | 93 | ///////////////// |
| @@ -106,6 +108,12 @@ const scu_widget scu_widget_map[] = | |||
| 106 | scu_widget_cat, // widget function | 108 | scu_widget_cat, // widget function |
| 107 | }, | 109 | }, |
| 108 | { | 110 | { |
| 111 | "help", // widget name | ||
| 112 | NULL, // widget description | ||
| 113 | (const char * const[]) { "usage", NULL }, // widget alias | ||
| 114 | scu_widget_usage, // widget function | ||
| 115 | }, | ||
| 116 | { | ||
| 109 | "pathcheck", // widget name | 117 | "pathcheck", // widget name |
| 110 | "Validates path using internal checks.", // widget description | 118 | "Validates path using internal checks.", // widget description |
| 111 | (const char * const[]) { _PREFIX"path", NULL }, // widget alias | 119 | (const char * const[]) { _PREFIX"path", NULL }, // widget alias |
| @@ -138,6 +146,12 @@ const scu_widget scu_widget_map[] = | |||
| 138 | scu_widget_tail, // widget function | 146 | scu_widget_tail, // widget function |
| 139 | }, | 147 | }, |
| 140 | { | 148 | { |
| 149 | "version", // widget name | ||
| 150 | NULL, // widget description | ||
| 151 | NULL, // widget alias | ||
| 152 | scu_widget_version, // widget function | ||
| 153 | }, | ||
| 154 | { | ||
| 141 | "zcat", // widget name | 155 | "zcat", // widget name |
| 142 | "Uncompresses file and write to standard out.", // widget description | 156 | "Uncompresses file and write to standard out.", // widget description |
| 143 | (const char * const[]) { _PREFIX"zcat", | 157 | (const char * const[]) { _PREFIX"zcat", |
| @@ -592,6 +606,22 @@ int scu_widget_syzdek(scu_config * cnf) | |||
| 592 | #endif | 606 | #endif |
| 593 | 607 | ||
| 594 | 608 | ||
| 609 | int scu_widget_usage(scu_config * cnf) | ||
| 610 | { | ||
| 611 | assert(cnf != NULL); | ||
| 612 | scu_usage(cnf); | ||
| 613 | return(0); | ||
| 614 | } | ||
| 615 | |||
| 616 | |||
| 617 | int scu_widget_version(scu_config * cnf) | ||
| 618 | { | ||
| 619 | assert(cnf != NULL); | ||
| 620 | scu_version(); | ||
| 621 | return(0); | ||
| 622 | } | ||
| 623 | |||
| 624 | |||
| 595 | const char * scu_strerror(int err) | 625 | const char * scu_strerror(int err) |
| 596 | { | 626 | { |
| 597 | if (err < 0) | 627 | if (err < 0) |
