Skip to content

Commit

Permalink
refactor(show_hidden_files): replace echo by printf in usage function
Browse files Browse the repository at this point in the history
  • Loading branch information
kral2 committed Sep 8, 2021
1 parent 3c5e7f8 commit 8321b2a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
17 changes: 0 additions & 17 deletions system-config/show-hidden-files.sh

This file was deleted.

25 changes: 25 additions & 0 deletions system-config/show_hidden_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Show hidden files and relaunch Finder

# Usage:
# > ./show_hidden_files.sh [true|false|--help]

usage () {
printf "%s \n" "Usage : ./show_hidden_files.sh [true | false | --help]"
printf "\n"
printf "%s \n" "true : show hidden files"
printf "%s \n" "false : mask hidden files"
printf "\n"
printf "%s \n" "--help : print this usage message."
}

if [ -z "$1" ]; then
usage
elif [ "$1" = "--help" ]; then
usage
else
action=$1
defaults write com.apple.Finder AppleShowAllFiles "${action}"
killall Finder
fi

0 comments on commit 8321b2a

Please sign in to comment.