projects
/
onak.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update Debian Vcs-* fields to point to git repository
[onak.git]
/
sixdegrees.c
diff --git
a/sixdegrees.c
b/sixdegrees.c
index e6a35947b00a3030c905a54ea36ef4c7617ab28d..738f6264b6c1c17c8f1e959ceb27f4a805147181 100644
(file)
--- a/
sixdegrees.c
+++ b/
sixdegrees.c
@@
-17,8
+17,10
@@
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "hash.h"
#include "keydb.h"
#include "hash.h"
#include "keydb.h"
@@
-132,13
+134,23
@@
void sixdegrees(uint64_t keyid)
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
+ int optchar;
+ char *configfile = NULL;
uint64_t keyid = 0x2DA8B985;
uint64_t keyid = 0x2DA8B985;
- if (argc == 2) {
- keyid = strtoll(argv[1], NULL, 16);
+ while ((optchar = getopt(argc, argv, "c:")) != -1 ) {
+ switch (optchar) {
+ case 'c':
+ configfile = strdup(optarg);
+ break;
+ }
+ }
+
+ if (optind < argc) {
+ keyid = strtoll(argv[optind], NULL, 16);
}
}
- readconfig(
NULL
);
+ readconfig(
configfile
);
initlogthing("sixdegrees", config.logfile);
config.dbbackend->initdb(true);
inithash();
initlogthing("sixdegrees", config.logfile);
config.dbbackend->initdb(true);
inithash();