From 83d9b50e98beb7ef0696a475aa75a78873f14b71 Mon Sep 17 00:00:00 2001 From: Alvin Siew Date: Thu, 1 Aug 2019 10:46:56 +0800 Subject: [PATCH 1/2] bug fixes --- slist.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/slist.sh b/slist.sh index 1b67ce5..c215b54 100755 --- a/slist.sh +++ b/slist.sh @@ -256,9 +256,10 @@ do config-file) configfile=true val="${!OPTIND}"; OPTIND=$(( OPTIND + 1 )) + check_arg "$val" # Exit program if host is empty if [[ $value == "false" ]]; then - printf "%s\n" "${red}Host cannot be empty ${end}" + printf "%s\n" "${red}Must specific config file if --config-file is used${end}" exit 1 fi config_file=$val @@ -353,7 +354,7 @@ fi if [[ $help == "true" ]]; then help elif [[ $edit == "true" ]]; then - vi ~/.ssh/config + vi "$config_file" elif [[ $add_host == "true" ]] && [[ $del_host == "true" ]]; then printf "%s\n" "${red}--add-host and --del-host cannot be use at the same time ${end}" exit 3 From eee768d4c2b9de2a0b6fa66586b22670edadcecc Mon Sep 17 00:00:00 2001 From: Alvin Siew Date: Thu, 1 Aug 2019 11:39:39 +0800 Subject: [PATCH 2/2] Correct grammer =\ --- slist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slist.sh b/slist.sh index c215b54..42c79ff 100755 --- a/slist.sh +++ b/slist.sh @@ -259,7 +259,7 @@ do check_arg "$val" # Exit program if host is empty if [[ $value == "false" ]]; then - printf "%s\n" "${red}Must specific config file if --config-file is used${end}" + printf "%s\n" "${red}Config cannot be empty with --config-file${end}" exit 1 fi config_file=$val