-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelp.cc
52 lines (38 loc) · 1.04 KB
/
help.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <iostream>
#include <string>
#include <vector>
#include <config.h>
#include "common.h"
namespace app {
namespace commands {
static std::vector<std::string> commands_list = {
{CMD_INIT},
{CMD_BUILD},
{CMD_NEW},
{CMD_ADD},
{CMD_SHOW},
{CMD_INSTALL},
{CMD_SEARCH},
{CMD_CLEAN},
{CMD_CLEAN_ALL},
{CMD_RUN_TARGET}
};
auto is_command( const std::string_view cmd ) -> bool {
for (const auto& c : commands_list) {
if (cmd == c)
return true;
}
return false;
}
auto help( std::string_view args ) {
using namespace std;
if ( args.empty( ) ) {
for ( const auto& c : commands_list ) {
cout << '\t' << c << '\n';
}
return true;
}
return true;
}
} // namespace commands
} // namespace app