| 134 | |
| 135 | |
| 136 | std::string colvarscript::get_command_help(char const *cmd) |
| 137 | { |
| 138 | if (cmd_str_map.count(cmd) > 0) { |
| 139 | colvarscript::command const c = cmd_str_map[std::string(cmd)]; |
| 140 | std::string new_result(cmd_help[c]+"\n"); |
| 141 | if (cmd_n_args_max[c] == 0) return new_result; |
| 142 | new_result += "\nParameters\n"; |
| 143 | new_result += "----------\n\n"; |
| 144 | size_t i; |
| 145 | for (i = 0; i < cmd_n_args_min[c]; i++) { |
| 146 | new_result += cmd_arghelp[c][i]+"\n"; |
| 147 | } |
| 148 | for (i = cmd_n_args_min[c]; i < cmd_n_args_max[c]; i++) { |
| 149 | new_result += cmd_arghelp[c][i]+" (optional)\n"; |
| 150 | } |
| 151 | return new_result; |
| 152 | } |
| 153 | |
| 154 | cvm::error("Error: command "+std::string(cmd)+ |
| 155 | " is not implemented.\n", INPUT_ERROR); |
| 156 | return std::string(""); |
| 157 | } |
| 158 | |
| 159 | |
| 160 | std::string colvarscript::get_command_cmdline_syntax(colvarscript::Object_type t, |