Commit adab1ef0 authored by Bernard Quatermass's avatar Bernard Quatermass

cleanup usage, add version string

parent 78766114
......@@ -30,6 +30,7 @@
#include <mplib1/dl_list.h>
#include "version.h"
#include "util.h"
#include "clica.h"
......@@ -47,6 +48,25 @@
* *
***************************************************************************************/
static void
usage( int exit_code, const char *str )
{
fprintf( stderr, "%s\n\n", str );
fprintf( stderr,
"Usage:\tclica\t--initialise --directory dir --domain example.com\n"
"\t\t[--ocspurl url] [--crlurl url] [--nosubsign]\n\n"
"\tclica\t--server fqdn.example.com --directory dir\n"
"\t\t\t[--orgunit orgunit] [-8 alt1.fqdn.example.com[,alt2...]\n"
"\tclica\t--client fqdn.example.com [--orgunit orgunit]\n"
"\t\t\t[--orgunit orgunit] [-8 alt1.fqdn.example.com[,alt2...]\n"
"\tclica\t--user user@example.com --directory dir\n"
"\n"
);
exit( exit_code );
}
static struct config *
init_config()
{
......@@ -168,10 +188,12 @@ parse_cmdline_args( struct config *config, int argc, char *argv[] )
{"verbose", 0, 0, 'v'},
{"help", 0, 0, 'H'},
{0, 0, 0, 0}
};
c = getopt_long( argc, argv, "D:S:C:U:8:O:P:p:R:Iv",
c = getopt_long( argc, argv, "D:S:C:U:8:O:P:p:R:IvH",
long_options, &option_index);
if (c == -1)
break;
......@@ -186,6 +208,9 @@ parse_cmdline_args( struct config *config, int argc, char *argv[] )
/* these are the mutually contradictory ones */
case 'H':
usage( 0, CLICA_VERSION_STRING );
exit(0);
case 'I':
config->got_cmd++;
......@@ -287,25 +312,6 @@ parse_cmdline_args( struct config *config, int argc, char *argv[] )
return config;
}
static void
usage( int exit_code, const char *str )
{
fprintf( stderr, "%s\n\n", str );
fprintf( stderr,
"Usage:\tclica\t--initialise --directory dir --domain example.com\\\n"
"\t\t[--ocspurl url] [--crlurl url] [--nosubsign]\n\n"
"\tclica\t--server fqdn.example.com --directory dir\\\n"
"\t\t\t[--orgunit orgunit] [-8 alt1.fqdn.example.com[,alt2...]\n"
"\tclica\t--client fqdn.example.com [--orgunit orgunit]\\\n"
"\t\t\t[--orgunit orgunit] [-8 alt1.fqdn.example.com[,alt2...]\n"
"\tclica\t--server fqdn.example.com --directory dir\\n"
"\t\t\t[--orgunit orgunit] [-8 alt1.fqdn.example.com[,alt2...]\n"
);
exit( exit_code );
}
/***************************************************************************************
* *
cert_dir functions
......
/***************************************************************************************
* *
* version.h
* *
***************************************************************************************/
#ifndef CLICA_VERSION_H
#define CLICA_VERSION_H
#define CLICA_VERSION_NUMBER_STRING "2.0.1"
#define CLICA_VERSION_VERSION "Version V"
#define CLICA_VERSION_STRING CLICA_VERSION_VERSION CLICA_VERSION_NUMBER_STRING
/***************************************************************************************
* *
End of File
* *
* vi: aw ai sw=4 *
***************************************************************************************/
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment