1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
/* -*- c -*-
This file is part of GNU Anubis.
Copyright (C) 2001-2014 The Anubis Team.
GNU Anubis is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
GNU Anubis is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Anubis. If not, see <http://www.gnu.org/licenses/>.
*/
#include <anubisadm.h>
OPTIONS_BEGIN(gnu,"anubisadm",
[<Interface for GNU Anubis database administration.>],
URL,
[<EXAMPLES:\n\n
1. Create the GDBM database from a plaintext file:\n\n
example$ anubisadm --create gdbm:/etc/anubis.db < plaintext\n\n
2. Add SMTP authid "test" with password "guessme" and map it
to the system account "gray":\n\n
example$ anubisadm --add --authid test --password guessme
--user gray gdbm:/etc/anubis.db\n\n
3. List the database:\n\n
example$ anubisadm --list gdbm:/etc/anubis.db\n\n
4. List only the record with authid "test":\n\n
example$ anubisadm --list --authid test gdbm:/etc/anubis.db
\n\n>])
GROUP([<Administration commands:>])
OPTION(create,c,,
Creates the database.)
BEGIN
*operation = op_create;
END
OPTION(list,l,,
List contents of existing database.)
BEGIN
*operation = op_list;
END
OPTION(add,a,,
Add a new record.)
BEGIN
*operation = op_add;
END
OPTION(modify,m,,
Modify existing record.)
BEGIN
*operation = op_modify;
END
OPTION(remove,r,,
Remove existing record.)
BEGIN
rcfile = optarg;
END
GROUP(Options:)
OPTION(authid,i,STRING,
[<Specify the authid to operate upon. This option
is mandatory with --add, --modify and --remove.
It is optional when used with --list.>])
BEGIN
authid = optarg;
END
OPTION(password,p,STRING,
[<Specify the password for the authid. Mandatory
with --add, --modify and --remove.>])
BEGIN
password = optarg;
END
OPTION(user,u,STRING,
[<Specify the system user name corresponding to
the given authid. Optional for --add, --modify and --remove.>])
BEGIN
username = optarg;
END
OPTION(rcfile,f,STRING,
[<Specify the rc file to be used for this authid.
Optional for --add, --modify and --remove.>])
BEGIN
rcfile = optarg;
END
OPTIONS_END
void
adm_get_options (int argc, char *argv[], operation_fp *operation, int *index)
{
GETOPT(argc, argv, *index);
}
|