[hackers] [sbase] Support -f for mv || sin

From: <git_AT_suckless.org>
Date: Sat, 05 Oct 2013 16:29:32 +0200

commit 82bff35228af1236a5dd36b1db804937f824ff46
Author: sin <sin_AT_2f30.org>
Date: Fri Sep 27 15:45:39 2013 +0100

    Support -f for mv
    
    At the moment this does nothing as we do not check anyway.

diff --git a/mv.1 b/mv.1
index 071bf2f..e3402bb 100644
--- a/mv.1
+++ b/mv.1
_AT_@ -3,10 +3,12 @@
 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
_AT_@ -14,3 +16,7 @@ mv \- move files and directories
 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.
diff --git a/mv.c b/mv.c
index 5c54ce6..0d1ec50 100644
--- a/mv.c
+++ b/mv.c
_AT_@ -12,7 +12,7 @@ int mv(const char *, const char *);
 static void
 usage(void)
 {
- eprintf("usage: %s source... dest
", argv0);
+ eprintf("usage: %s [-f] source... dest
", argv0);
 }
 
 int
_AT_@ -21,6 +21,8 @@ main(int argc, char *argv[])
         struct stat st;
 
         ARGBEGIN {
+ case 'f':
+ break;
         default:
                 usage();
         } ARGEND;
Received on Sat Oct 05 2013 - 16:29:32 CEST

This archive was generated by hypermail 2.3.0 : Sat Oct 05 2013 - 16:36:40 CEST