• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

randombit / botan / 5123321399

30 May 2023 04:06PM UTC coverage: 92.213% (+0.004%) from 92.209%
5123321399

Pull #3558

github

web-flow
Merge dd72f7389 into 057bcbc35
Pull Request #3558: Add braces around all if/else statements

75602 of 81986 relevant lines covered (92.21%)

11859779.3 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/src/cli/main.cpp
1
/*
2
* (C) 2009,2014,2015 Jack Lloyd
3
*
4
* Botan is released under the Simplified BSD License (see license.txt)
5
*/
6

7
#include "cli.h"
8
#include <botan/version.h>
9
#include <algorithm>
10
#include <iostream>
11

12
int main(int argc, char* argv[]) {
6,569✔
13
   std::cerr << Botan::runtime_version_check(BOTAN_VERSION_MAJOR, BOTAN_VERSION_MINOR, BOTAN_VERSION_PATCH);
13,138✔
14

15
   std::string cmd_name = "help";
6,569✔
16

17
   if(argc >= 2) {
6,569✔
18
      cmd_name = argv[1];
6,569✔
19
      if(cmd_name == "--help" || cmd_name == "-h") {
6,569✔
20
         cmd_name = "help";
×
21
      }
22
      if(cmd_name == "--version" || cmd_name == "-V") {
6,569✔
23
         cmd_name = "version";
×
24
      }
25
   }
26

27
   std::unique_ptr<Botan_CLI::Command> cmd(Botan_CLI::Command::get_cmd(cmd_name));
6,569✔
28

29
   if(!cmd) {
6,569✔
30
      std::cerr << "Unknown command " << cmd_name << " (try --help)\n";
×
31
      return 1;
32
   }
33

34
   std::vector<std::string> args(argv + std::min(argc, 2), argv + argc);
13,138✔
35
   return cmd->run(args);
6,569✔
36
}
13,139✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc