ENT-14398: Moved event driven cfengine into cf-reactor - #6290
Conversation
a26acb5 to
22ff75c
Compare
4407d5a to
be99f9c
Compare
larsewi
left a comment
There was a problem hiding this comment.
I see that cf-watchd has some options not present here. Is this intended?
78cb159 to
1468b22
Compare
|
@cf-bottom jenkins, please :) |
|
Sure, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/14553/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-14553/ |
1468b22 to
adee2f2
Compare
Ticket: ENT-14398 Signed-off-by: Victor Moene <victor.moene@northern.tech>
adee2f2 to
a76c759
Compare
| /* long options only */ | ||
| case 0: | ||
| { | ||
| // TODO: handle long options if they are added in the future |
There was a problem hiding this comment.
What happens now if a long option is passed?
There was a problem hiding this comment.
This code never gets run since we haven't defined any long option
There was a problem hiding this comment.
static const struct option OPTIONS[] =
{
{"debug", no_argument, 0, 'd'},
{"no-fork", no_argument, 0, 'F'},
{"log-level", required_argument, 0, 'g'},
{"help", no_argument, 0, 'h'},
{"inform", no_argument, 0, 'I'},
{"timestamp", no_argument, 0, 'l'},
{"man", no_argument, 0, 'M'},
{"verbose", no_argument, 0, 'v'},
{"version", no_argument, 0, 'V'},
{NULL, 0, 0, '\0'}
};Aren't you defining them here, to the left?
There was a problem hiding this comment.
Maybe the comment is deceptive: this case handles option that don't have a short form. Ex from cf-agent;
static const struct option OPTIONS[] =
{
{"bootstrap", required_argument, 0, 'B'},
{"bundlesequence", required_argument, 0, 'b'},
{"workdir", required_argument, 0, 'w'},
{"debug", no_argument, 0, 'd'},
{"define", required_argument, 0, 'D'},
{"self-diagnostics", optional_argument, 0, 'x'},
{"dry-run", no_argument, 0, 'n'},
{"file", required_argument, 0, 'f'},
{"help", no_argument, 0, 'h'},
{"inform", no_argument, 0, 'I'},
{"log-level", required_argument, 0, 'g'},
{"negate", required_argument, 0, 'N'},
{"no-lock", no_argument, 0, 'K'},
{"verbose", no_argument, 0, 'v'},
{"version", no_argument, 0, 'V'},
{"timing-output", no_argument, 0, 't'},
{"trust-server", optional_argument, 0, 'T'},
{"color", optional_argument, 0, 'C'},
{"no-extensions", no_argument, 0, 'E'},
{"timestamp", no_argument, 0, 'l'},
{"profile", no_argument, 0, 'p'},
/* Only long option for the rest */
{"ignore-preferred-augments", no_argument, 0, 0},
{"log-modules", required_argument, 0, 0},
{"no-augments", no_argument, 0, 0},
{"no-host-specific-data", no_argument, 0, 0},
{"show-evaluated-classes", optional_argument, 0, 0 },
{"show-evaluated-vars", optional_argument, 0, 0 },
{"skip-bootstrap-policy-run", no_argument, 0, 0 },
{"skip-bootstrap-service-start", no_argument, 0, 0 },
{"skip-db-check", optional_argument, 0, 0 },
{"simulate", required_argument, 0, 0},
{NULL, 0, 0, '\0'}
};There was a problem hiding this comment.
But every option has a short option. Hence, the case 0: is dead code, and should not be there
There was a problem hiding this comment.
It's better to remove it, then have it in case we need it in the future.
No description provided.