aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--functions/rchmod.fish13
1 files changed, 9 insertions, 4 deletions
diff --git a/functions/rchmod.fish b/functions/rchmod.fish
index b54348f..8efbd40 100644
--- a/functions/rchmod.fish
+++ b/functions/rchmod.fish
@@ -1,11 +1,16 @@
-function rchmod --description 'Recursively reset premissions of files and folders'
+function rchmod --description 'Recursively reset perms of files and folders' -a dmode -a fmode
if not command -sq 'find'
echo "Can't find find."
- return 1
+ return 1
end
-find . -type d -exec chmod 755 {} +
-find . -type f -exec chmod 644 {} +
+if test (count $argv) -lt 2
+ echo "Missing arguments."
+ return 1
+end
+
+find . -type d -exec chmod $dmode {} +
+find . -type f -exec chmod $fmode {} +
end