X-Git-Url: https://jxself.org/git/?p=skeinsum.git;a=blobdiff_plain;f=skein_cli.c;fp=skein_cli.c;h=0ea815bbda0f965110f3c8cfee10e4d38779a67b;hp=82b2ae3a59922be03c84ee35dba4548c272e2899;hb=a8a06bb53b71c2608d3e1e22181b0e9a6786b029;hpb=b2515452a0850b7b150e1b8dbfdbd3e9cfb1ea6b
diff --git a/skein_cli.c b/skein_cli.c
index 82b2ae3..0ea815b 100644
--- a/skein_cli.c
+++ b/skein_cli.c
@@ -31,6 +31,8 @@ along with skeinsum. If not, see .
#include
#include "SHA3api_ref.h"
+#define TRYHELP_GOODBYE() do { printf("Try 'skein%dsum --help' for more information.\n", hashbitlen); exit(1); } while(0)
+
extern const int hashbitlen;
#define MaxNmberFiles 10
@@ -380,9 +382,7 @@ int main(int argc, char** argv)
case HELP_OPTION : print_usage(); /* ..never returns */
case VERSION_OPTION : print_version(); /* ..never returns */
- default:
- printf("Try `skein%dsum --help' for more information.\n",hashbitlen);
- exit(1);
+ default: TRYHELP_GOODBYE();
}
}
@@ -424,8 +424,7 @@ int main(int argc, char** argv)
if (check == 1 || quiet == 1 || warn == 1 || status == 1)
{
printf("skein%dsum: the --binary and --text options are meaningless when verifying checksums\n",hashbitlen);
- printf("Try 'skein%dsum --help' for more information.\n",hashbitlen);
- exit(0);
+ TRYHELP_GOODBYE();
}
if(number_files > 0)
{
@@ -464,8 +463,7 @@ int main(int argc, char** argv)
if (check == 1 || quiet == 1 || warn == 1 || status == 1)
{
printf("skein%dsum: the --binary and --text options are meaningless when verifying checksums\n",hashbitlen);
- printf("Try 'skein%dsum --help' for more information.\n",hashbitlen);
- exit(0);
+ TRYHELP_GOODBYE();
}
if(number_files > 0)
{
@@ -505,9 +503,7 @@ int main(int argc, char** argv)
printf("skein%dsum: the --status option is meaningful only when verifying checksums\n",hashbitlen);
if(warn == 1)
printf("skein%dsum: the --warn option is meaningful only when verifying checksums\n",hashbitlen);
-
- printf("Try 'skein%dsum --help' for more information.\n",hashbitlen);
- exit(1);
+ TRYHELP_GOODBYE();
}
if(number_files > 0)
{// hashing files
@@ -539,8 +535,7 @@ int main(int argc, char** argv)
if(tag == 1)
{
printf("skein%dsum: the --tag option is meaningless when verifying checksums\n",hashbitlen);
- printf("Try 'skein%dsum --help' for more information\n",hashbitlen);
- exit(1);
+ TRYHELP_GOODBYE();
}
int index_files = 0;
while(index_files < number_files)