summaryrefslogtreecommitdiff
path: root/Userland/mv.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-08-11 13:43:25 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-11 20:29:14 +0200
commit9e55162e9bf585c5caf1a69efa9a4653766196f6 (patch)
tree35e85c885897b6a28580e23fcd998d931e2c0d3d /Userland/mv.cpp
parent2a765ad062fdfdc0640a9022fb168ae7f4e71fb5 (diff)
downloadserenity-9e55162e9bf585c5caf1a69efa9a4653766196f6.zip
mv: Accept (but ignore) -f
Many scripts seem to use "mv -f", so let's support that.
Diffstat (limited to 'Userland/mv.cpp')
-rw-r--r--Userland/mv.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/mv.cpp b/Userland/mv.cpp
index 2927260644..09c16bf0df 100644
--- a/Userland/mv.cpp
+++ b/Userland/mv.cpp
@@ -38,10 +38,15 @@ int main(int argc, char** argv)
return 1;
}
+ // NOTE: The "force" option is a dummy for now, it's just here to silence scripts that use "mv -f"
+ // In the future, it might be used to cancel out an "-i" interactive option.
+ bool force = false;
+
const char* old_path = nullptr;
const char* new_path = nullptr;
Core::ArgsParser args_parser;
+ args_parser.add_option(force, "Force", "force", 'f');
args_parser.add_positional_argument(old_path, "The file or directory being moved", "source");
args_parser.add_positional_argument(new_path, "destination of the move operation", "destination");
args_parser.parse(argc, argv);