If there is more than one file name specified on the command line, assume it is the output file name. This allows to use a more intuitive cp-style command line syntax, which (together with the input type guessing) allows something like: $ dtc input.dts output.dtb (or the other way round) to cover the most common usage scenarios. Signed-off-by: Andre Przywara <osp@xxxxxxxxx> --- dtc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dtc.c b/dtc.c index ba34a06..714d39e 100644 --- a/dtc.c +++ b/dtc.c @@ -159,7 +159,7 @@ int main(int argc, char *argv[]) struct boot_info *bi; const char *inform = NULL; const char *outform = NULL; - const char *outname = "-"; + const char *outname = NULL; const char *depname = NULL; bool force = false, sort = false; const char *arg; @@ -244,9 +244,15 @@ int main(int argc, char *argv[]) } } - if (argc > (optind+1)) + if (argc > (optind + 2)) usage("missing files"); - else if (argc < (optind+1)) + + if (argc > (optind + 1) && outname == NULL) + outname = argv[optind + 1]; + if (outname == NULL) + outname = "-"; + + if (argc < (optind + 1)) arg = "-"; else arg = argv[optind]; -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree-compiler" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html