diff --git a/ChangeLog b/ChangeLog index d1115fd0..f0ae65d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-09-08 Joerg Wunsch + + * main.c: Implement -U filename as a shorthand for + -U flash:w:filename:a. + * avrdude.1: Document this. + * doc/avrdude.texi: (Ditto.) + 2006-09-08 Joerg Wunsch Implement numerical output formats for decimal, hexadecimal, diff --git a/avrdude.1 b/avrdude.1 index c652be0a..cf81e995 100644 --- a/avrdude.1 +++ b/avrdude.1 @@ -534,6 +534,14 @@ contains a colon, the field is no longer optional since the filename part following the colon would otherwise be misinterpreted as .Ar format . +.Pp +As an abbreviation, the form +.Fl U Ar filename +is equivalent to specifying +.Fl U Em flash:w: Ns Ar filename Ns :a . +This will only work if +.Ar filename +does not have a colon in it. .It Fl v Enable verbose output. .It Fl V diff --git a/doc/avrdude.texi b/doc/avrdude.texi index 78939a5c..f6a86bbb 100644 --- a/doc/avrdude.texi +++ b/doc/avrdude.texi @@ -775,6 +775,11 @@ Note that if @var{filename} contains a colon, the @var{format} field is no longer optional since the filename part following the colon would otherwise be misinterpreted as @var{format}. +As an abbreviation, the form @code{-U} @var{filename} +is equivalent to specifying +@code{-U} @emph{flash:w:}@var{filename}@emph{:a}. +This will only work if @var{filename} does not have a colon in it. + @item -v Enable verbose output. diff --git a/main.c b/main.c index 5e00e645..0388d654 100644 --- a/main.c +++ b/main.c @@ -338,9 +338,20 @@ UPDATE * parse_op(char * s) buf[i++] = *p++; if (*p != ':') { - fprintf(stderr, "%s: invalid update specification\n", progname); - free(upd); - return NULL; + upd->memtype = (char *)malloc(strlen("flash")+1); + if (upd->memtype == NULL) { + outofmem: + fprintf(stderr, "%s: out of memory\n", progname); + exit(1); + } + strcpy(upd->memtype, "flash"); + upd->op = DEVICE_WRITE; + upd->filename = (char *)malloc(strlen(buf) + 1); + if (upd->filename == NULL) + goto outofmem; + strcpy(upd->filename, buf); + upd->format = FMT_AUTO; + return upd; } buf[i] = 0;