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
|
#include "options.ih"
// by options1.cc
void Options::checkAction() const
{
// only one of these options may be specified
if (d_list + d_reload + d_terminate + d_foreground > 1)
{
fmsg << "incompatible options:";
if (d_list)
fmsg << " --list";
if (d_reload)
fmsg << " --reload";
if (d_terminate)
fmsg << " --terminate";
if (d_foreground)
fmsg << " --foreground";
fmsg << noid;
}
// if no argument then --list or --terminate are required
if (d_arg.nArgs() == 0)
{
if (not (d_list || d_terminate))
fmsg << "crontab file required" << noid;
}
else if (d_list || d_terminate)
// --list and --terminate cannot accept a crontab file
fmsg << "crontab file incompatible with --list and --terminate" <<
noid;
}
|