Add mandoc-manpage for mv(1)

and mark it as finished in README.
Make it clear that -i has not been implemented yet and drop the
flag in the code instead of erroring out.
This commit is contained in:
FRIGN 2015-01-28 22:06:50 +01:00
parent 409db4e5d7
commit 7437901098
3 changed files with 39 additions and 24 deletions

2
README
View File

@ -45,7 +45,7 @@ The following tools are implemented ('*' == finished, '#' == UTF-8 support,
=* mkdir yes none =* mkdir yes none
=* mkfifo yes none =* mkfifo yes none
= mktemp non-posix none = mktemp non-posix none
= mv yes (-i) =* mv yes (-i)
= nice yes none = nice yes none
= nl no -d, -f, -h, -l, -n, -p, -v, -w = nl no -d, -f, -h, -l, -n, -p, -v, -w
= nohup yes none = nohup yes none

58
mv.1
View File

@ -1,22 +1,36 @@
.TH MV 1 sbase\-VERSION .Dd January 28, 2015
.SH NAME .Dt MV 1 sbase\-VERSION
mv \- move files and directories .Sh NAME
.SH SYNOPSIS .Nm mv
.B mv .Nd move files and directories
.RB [ \-f ] .Sh SYNOPSIS
.I file .Nm mv
.RI [ name ] .Op Fl f | Fl i
.P .Ar source ...
.B mv .Ar destination
.RB [ \-f ] .Sh DESCRIPTION
.RI [ file ...] .Nm
.RI [ directory ] moves each
.SH DESCRIPTION .Ar source
.B mv to
moves or renames a given file or directory, naming it the given name. If .Ar destination .
multiple files and directories are listed they will be moved into the given If only one
directory. .Ar source
.SH OPTIONS is given and
.TP .Ar destination
.B \-f is not a directory,
do not prompt for confirmation before overwriting the destination path. .Nm
overwrites the latter with the former.
.Sh OPTIONS
.Bl -tag -width Ds
.It Fl f | Fl i
Do not prompt | Prompt before overwriting
.Ar destination .
Prompting has not been implemented yet.
.El
.Sh STANDARDS
The
.Nm
utility is compliant with the
.St -p1003.1-2008
specification except from prompting.

3
mv.c
View File

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