MCPcopy Create free account
hub / github.com/alibaba/MNN / Parse

Method Parse

apps/mnncli/src/cli_command_parser.cpp:40–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40ParsedCommand CommandParser::Parse() {
41 ParseGlobalOptions();
42
43 ParsedCommand cmd;
44 cmd.verbose = verbose_;
45
46 if (argc_ < 2) {
47 return cmd;
48 }
49
50 cmd.command = argv_[1];
51
52 if (!spec_) {
53 // No spec, just collect all args as positional
54 for (int i = 2; i < argc_; i++) {
55 std::string arg = argv_[i];
56 if (!IsShortOption(arg) && !IsLongOption(arg)) {
57 cmd.arguments.push_back(arg);
58 }
59 }
60 return cmd;
61 }
62
63 ParseCommandOptions(cmd);
64
65 if (spec_) {
66 ValidateParsedCommand(cmd);
67 }
68
69 return cmd;
70}
71
72void CommandParser::ParseCommandOptions(ParsedCommand& cmd) {
73 for (int i = 2; i < argc_; i++) {

Callers 15

CalibrationMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
testconvertMethod · 0.45
json2mnnMethod · 0.45

Calls 1

push_backMethod · 0.45

Tested by 5

mainFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36