예제 #1
0
파일: client.cpp 프로젝트: movb/testapp
Commands prepareCommands() {
    Commands commands;
    commands.push_back(Command {"set-led-state", "Set led state", {"on", "off"}});
    commands.push_back(Command {"get-led-state", "Get led state", {}});
    commands.push_back(Command {"set-led-color", "Set led color (red, green or blue)", {"red", "green", "blue"}});
    commands.push_back(Command {"get-led-color", "Get led color", {}});
    commands.push_back(Command {"set-led-rate", "Set led rate (0..5 Hz)", {"0", "1", "2", "3", "4", "5"}});
    commands.push_back(Command {"get-led-rate", "Get led rate", {}});

    return commands;
}
예제 #2
0
void VDDialogEditAccelerators::RefilterCommands(const char *pattern) {
	mFilteredCommands.clear();

	LBClear(IDC_AVAILCOMMANDS);

	Commands::const_iterator it(mAllCommands.begin()), itEnd(mAllCommands.end());
	for(; it != itEnd; ++it) {
		const VDAccelToCommandEntry& ent = **it;

		if (VDFileWildMatch(pattern, ent.mpName)) {
			const VDStringW s(VDTextAToW(ent.mpName));

			mFilteredCommands.push_back(&ent);
			LBAddString(IDC_AVAILCOMMANDS, s.c_str());
		}
	}

	LBSetSelectedIndex(IDC_AVAILCOMMANDS, 0);
}
 void add(CommandHandle cmd) {
   cmds.push_back(cmd);
 }
예제 #4
0
파일: Teashell.cpp 프로젝트: airk42/teasafe
void populateCommands()
{
    {
        CommandDescriptor command("ls","list entries in current folder","ls");
        g_availableCommands.push_back(command);
    }
    {
        CommandDescriptor command("pwd","display current working dir","pwd");
        g_availableCommands.push_back(command);
    }
    {
        CommandDescriptor command("mkdir","create folder","mkdir <folderName>");
        g_availableCommands.push_back(command);
    }
    {
        CommandDescriptor command("push","change to folder","push <folderName>");
        g_availableCommands.push_back(command);
    }
    {
        CommandDescriptor command("pop","change to previous folder","pop");
        g_availableCommands.push_back(command);
    }
    {
        CommandDescriptor command("cd","change to folder","cd <folderName>");
        g_availableCommands.push_back(command);
    }
    {
        CommandDescriptor command("rm","remove entry","rm <entryName>");
        g_availableCommands.push_back(command);
    }
    {
        CommandDescriptor command("add","add a file or folder to current working dir","add <file:///path/to/thing>");
        g_availableCommands.push_back(command);
    }
    {
        CommandDescriptor command("extract","extract a file or folder","extract <entryName> <file:///place/to/extract>");
        g_availableCommands.push_back(command);
    }
    {
        CommandDescriptor command("help","list available commands","help");
        g_availableCommands.push_back(command);
    }
    {
        CommandDescriptor command("quit","exit the shell","quit");
        g_availableCommands.push_back(command);
    }
    {
        CommandDescriptor command("exit","exit the shell","exit");
        g_availableCommands.push_back(command);
    }
}