1.2.1 fixes

* fixed missing output file function on -o
* fixed -o showing log
* help tweaks
This commit is contained in:
zawz 2019-08-23 22:46:47 +02:00
parent 8d3d8f8ceb
commit 8486fa3984
2 changed files with 14 additions and 4 deletions

View file

@ -6,6 +6,8 @@ Device <name>
<tag>=<value> <tag>=<value>
<tag>=<value> <tag>=<value>
... ...
Command <type>
...
Device <name> Device <name>
... ...
@ -19,4 +21,5 @@ Device <name>
> mandatory > mandatory
Shell command can be concatenated with \"\" or '' Shell command can be concatenated with \"\" or ''
Comments are written by starting a line with //
see --command-tags for optional command tags see --command-tags for optional command tags

View file

@ -22,7 +22,9 @@ void help()
{ {
printf("zmidimap [options] <file>\n\nOptions:\n"); printf("zmidimap [options] <file>\n\nOptions:\n");
options.print_help(4, 25); options.print_help(4, 25);
printf("\nSee --zfd-format --command-tags --shell-format options for details on map file format\n"); printf("\n");
printf("If piped, the map file will be read from standard input\n");
printf("See --mim-format --zfd-format --command-tags --shell-format options for details on map file format\n");
} }
void version() void version()
@ -92,9 +94,9 @@ int main(int argc, char* argv[])
options.add(ztd::option('L',"full-list", false, "Print whole device list details")); options.add(ztd::option('L',"full-list", false, "Print whole device list details"));
options.add(ztd::option('p',"port", true, "Connect to device and output to console", "device")); options.add(ztd::option('p',"port", true, "Connect to device and output to console", "device"));
options.add(ztd::option("\r [Map file]")); options.add(ztd::option("\r [Map file]"));
options.add(ztd::option('o',"output", true, "Output the resulting zfd map to file. - for stdout"));
options.add(ztd::option('m',"mim", false, "Read file in mim format")); options.add(ztd::option('m',"mim", false, "Read file in mim format"));
options.add(ztd::option('z',"zfd", false, "Read file in zfd format")); options.add(ztd::option('z',"zfd", false, "Read file in zfd format"));
options.add(ztd::option('o',"output", true, "Output the resulting zfd map to file. - for stdout", "file"));
options.add(ztd::option("aligner", true, "String to use for aligning output map format. Default \\t", "string")); options.add(ztd::option("aligner", true, "String to use for aligning output map format. Default \\t", "string"));
options.add(ztd::option("\rIf no file format is specified, the program will try to guess the format")); options.add(ztd::option("\rIf no file format is specified, the program will try to guess the format"));
// options.add(ztd::option('i',"interactive", false, "Start in interactive mode")); // options.add(ztd::option('i',"interactive", false, "Start in interactive mode"));
@ -160,6 +162,11 @@ int main(int argc, char* argv[])
stop(0); stop(0);
} }
if (options.find('o')->activated)
{
log_on=false;
}
//behavioral options //behavioral options
if( options.find("no-log")->activated ) if( options.find("no-log")->activated )
{ {
@ -227,12 +234,12 @@ int main(int argc, char* argv[])
std::cout << file.strval(aligner) << std::endl; std::cout << file.strval(aligner) << std::endl;
} }
else { else {
file.setFilePath(options.find('o')->argument);
file.export_file();
} }
return 0; return 0;
} }
//create commands //create commands
// potential parallel improvement
for(int i=0 ; i<file.data().listSize() ; i++) for(int i=0 ; i<file.data().listSize() ; i++)
{ {
Device *newDevice = new Device; Device *newDevice = new Device;