blob: 679d7a9919a1df4514e5bab26333c37aec3b0a14 [file] [log] [blame]
// Copyright 2024 Google LLC
//
// 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.
#include "cli_parser.hpp"
#include "dbus_interface.hpp"
#include "hoth_dbus.hpp"
#include "parser.hpp"
#include "payload_update_cli.hpp"
#include "payload_update_common.hpp"
#include <iostream>
int main(int argc, char* argv[])
{
using namespace google::hoth::tools;
auto cli = payload_update::PayloadUpdateCLI(
std::make_unique<CLIParser>(argc, argv), std::make_unique<HothDBus>());
if (!cli.getOptions())
{
return EXIT_FAILURE;
}
if (!cli.execute())
{
std::cerr << argv[0] << ": Failed to execute command!" << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}