Improve scripts

This commit is contained in:
Tobias Reisinger 2022-10-17 18:49:58 +02:00
parent f94f6a1c60
commit b5764c0376
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
8 changed files with 28 additions and 16 deletions

View file

@ -19,19 +19,19 @@ declare -A mapper=(
["zsh"]="$HOME/.config/zsh/.zshrc"
)
if [[ -z "$1" ]]
if [ -z "$1" ]
then
echo "No argument given. Use --list (-l) to show all options."
exit
fi
if [[ "$1" == "-l" ]] || [[ "$1" == "--list" ]]
if [ "$1" = "-l" ] || [ "$1" = "--list" ]
then
echo "${!mapper[@]}"
exit
fi
target="${mapper["$1"]}"
if [[ -n "$target" ]]
if [ -n "$target" ]
then
$EDITOR "$target"
else