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
+2 -2
View File
@@ -44,12 +44,12 @@ function _fish_mkdir_p --description 'mkdir -p with configurable verbose output'
if test $mode = path
set -l display (string replace -- "$HOME" "~" $target)"/"
echo (set_color --bold cyan)"Created: "(set_color cyan)"$display"(set_color normal)
echo (set_color --bold cyan)"Created directory: "(set_color cyan)"$display"(set_color normal)
return 0
end
# Tree mode: dimmed existing anchor, then cyan new dirs.
echo (set_color --bold cyan)"Created missing directories:"(set_color normal)
echo (set_color --bold yellow)"Created directories:"(set_color normal)
set -l anchor (string replace -- "$HOME" "~" $cursor)"/"
echo (set_color brblack)" $anchor"(set_color normal)
set -l i 1