LCOV - code coverage report
Current view: top level - src/esys/repo/cli - cmdmulti_cli.cpp (source / functions) Hit Total Coverage
Test: esysrepo_coverage.info Lines: 4 28 14.3 %
Date: 2026-08-01 10:43:40 Functions: 2 6 33.3 %

          Line data    Source code
       1             : /*!
       2             :  * \file esys/repo/cli/cmdmulti_cli.cpp
       3             :  * \brief
       4             :  *
       5             :  * \cond
       6             :  * __legal_b__
       7             :  *
       8             :  * Copyright (c) 2023 Michel Gillet
       9             :  * Distributed under the MIT License.
      10             :  * (See accompanying file LICENSE.txt or
      11             :  * copy at https://opensource.org/licenses/MIT)
      12             :  *
      13             :  * __legal_e__
      14             :  * \endcond
      15             :  *
      16             :  */
      17             : 
      18             : #include "esys/repo/esysrepo_prec.h"
      19             : #include "esys/repo/cli/cmdmulti.h"
      20             : 
      21             : namespace esys::repo::cli
      22             : {
      23             : 
      24          16 : CmdMulti::CmdMulti(AppBase *app)
      25          32 :     : BaseType(app, "multi", "Handle branches from multiple repositories")
      26             : {
      27          16 : }
      28             : 
      29          16 : CmdMulti::~CmdMulti() = default;
      30             : 
      31           0 : int CmdMulti::configure_cmd(CmdType &cmd)
      32             : {
      33           0 :     if (get_vm().count("capture"))
      34           0 :         cmd.set_task(CmdType::Task::CAPTURE);
      35           0 :     else if (get_vm().count("show"))
      36           0 :         cmd.set_task(CmdType::Task::SHOW);
      37           0 :     else if (get_vm().count("delete"))
      38           0 :         cmd.set_task(CmdType::Task::DELETE);
      39           0 :     else if (get_vm().count("push"))
      40           0 :         cmd.set_task(CmdType::Task::PUSH);
      41             : 
      42           0 :     return 0;
      43             : }
      44             : 
      45           0 : std::shared_ptr<po::options_description> CmdMulti::get_desc()
      46             : {
      47           0 :     auto desc = Cmd::get_desc();
      48           0 :     if (desc != nullptr) return desc;
      49             : 
      50           0 :     desc = std::make_shared<po::options_description>("Multi options");
      51             :     // clang-format off
      52           0 :     desc->add_options()
      53           0 :         ("capture,c", "capture the branch different from manifest for all repositories")
      54           0 :         ("show,s", "show the captured branches")
      55           0 :         ("delete,d", "delete the captured branches")
      56           0 :         ("push,p", "push the captured branches")
      57             :         ;
      58             :     // clang-format on
      59           0 :     Cmd::set_desc(desc);
      60           0 :     return desc;
      61           0 : }
      62             : 
      63           0 : int CmdMulti::print_doc(std::ostream &os)
      64             : {
      65           0 :     return -1;
      66             : }
      67             : 
      68             : } // namespace esys::repo::cli

Generated by: LCOV version 1.14