summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
69deaba)
maxpath + sixdegrees weren't allowing a config file to be specified
in the same fashion as onak. Add the -c option so they do so, which
helps when using these tools in a non-system install setup.
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
+ int optchar;
+ char *configfile = NULL;
+
+ while ((optchar = getopt(argc, argv, "c:")) != -1 ) {
+ switch (optchar) {
+ case 'c':
+ configfile = strdup(optarg);
+ break;
+ }
+ }
+
+ readconfig(configfile);
initlogthing("maxpath", config.logfile);
config.dbbackend->initdb(true);
inithash();
initlogthing("maxpath", config.logfile);
config.dbbackend->initdb(true);
inithash();
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include "hash.h"
#include "keydb.h"
#include "hash.h"
#include "keydb.h"
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(configfile);
initlogthing("sixdegrees", config.logfile);
config.dbbackend->initdb(true);
inithash();
initlogthing("sixdegrees", config.logfile);
config.dbbackend->initdb(true);
inithash();