subargv[0] is now the expected value of "cellar <command>"
This commit is contained in:
parent
e2382719d5
commit
af056ee961
@ -8,5 +8,5 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
void cellar::bottles::switch_active_bottle(int argc, vector<string> argv) {
|
void cellar::bottles::switch_active_bottle(int argc, vector<string> argv) {
|
||||||
cout << argc << endl;
|
cout << argv[0] << endl;
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,14 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
string usercmd = command.getValue();
|
string usercmd = command.getValue();
|
||||||
if (commands::command_map.count(usercmd) > 0) {
|
if (commands::command_map.count(usercmd) > 0) {
|
||||||
vector<string> subargv = subargs.getValue();
|
vector<string> subargv;
|
||||||
|
stringstream sstr;
|
||||||
|
sstr << "cellar ";
|
||||||
|
sstr << usercmd;
|
||||||
|
subargv.push_back(sstr.str());
|
||||||
|
for (auto item : subargs.getValue()) {
|
||||||
|
subargv.push_back(item);
|
||||||
|
}
|
||||||
commands::command_map[usercmd](subargv.size(), subargv);
|
commands::command_map[usercmd](subargv.size(), subargv);
|
||||||
} else {
|
} else {
|
||||||
cerr << "invalid command: " << usercmd << endl;
|
cerr << "invalid command: " << usercmd << endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user