From 4aeab14d2d12c91bb7725300f103a2f5fa935c6f Mon Sep 17 00:00:00 2001 From: William Melody Date: Sun, 7 Jun 2020 13:23:54 -0700 Subject: [PATCH] Remove obsolete `_command_argv_includes()`. --- hosts | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/hosts b/hosts index cb81d28..55e119a 100755 --- a/hosts +++ b/hosts @@ -338,22 +338,6 @@ _join() { printf "%s\\n" "${*}" } -# _command_argv_includes() -# -# Usage: -# _command_argv_includes "an_argument" -# -# Exit Status: -# 0 If the argument is included in `$_COMMAND_ARGV`, the program's command -# argument list. -# 1 If not. -# -# This is a shortcut for simple cases where a command wants to check for the -# presence of options quickly without parsing the options again. -_command_argv_includes() { - _contains "${1}" "${_COMMAND_ARGV[*]}" -} - # _blank() # # Usage: @@ -648,7 +632,7 @@ Description: Display the list of available commands. HEREDOC commands() { - if _command_argv_includes "--raw" + if [[ "${1:-}" == "--raw" ]] then printf "%s\\n" "${_DEFINED_COMMANDS[@]}" else