| 205 | } |
| 206 | |
| 207 | int _main(int argc, char** argv) |
| 208 | { |
| 209 | ArgHandler handler("unpacker options [PACKED_FILE] [optional]"); |
| 210 | handler.setHelp( |
| 211 | "Options are divided into groups. If the command-line argument belongs to any group,\n" |
| 212 | "all other arguments must be from the same group. If they are not, they are ignored.\n" |
| 213 | "The groups are parsed in the order given in this help. It is required to input the\n" |
| 214 | "argument from one of the groups.\n" |
| 215 | "\n" |
| 216 | "The command-line arguments, which doesn't belong to any group can be used alongside any group.\n" |
| 217 | "\n" |
| 218 | "General group:\n" |
| 219 | " -h|--help Show this help message.\n" |
| 220 | " -v|--version Show RetDec version.\n" |
| 221 | "\n" |
| 222 | "Listing group:\n" |
| 223 | " -p|--plugins Show the list of all available plugins.\n" |
| 224 | "\n" |
| 225 | "Unpacking group:\n" |
| 226 | " PACKED_FILE Specify the packed file, which is needed to be unpacked.\n" |
| 227 | " -o|--output FILE Optional. Specify the output file of unpacking as FILE.\n" |
| 228 | " Default value is 'PACKED_FILE-unpacked'.\n" |
| 229 | "\n" |
| 230 | "Non-group optional arguments:\n" |
| 231 | " -b|--brute Tell unpacker to run plugins in the brute mode. Plugins may or may not\n" |
| 232 | " implement brute methods for unpacking. They can completely ignore this argument.\n" |
| 233 | " --max-memory N Limit maximal memory to N bytes.\n" |
| 234 | " --max-memory-half-ram Limit maximal memory to half of system RAM." |
| 235 | ); |
| 236 | |
| 237 | handler.registerArg('h', "help", false); |
| 238 | handler.registerArg('v', "version", false); |
| 239 | handler.registerArg('o', "output", true); |
| 240 | handler.registerArg('p', "plugins", false); |
| 241 | handler.registerArg('b', "brute", false); |
| 242 | handler.registerArg('m', "max-memory", true); |
| 243 | handler.registerArg('M', "max-memory-half-ram", false); |
| 244 | |
| 245 | return processArgs(handler, argc, argv); |
| 246 | } |
| 247 | |
| 248 | } // namespace unpackertool |
| 249 | } // namespace retdec |
no test coverage detected