projects
/
debian
/
amanda
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 3.3.1
[debian/amanda]
/
common-src
/
amservice.c
diff --git
a/common-src/amservice.c
b/common-src/amservice.c
index 286a77059ad103b63cb82c33a57d682c7a993966..b5346a128c5391450abf6dc3bccf366e54285f1c 100644
(file)
--- a/
common-src/amservice.c
+++ b/
common-src/amservice.c
@@
-35,6
+35,12
@@
#include "protocol.h"
#include "amfeatures.h"
#include "event.h"
#include "protocol.h"
#include "amfeatures.h"
#include "event.h"
+#include "getopt.h"
+
+static struct option long_options[] = {
+ {"version" , 0, NULL, 1},
+ {NULL, 0, NULL, 0}
+};
static int copy_stream = 0;
static time_t conf_ctimeout;
static int copy_stream = 0;
static time_t conf_ctimeout;
@@
-58,7
+64,7
@@
static void read_server(void *cookie, void *buf, ssize_t size);
void
usage(void)
{
void
usage(void)
{
- error(_("Usage: amservice [-o configoption]* [-f input_file [-s]] host auth service"));
+ error(_("Usage: amservice [-
-version] [-
o configoption]* [-f input_file [-s]] host auth service"));
/*NOTREACHED*/
}
/*NOTREACHED*/
}
@@
-110,8
+116,11
@@
main(
cfg_ovr = new_config_overrides(argc/2);
input_file = stdin;
cfg_ovr = new_config_overrides(argc/2);
input_file = stdin;
- while((opt = getopt
(argc, argv, "o:f:s"
)) != EOF) {
+ while((opt = getopt
_long(argc, argv, "o:f:s", long_options, NULL
)) != EOF) {
switch(opt) {
switch(opt) {
+ case 1: printf("amservice-%s\n", VERSION);
+ return(0);
+ break;
case 'o': add_config_override_opt(cfg_ovr, optarg);
break;
case 'f': got_input_file = 1;
case 'o': add_config_override_opt(cfg_ovr, optarg);
break;
case 'f': got_input_file = 1;