subargv[0] is now the expected value of "cellar <command>"
This commit is contained in:
		@@ -8,5 +8,5 @@
 | 
			
		||||
using namespace std;
 | 
			
		||||
 | 
			
		||||
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();
 | 
			
		||||
        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);
 | 
			
		||||
        } else {
 | 
			
		||||
            cerr << "invalid command: " << usercmd << endl;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user