/**
 * Copyright © 2017 IBM Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * This application will check the ActiveState property
 * on the source unit passed in.  If that state is 'failed',
 * then it will either stop or start the target unit, depending
 * on the command line arguments.
 */
#include "monitor.hpp"

#include <CLI/CLI.hpp>

#include <map>
#include <string>

using namespace phosphor::unit::failure;

static const std::map<std::string, Monitor::Action> actions = {
    {"start", Monitor::Action::start}, {"stop", Monitor::Action::stop}};

int main(int argc, char** argv)
{
    CLI::App app;
    std::string source;
    std::string target;
    Monitor::Action action{Monitor::Action::start};

    app.add_option("-s,--source", source, "The source unit to monitor")
        ->required();
    app.add_option("-t,--target", target, "The target unit to start or stop")
        ->required();
    app.add_option("-a,--action", action, "Target unit action - start or stop")
        ->required()
        ->transform(CLI::CheckedTransformer(actions, CLI::ignore_space));

    CLI11_PARSE(app, argc, argv);
    Monitor monitor{source, target, action};

    monitor.analyze();

    return 0;
}
