Updated to support actual D-BUS interface
This commit is contained in:
parent
660133c812
commit
9c4c356a3d
9 changed files with 103 additions and 34 deletions
|
@ -24,19 +24,21 @@ int main(int argc, const char* argv[])
|
|||
{ "expression", required_argument, NULL, 'e' },
|
||||
{ "connection", required_argument, NULL, 'c' },
|
||||
{ "identity", required_argument, NULL, 'i' },
|
||||
{ "network", required_argument, NULL, 'n' },
|
||||
{ "link", required_argument, NULL, 'l' },
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
pcre* expression = NULL;
|
||||
const char* file = NULL;
|
||||
uint32_t number = 10;
|
||||
uint32_t network = 0;
|
||||
uint32_t link = 10;
|
||||
|
||||
int position = 0;
|
||||
const char* error = NULL;
|
||||
|
||||
int selection = 0;
|
||||
while ((selection = getopt_long(argc, const_cast<char* const*>(argv), "e:c:l:", options, NULL)) != EOF)
|
||||
while ((selection = getopt_long(argc, const_cast<char* const*>(argv), "e:c:n:l:", options, NULL)) != EOF)
|
||||
switch (selection)
|
||||
{
|
||||
case 'e':
|
||||
|
@ -51,8 +53,12 @@ int main(int argc, const char* argv[])
|
|||
openlog(optarg, 0, LOG_USER);
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
network = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
number = atoi(optarg);
|
||||
link = atoi(optarg);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -64,12 +70,14 @@ int main(int argc, const char* argv[])
|
|||
}
|
||||
|
||||
if ((expression == NULL) ||
|
||||
(network == 0) ||
|
||||
(file == NULL))
|
||||
{
|
||||
printf(
|
||||
"Usage: %s"
|
||||
" --expression <regular expression>"
|
||||
" --connection <path to configuration file>"
|
||||
" --network <network number>"
|
||||
" --link <link number>"
|
||||
" [--identity <identity>]"
|
||||
"\n",
|
||||
|
@ -80,7 +88,7 @@ int main(int argc, const char* argv[])
|
|||
// Main
|
||||
|
||||
UserDataStore store(file);
|
||||
PatchCordProxy proxy(number);
|
||||
PatchCordProxy proxy(network, link);
|
||||
|
||||
char* line = NULL;
|
||||
size_t length = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue