Skip to content

Commit

Permalink
1.2.1 fixes
Browse files Browse the repository at this point in the history
* fixed missing output file function on -o
* fixed -o showing log
* help tweaks
  • Loading branch information
zawwz committed Aug 23, 2019
1 parent 8d3d8f8 commit 8486fa3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions help_format/mim-format
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Device <name>
<tag>=<value>
<tag>=<value>
...
Command <type>
...

Device <name>
...
Expand All @@ -19,4 +21,5 @@ Device <name>
> mandatory

Shell command can be concatenated with \"\" or ''
Comments are written by starting a line with //
see --command-tags for optional command tags
15 changes: 11 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ void help()
{
printf("zmidimap [options] <file>\n\nOptions:\n");
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()
Expand Down Expand Up @@ -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('p',"port", true, "Connect to device and output to console", "device"));
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('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("\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"));
Expand Down Expand Up @@ -160,6 +162,11 @@ int main(int argc, char* argv[])
stop(0);
}

if (options.find('o')->activated)
{
log_on=false;
}

//behavioral options
if( options.find("no-log")->activated )
{
Expand Down Expand Up @@ -227,12 +234,12 @@ int main(int argc, char* argv[])
std::cout << file.strval(aligner) << std::endl;
}
else {

file.setFilePath(options.find('o')->argument);
file.export_file();
}
return 0;
}
//create commands
// potential parallel improvement
for(int i=0 ; i<file.data().listSize() ; i++)
{
Device *newDevice = new Device;
Expand Down

0 comments on commit 8486fa3

Please # to comment.