Skip to content

Commit

Permalink
fix(logs): correct quote level
Browse files Browse the repository at this point in the history
  • Loading branch information
olets committed Nov 10, 2022
1 parent 7d4912a commit b36eee2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions zsh-abbr.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ _abbr() {
fi

if ! (( ${#abbreviations_sets} )); then
_abbr:util_error "abbr erase: No${type:+ $type}${scope:+ $scope} abbreviation \`$abbreviation\` found"
_abbr:util_error "abbr erase: No${type:+ $type}${scope:+ $scope} abbreviation \`${(Q)abbreviation}\` found"
elif [[ ${#abbreviations_sets} == 1 ]]; then
verb_phrase="Would erase"

Expand All @@ -196,12 +196,12 @@ _abbr() {
fi
fi

_abbr:util_log_unless_quiet "$success_color$verb_phrase$reset_color $(_abbr:util_set_to_typed_scope $abbreviations_sets) \`$abbreviation\`"
_abbr:util_log_unless_quiet "$success_color$verb_phrase$reset_color $(_abbr:util_set_to_typed_scope $abbreviations_sets) \`${(Q)abbreviation}\`"
else
verb_phrase="Did not erase"
(( dry_run )) && verb_phrase="Would not erase"

message="$error_color$verb_phrase$reset_color abbreviation \`$abbreviation\`. Please specify one of\\n"
message="$error_color$verb_phrase$reset_color abbreviation \`${(Q)abbreviation}\`. Please specify one of\\n"

for abbreviations_set in $abbreviations_sets; do
message+=" $(_abbr:util_set_to_typed_scope $abbreviations_set)\\n"
Expand Down Expand Up @@ -452,7 +452,7 @@ _abbr() {
_abbr:util_add $new_abbreviation $expansion
_abbr:erase $current_abbreviation
else
_abbr:util_error "abbr rename: No${type:+ $type}${scope:+ $scope} abbreviation \`$current_abbreviation\` exists"
_abbr:util_error "abbr rename: No${type:+ $type}${scope:+ $scope} abbreviation \`${(Q)current_abbreviation}\` exists"
fi
}

Expand All @@ -472,7 +472,7 @@ _abbr() {
success=0

if [[ ${abbreviation%=*} != $abbreviation ]]; then
_abbr:util_error "abbr add: ABBREVIATION (\`$abbreviation\`) may not contain an equals sign"
_abbr:util_error "abbr add: ABBREVIATION (\`${(Q)abbreviation}\`) may not contain an equals sign"
return
fi

Expand Down Expand Up @@ -545,12 +545,12 @@ _abbr() {
verb_phrase="Added"
(( dry_run )) && verb_phrase="Would add"

_abbr:util_log_unless_quiet "$success_color$verb_phrase$reset_color the $typed_scope \`$abbreviation\`"
_abbr:util_log_unless_quiet "$success_color$verb_phrase$reset_color the $typed_scope \`${(Q)abbreviation}\`"
else
verb_phrase="Did not"
(( dry_run )) && verb_phrase="Would not"

_abbr:util_error "$verb_phrase add the $typed_scope \`$abbreviation\` because it already exists"
_abbr:util_error "$verb_phrase add the $typed_scope \`${(Q)abbreviation}\` because it already exists"
fi
}

Expand Down Expand Up @@ -639,12 +639,12 @@ _abbr() {
verb_phrase="will now expand"
(( dry_run )) && verb_phrase="would now expand"

_abbr:util_log_unless_quieter "\`$abbreviation\` $verb_phrase as an abbreviation"
_abbr:util_log_unless_quieter "\`${(Q)abbreviation}\` $verb_phrase as an abbreviation"
else
verb_phrase="Did not"
(( dry_run )) && verb_phrase="Would not"

_abbr:util_warn "$verb_phrase add the abbreviation \`$abbreviation\` because a command with the same name exists"
_abbr:util_warn "$verb_phrase add the abbreviation \`${(Q)abbreviation}\` because a command with the same name exists"
return 1
fi
fi
Expand Down

0 comments on commit b36eee2

Please sign in to comment.