import-trace: help sports all available importers
This change extends import-trace's help functionality for importers, adds the ?-operator to option "-i" and refactors main.cc a little. The extensions are "doing something useful with the AliasedRegistry" and are merely listings of all importers' prime aliases. Change-Id: I7bb184fc45dd9f90664e37455edfccc704d99ef1
This commit is contained in:
@ -101,9 +101,10 @@ int main(int argc, char *argv[]) {
|
|||||||
CommandLine::option_handle BENCHMARK =
|
CommandLine::option_handle BENCHMARK =
|
||||||
cmd.addOption("b", "benchmark", Arg::Required,
|
cmd.addOption("b", "benchmark", Arg::Required,
|
||||||
"-b/--benchmark \tBenchmark label (default: \"none\")\n");
|
"-b/--benchmark \tBenchmark label (default: \"none\")\n");
|
||||||
CommandLine::option_handle IMPORTER =
|
|
||||||
cmd.addOption("i", "importer", Arg::Required,
|
std::string importer_help = "-i/--importer \tWhich import method to use (default: MemoryImporter); available import methods: " + importers;
|
||||||
"-i/--importer \tWhich import method to use (default: MemoryImporter)");
|
CommandLine::option_handle IMPORTER = cmd.addOption("i", "importer", Arg::Required, importer_help);
|
||||||
|
|
||||||
CommandLine::option_handle ELF_FILE =
|
CommandLine::option_handle ELF_FILE =
|
||||||
cmd.addOption("e", "elf-file", Arg::Required,
|
cmd.addOption("e", "elf-file", Arg::Required,
|
||||||
"-e/--elf-file \tELF File (default: UNSET)");
|
"-e/--elf-file \tELF File (default: UNSET)");
|
||||||
@ -154,7 +155,10 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
// try and get the according importer object ; die on failure
|
// try and get the according importer object ; die on failure
|
||||||
if ((importer = (Importer *)registry.get(imp)) == 0) {
|
if ((importer = (Importer *)registry.get(imp)) == 0) {
|
||||||
LOG << "Unknown import method: " << imp << endl;
|
if (imp != "?" ) {
|
||||||
|
std::cerr << "Unknown import method: " << imp << std::endl;
|
||||||
|
}
|
||||||
|
std::cerr << "Available import methods: " << importers << std::endl;
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user