Support -f for mv

At the moment this does nothing as we do not check anyway.
This commit is contained in:
sin 2013-09-27 15:45:39 +01:00
parent 8c87c20054
commit 82bff35228
2 changed files with 9 additions and 1 deletions

6
mv.1
View File

@ -3,10 +3,12 @@
mv \- move files and directories mv \- move files and directories
.SH SYNOPSIS .SH SYNOPSIS
.B mv .B mv
.RB [ \-f ]
.I file .I file
.RI [ name ] .RI [ name ]
.P .P
.B mv .B mv
.RB [ \-f ]
.RI [ file ...] .RI [ file ...]
.RI [ directory ] .RI [ directory ]
.SH DESCRIPTION .SH DESCRIPTION
@ -14,3 +16,7 @@ mv \- move files and directories
moves or renames a given file or directory, naming it the given name. If moves or renames a given file or directory, naming it the given name. If
multiple files and directories are listed they will be moved into the given multiple files and directories are listed they will be moved into the given
directory. directory.
.SH OPTIONS
.TP
.B \-f
do not prompt for confirmation before overwriting the destination path.

4
mv.c
View File

@ -12,7 +12,7 @@ int mv(const char *, const char *);
static void static void
usage(void) usage(void)
{ {
eprintf("usage: %s source... dest\n", argv0); eprintf("usage: %s [-f] source... dest\n", argv0);
} }
int int
@ -21,6 +21,8 @@ main(int argc, char *argv[])
struct stat st; struct stat st;
ARGBEGIN { ARGBEGIN {
case 'f':
break;
default: default:
usage(); usage();
} ARGEND; } ARGEND;