Help command aliases (#306)
* changes to help info loading * updated sample help command config file * updated test config file
This commit is contained in:
		
							parent
							
								
									9232b59e26
								
							
						
					
					
						commit
						03ee9337d2
					
				
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -1,21 +1,29 @@ | ||||
| [ | ||||
|    { | ||||
|       "name":"foo", | ||||
|       "names": [ | ||||
|          "foo" | ||||
|       ], | ||||
|       "usage":"/foo <bar> [baz|qux]", | ||||
|       "text":"A sample explanation." | ||||
|    }, | ||||
|    { | ||||
|       "name":"login", | ||||
|       "names": [ | ||||
|          "login" | ||||
|       ], | ||||
|       "usage":"/login", | ||||
|       "text":"Activates the login dialogue to enter your credentials. This command takes no arguments." | ||||
|    }, | ||||
|    { | ||||
|       "name":"getareas", | ||||
|       "names": [ | ||||
|          "getareas" | ||||
|       ], | ||||
|       "usage":"/getareas", | ||||
|       "text":"Lists all clients in all areas. This command takes no arguments." | ||||
|    }, | ||||
|    { | ||||
|       "name":"getarea", | ||||
|       "names": [ | ||||
|          "getarea" | ||||
|       ], | ||||
|       "usage":"/getarea", | ||||
|       "text":"Lists all clients in the area the caller is in. This command takes no arguments." | ||||
|    } | ||||
|  | ||||
| @ -199,21 +199,25 @@ void ConfigManager::loadCommandHelp() | ||||
|     // Akashi expects the helpfile to contain multiple entires, so it always checks for an array first.
 | ||||
|     QJsonArray l_Json_root_array = l_help_list_json.array(); | ||||
|     QJsonObject l_child_obj; | ||||
|     QJsonArray l_names; | ||||
| 
 | ||||
|     for (int i = 0; i <= l_Json_root_array.size() - 1; i++) { | ||||
|     for (int i = 0; i < l_Json_root_array.size(); i++) { | ||||
|         l_child_obj = l_Json_root_array.at(i).toObject(); | ||||
|         QString l_name = l_child_obj["name"].toString(); | ||||
|         l_names = l_child_obj["names"].toArray(); | ||||
|         QString l_usage = l_child_obj["usage"].toString(); | ||||
|         QString l_text = l_child_obj["text"].toString(); | ||||
| 
 | ||||
|         for (int j = 0; j < l_names.size(); j++) { | ||||
|             QString l_name = l_names.at(j).toString(); | ||||
|             if (!l_name.isEmpty()) { | ||||
|             help l_help_information; | ||||
|             l_help_information.usage = l_usage; | ||||
|             l_help_information.text = l_text; | ||||
|                 help l_help_information = { | ||||
|                     .usage = l_usage, | ||||
|                     .text = l_text}; | ||||
| 
 | ||||
|                 m_commands_help->insert(l_name, l_help_information); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| QSettings *ConfigManager::areaData() | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 cow-face
						cow-face