tool/CommandAlias.cpp
changeset 1157 04d1c950cf9d
parent 1151 1fc1535dec29
child 1166 006244d53f68
equal deleted inserted replaced
1156:ecaf2a896ea3 1157:04d1c950cf9d
    31         << getBriefDescription() << endl
    31         << getBriefDescription() << endl
    32         << endl
    32         << endl
    33         << "Arguments:" << endl
    33         << "Arguments:" << endl
    34         << "  ALIAS must be an unsigned 16 bit number. Zero means" << endl
    34         << "  ALIAS must be an unsigned 16 bit number. Zero means" << endl
    35         << "        removing an alias address." << endl
    35         << "        removing an alias address." << endl
    36         << endl << endl
    36         << endl
       
    37         << "If multiple slaves are selected, the --force option" << endl
       
    38         << "is required." << endl
       
    39         << endl
    37         << "Command-specific options:" << endl
    40         << "Command-specific options:" << endl
    38         << "  --slave -s <index>  Positive numerical ring position, or 'all'"
    41         << "  --alias    -a <alias>" << endl
    39         << endl
    42         << "  --position -p <pos>    Slave selection. See the help of" << endl
    40         << "                      for all slaves (default). The --force"
    43         << "                         the 'slaves' command." << endl
    41         << endl
    44         << "  --force    -f          Acknowledge writing aliases of" << endl
    42         << "                      option is required in this case." << endl
    45         << "                         multiple slaves." << endl
    43         << "  --force -f          Acknowledge writing aliases of all" << endl
       
    44         << "                      slaves." << endl
       
    45         << endl
    46         << endl
    46         << numericInfo();
    47         << numericInfo();
    47 
    48 
    48     return str.str();
    49     return str.str();
    49 }
    50 }
    81     if (slaves.size() > 1 && !force) {
    82     if (slaves.size() > 1 && !force) {
    82         err << "This will write the alias addresses of "
    83         err << "This will write the alias addresses of "
    83             << slaves.size() << " slaves to " << alias
    84             << slaves.size() << " slaves to " << alias
    84             << "! Please specify --force to proceed.";
    85             << "! Please specify --force to proceed.";
    85         throwCommandException(err);
    86         throwCommandException(err);
       
    87     }
       
    88 
       
    89     if (!slaves.size() && getVerbosity() != Quiet) {
       
    90         cerr << "Warning: Selection matches no slaves!" << endl;
    86     }
    91     }
    87 
    92 
    88     for (si = slaves.begin(); si != slaves.end(); si++) {
    93     for (si = slaves.begin(); si != slaves.end(); si++) {
    89         writeSlaveAlias(m, *si, alias);
    94         writeSlaveAlias(m, *si, alias);
    90     }
    95     }