MCPcopy Create free account
hub / github.com/alpha-liu-01/SpeedyNote / parseCommand

Function parseCommand

source/cli/CliParser.cpp:52–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52Command parseCommand(int argc, char* argv[])
53{
54 if (argc < 2) {
55 return Command::None;
56 }
57
58 const char* arg1 = argv[1];
59
60 // Check for commands
61 if (std::strcmp(arg1, "export-pdf") == 0) {
62 return Command::ExportPdf;
63 }
64 if (std::strcmp(arg1, "export-snbx") == 0) {
65 return Command::ExportSnbx;
66 }
67 if (std::strcmp(arg1, "import") == 0) {
68 return Command::Import;
69 }
70
71 // Check for global flags
72 if (std::strcmp(arg1, "--help") == 0 || std::strcmp(arg1, "-h") == 0) {
73 return Command::Help;
74 }
75 if (std::strcmp(arg1, "--version") == 0 || std::strcmp(arg1, "-v") == 0) {
76 return Command::Version;
77 }
78
79 return Command::None;
80}
81
82QString commandName(Command cmd)
83{

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected