[hackers] [sbase] Add mandoc-manpage for mv(1) || FRIGN

From: <git_AT_suckless.org>
Date: Wed, 28 Jan 2015 23:26:10 +0100 (CET)

commit c87b45bb4660e4e711d99ba386c5c73ac1e7d7c2
Author: FRIGN <dev_AT_frign.de>
Date: Wed Jan 28 22:06:50 2015 +0100

    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.

diff --git a/README b/README
index 987f26f..df6865a 100644
--- a/README
+++ b/README
_AT_@ -45,7 +45,7 @@ The following tools are implemented ('*' == finished, '#' == UTF-8 support,
 =* mkdir yes none
 =* mkfifo yes none
 = mktemp non-posix none
-= mv yes (-i)
+=* mv yes (-i)
 = nice yes none
 = nl no -d, -f, -h, -l, -n, -p, -v, -w
 = nohup yes none
diff --git a/mv.1 b/mv.1
index e3402bb..55c111e 100644
--- a/mv.1
+++ b/mv.1
_AT_@ -1,22 +1,36 @@
-.TH MV 1 sbase\-VERSION
-.SH NAME
-mv \- move files and directories
-.SH SYNOPSIS
-.B mv
-.RB [ \-f ]
-.I file
-.RI [ name ]
-.P
-.B mv
-.RB [ \-f ]
-.RI [ file ...]
-.RI [ directory ]
-.SH DESCRIPTION
-.B mv
-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
-directory.
-.SH OPTIONS
-.TP
-.B \-f
-do not prompt for confirmation before overwriting the destination path.
+.Dd January 28, 2015
+.Dt MV 1 sbase\-VERSION
+.Sh NAME
+.Nm mv
+.Nd move files and directories
+.Sh SYNOPSIS
+.Nm mv
+.Op Fl f | Fl i
+.Ar source ...
+.Ar destination
+.Sh DESCRIPTION
+.Nm
+moves each
+.Ar source
+to
+.Ar destination .
+If only one
+.Ar source
+is given and
+.Ar destination
+is not a directory,
+.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.
diff --git a/mv.c b/mv.c
index e705f40..f67558f 100644
--- a/mv.c
+++ b/mv.c
_AT_@ -13,7 +13,7 @@ static int mv(const char *, const char *);
 static void
 usage(void)
 {
- eprintf("usage: %s [-f] source... dest\n", argv0);
+ eprintf("usage: %s [-f | -i] source... dest\n", argv0);
 }
 
 int
_AT_@ -22,6 +22,7 @@ main(int argc, char *argv[])
         struct stat st;
 
         ARGBEGIN {
+ case 'i':
         case 'f':
                 break;
         default:
Received on Wed Jan 28 2015 - 23:26:10 CET

This archive was generated by hypermail 2.3.0 : Wed Jan 28 2015 - 23:36:12 CET