From e55b67c2089629fa00d2af3a647691a7e30ed6b3 Mon Sep 17 00:00:00 2001 From: Approval Tester Date: Thu, 6 Feb 2020 16:21:11 +0000 Subject: [PATCH] fix --version to exit with 0 --- examples/colors/colorly | 2 +- examples/command-default/ftp | 6 +++--- examples/command-groups/ftp | 10 +++++----- examples/commands-nested/cli | 14 +++++++------- examples/commands/cli | 6 +++--- examples/config-ini/configly | 8 ++++---- examples/custom-includes/download | 2 +- examples/custom-strings/download | 2 +- examples/dependencies/cli | 6 +++--- examples/docker-like/docker | 12 ++++++------ examples/environment-variables/cli | 4 ++-- examples/git-like/git | 6 +++--- examples/minimal/download | 2 +- examples/minus-v/cli | 2 +- examples/multiline/multi | 6 +++--- examples/yaml/yaml | 2 +- lib/bashly/views/command/fixed_flags_filter.erb | 2 +- 17 files changed, 46 insertions(+), 46 deletions(-) diff --git a/examples/colors/colorly b/examples/colors/colorly index 3f5e1db3..753b0b04 100644 --- a/examples/colors/colorly +++ b/examples/colors/colorly @@ -106,7 +106,7 @@ parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) diff --git a/examples/command-default/ftp b/examples/command-default/ftp index 918988a2..1e1de2f1 100644 --- a/examples/command-default/ftp +++ b/examples/command-default/ftp @@ -144,7 +144,7 @@ parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -217,7 +217,7 @@ ftp_upload_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -271,7 +271,7 @@ ftp_download_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) diff --git a/examples/command-groups/ftp b/examples/command-groups/ftp index 595aac69..9e0434e6 100644 --- a/examples/command-groups/ftp +++ b/examples/command-groups/ftp @@ -209,7 +209,7 @@ parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -290,7 +290,7 @@ ftp_download_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -344,7 +344,7 @@ ftp_upload_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -398,7 +398,7 @@ ftp_login_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -440,7 +440,7 @@ ftp_logout_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) diff --git a/examples/commands-nested/cli b/examples/commands-nested/cli index cb999443..c07864e0 100644 --- a/examples/commands-nested/cli +++ b/examples/commands-nested/cli @@ -293,7 +293,7 @@ parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -360,7 +360,7 @@ cli_dir_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -427,7 +427,7 @@ cli_dir_list_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -481,7 +481,7 @@ cli_dir_remove_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -541,7 +541,7 @@ cli_file_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -608,7 +608,7 @@ cli_file_show_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -662,7 +662,7 @@ cli_file_edit_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) diff --git a/examples/commands/cli b/examples/commands/cli index 9dbb3edb..34ecd48e 100644 --- a/examples/commands/cli +++ b/examples/commands/cli @@ -183,7 +183,7 @@ parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -250,7 +250,7 @@ cli_download_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -313,7 +313,7 @@ cli_upload_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) diff --git a/examples/config-ini/configly b/examples/config-ini/configly index 3cbabb7a..7e68278a 100644 --- a/examples/config-ini/configly +++ b/examples/config-ini/configly @@ -316,7 +316,7 @@ parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -390,7 +390,7 @@ configly_set_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -455,7 +455,7 @@ configly_get_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -509,7 +509,7 @@ configly_list_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) diff --git a/examples/custom-includes/download b/examples/custom-includes/download index 7c0cd10a..5e398c95 100644 --- a/examples/custom-includes/download +++ b/examples/custom-includes/download @@ -78,7 +78,7 @@ parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) diff --git a/examples/custom-strings/download b/examples/custom-strings/download index 5f734c37..e72fa21c 100644 --- a/examples/custom-strings/download +++ b/examples/custom-strings/download @@ -70,7 +70,7 @@ parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) diff --git a/examples/dependencies/cli b/examples/dependencies/cli index df4ef3aa..3320da66 100644 --- a/examples/dependencies/cli +++ b/examples/dependencies/cli @@ -122,7 +122,7 @@ parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -189,7 +189,7 @@ cli_download_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -239,7 +239,7 @@ cli_upload_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) diff --git a/examples/docker-like/docker b/examples/docker-like/docker index 8984b9eb..e010d42f 100644 --- a/examples/docker-like/docker +++ b/examples/docker-like/docker @@ -241,7 +241,7 @@ parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -308,7 +308,7 @@ docker_container_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -375,7 +375,7 @@ docker_container_run_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -429,7 +429,7 @@ docker_container_stop_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -483,7 +483,7 @@ docker_image_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -543,7 +543,7 @@ docker_image_ls_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) diff --git a/examples/environment-variables/cli b/examples/environment-variables/cli index 52ffe55e..088240c7 100644 --- a/examples/environment-variables/cli +++ b/examples/environment-variables/cli @@ -109,7 +109,7 @@ parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -169,7 +169,7 @@ cli_verify_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) diff --git a/examples/git-like/git b/examples/git-like/git index 80a77161..36894744 100644 --- a/examples/git-like/git +++ b/examples/git-like/git @@ -138,7 +138,7 @@ parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -205,7 +205,7 @@ git_status_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -247,7 +247,7 @@ git_commit_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) diff --git a/examples/minimal/download b/examples/minimal/download index bbde59da..10d128dc 100644 --- a/examples/minimal/download +++ b/examples/minimal/download @@ -82,7 +82,7 @@ parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) diff --git a/examples/minus-v/cli b/examples/minus-v/cli index c2e1eaf4..fc9d7bcd 100644 --- a/examples/minus-v/cli +++ b/examples/minus-v/cli @@ -68,7 +68,7 @@ parse_requirements() { case "$1" in --version ) version_command - exit 1 + exit ;; --help ) diff --git a/examples/multiline/multi b/examples/multiline/multi index 6022ead9..2721e519 100644 --- a/examples/multiline/multi +++ b/examples/multiline/multi @@ -159,7 +159,7 @@ parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -226,7 +226,7 @@ multi_multiline_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) @@ -279,7 +279,7 @@ multi_regular_parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) diff --git a/examples/yaml/yaml b/examples/yaml/yaml index a7fd300d..39e6cc9e 100644 --- a/examples/yaml/yaml +++ b/examples/yaml/yaml @@ -136,7 +136,7 @@ parse_requirements() { case "$1" in --version | -v ) version_command - exit 1 + exit ;; --help | -h ) diff --git a/lib/bashly/views/command/fixed_flags_filter.erb b/lib/bashly/views/command/fixed_flags_filter.erb index a1d74279..f1b15862 100644 --- a/lib/bashly/views/command/fixed_flags_filter.erb +++ b/lib/bashly/views/command/fixed_flags_filter.erb @@ -6,7 +6,7 @@ case "$1" in --version | -v ) <%- end -%> version_command - exit 1 + exit ;; <%- if short_flag_exist? "-h" -%>