feat(shell): integrate _fish_mkdir_p into mkdir and mkcd

- mkdir: loop over path args calling _fish_mkdir_p --path; falls back
  to command mkdir -p when flag args (e.g. -m 755) are present
- mkcd: default to _fish_mkdir_p --tree for new dirs; add -s/--silent
  flag to suppress tree output (mkcd's own status message still prints)
This commit is contained in:
2026-06-03 23:22:30 -04:00
parent 4df10a7a2c
commit c2afa1201f
3 changed files with 28 additions and 8 deletions
+10 -1
View File
@@ -4,7 +4,16 @@
# Execute mkdir
function mkdir --description 'Execute mkdir'
if status is-interactive
command mkdir -p $argv
# Fall back to command mkdir -p when flags are present (e.g. -m 755)
for _arg in $argv
if string match -q -- '-*' $_arg
command mkdir -p $argv
return $status
end
end
for _dir in $argv
_fish_mkdir_p --path $_dir
end
else
command mkdir $argv
end