On Mon, 11 Nov 2002, Eric G. Miller wrote:
On Mon, Nov 11, 2002 at 11:50:51AM -0000, Thomas Dewez wrote:
> Dear all,
>
> I am puzzled by the behaviour of g.rename. The Note in the man pages say:
>
> "However, g.rename will allow the user to overwrite other existing files in the current
> mapset by making the new file name that of an already existing file."
[snip]
> Instead of working smoothly I get the answer:
> <map2> already exists in mapset <blah>
>
> Is there a particular command switch to overwrite the file?
You want the '-o' flag, for overwrite...
This is a bug against the man page. Sometimes people forget to update
the manual... Using the "help" argument to most commands will give you
the definitive brief summary of what flags and arguments the command
takes.
This also explains the strange behaviour of the v.line2area and
v.area2line scripts, which use g.rename without the -o flag. When I first
started using GRASS this puzzled me and I didn't know what to look for; it
would be more obvious now that I'm a little bit more experienced but I
haven't used them for a while.
So somebody should update them (in src/scripts/contrib/v.line2area) to use
the -o flag when they are overwriting the original file. And I suppose if
someone changes the functionality of a command they should check which
other programs and scripts use it (as well as updating the man page)?
Paul
On Mon, Nov 11, 2002 at 07:37:04PM +0000, Paul Kelly wrote:
On Mon, 11 Nov 2002, Eric G. Miller wrote:
> On Mon, Nov 11, 2002 at 11:50:51AM -0000, Thomas Dewez wrote:
> > Dear all,
> >
> > I am puzzled by the behaviour of g.rename. The Note in the man pages say:
> >
> > "However, g.rename will allow the user to overwrite other existing files in the current
> > mapset by making the new file name that of an already existing file."
> [snip]
> > Instead of working smoothly I get the answer:
> > <map2> already exists in mapset <blah>
> >
> > Is there a particular command switch to overwrite the file?
>
> You want the '-o' flag, for overwrite...
>
> This is a bug against the man page. Sometimes people forget to update
> the manual... Using the "help" argument to most commands will give you
> the definitive brief summary of what flags and arguments the command
> takes.
The -o is added to the HTML page now.
This also explains the strange behaviour of the v.line2area and
v.area2line scripts, which use g.rename without the -o flag. When I first
started using GRASS this puzzled me and I didn't know what to look for; it
would be more obvious now that I'm a little bit more experienced but I
haven't used them for a while.
So somebody should update them (in src/scripts/contrib/v.line2area) to use
the -o flag when they are overwriting the original file.
... also done. Thanks!
And I suppose if
someone changes the functionality of a command they should check which
other programs and scripts use it (as well as updating the man page)?
Oh yes. All developers changing a program should also
- update the HTML file
- update the tcltkgrass entry if required
- search for system calls in the GRASS code (with 'find' this can be done
in a few minutes) and update them if required
A "hot" candidate for update is probably the r.mapcalc HTML page.
Markus