From 6fc267147a589205beed00fa6702d898cbaf81f2 Mon Sep 17 00:00:00 2001 From: John Gee Date: Sun, 21 Apr 2019 13:02:38 +1200 Subject: [PATCH] Add single quotes around parameters in error messages --- CHANGELOG.md | 2 ++ bin/n | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3db06b..07948e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - internal: improve shell script based on ShellCheck suggestions, quoting variables use etc [#187] [#465] +- put single quote marks around parameters to clarify error messages [#485] ## [3.0.2] (2019-04-07) @@ -86,6 +87,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. [#465]: https://github.com/tj/n/issues/465 [#466]: https://github.com/tj/n/issues/466 [#467]: https://github.com/tj/n/issues/467 +[#485]: https://github.com/tj/n/issues/485 [#512]: https://github.com/tj/n/issues/512 [#516]: https://github.com/tj/n/issues/516 [#518]: https://github.com/tj/n/issues/518 diff --git a/bin/n b/bin/n index f970d73..650a080 100755 --- a/bin/n +++ b/bin/n @@ -500,7 +500,7 @@ install() { | grep -E "^$version" \ | tail -n1)" - test "$version" || abort "invalid version ${1#v}" + test "$version" || abort "invalid version '${1#v}'" fi local dir="${VERSIONS_DIR[$DEFAULT]}/$version" @@ -518,7 +518,7 @@ install() { log install "${BINS[$DEFAULT]}-v$version" local url="$(tarball_url "$version")" - is_ok "$url" || is_oss_ok "$url" || abort "invalid version $version" + is_ok "$url" || is_oss_ok "$url" || abort "invalid version '$version'" log mkdir "$dir" if ! mkdir -p "$dir"; then @@ -603,7 +603,7 @@ display_bin_path_for_version() { if test -f "$bin"; then printf "%s\n" "$bin" else - abort "$1 is not installed" + abort "'$1' is not installed" fi } @@ -634,7 +634,7 @@ execute_with_version() { if test -f "$bin"; then exec "$bin" "$@" else - abort "$version is not installed" + abort "'$version' is not installed" fi }