1
0
Fork 0
mirror of synced 2024-11-22 23:35:35 -05:00

Fail when no parameter is provided to -c|--cmd

Forgot to add this check when the new option was introduced.
This commit is contained in:
Eric Nielsen 2020-11-07 14:39:30 -05:00
parent 78b4711750
commit c6f0720abc
No known key found for this signature in database
GPG key ID: 47D1DBFA0765A1FB
4 changed files with 9 additions and 6 deletions

View file

@ -7,9 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Fixed ### Added
- Prompt before uninstalling modules, unless `-q` is set. - Prompt before uninstalling modules, unless `-q` is set.
### Fixed
- Show error when no parameter is provided to `-c|--cmd`.
## [1.3.2] - 2020-08-01 ## [1.3.2] - 2020-08-01
### Fixed ### Fixed

View file

@ -70,7 +70,7 @@ Initialization options:
fi fi
while (( # > 0 )); do while (( # > 0 )); do
case ${1} in case ${1} in
-b|--branch|-t|--tag|-f|--fpath|-a|--autoload|-s|--source) -b|--branch|-t|--tag|-f|--fpath|-a|--autoload|-s|--source|-c|--cmd)
if (( # < 2 )); then if (( # < 2 )); then
print -u2 -PR "%F{red}<%= error %>${funcfiletrace[1]}:%B${zmodule}:%b Missing argument for zmodule option ${1}%f"$'\n\n'${zusage} print -u2 -PR "%F{red}<%= error %>${funcfiletrace[1]}:%B${zmodule}:%b Missing argument for zmodule option ${1}%f"$'\n\n'${zusage}
_zfailed=1 _zfailed=1

View file

@ -6,7 +6,7 @@ class Zim
@home = "${ZDOTDIR:-${HOME}}" @home = "${ZDOTDIR:-${HOME}}"
@min_zsh_version = "5.2" @min_zsh_version = "5.2"
@startup_files_glob = ".z(shenv|profile|shrc|login|logout)" @startup_files_glob = ".z(shenv|profile|shrc|login|logout)"
@version = "1.3.3-SNAPSHOT" @version = "1.4.0-SNAPSHOT"
@ellipsis = " ..." @ellipsis = " ..."
@okay = "%F{green})%f " @okay = "%F{green})%f "
@warn = "! " @warn = "! "

View file

@ -173,7 +173,7 @@ Initialization options:
fi fi
while (( # > 0 )); do while (( # > 0 )); do
case ${1} in case ${1} in
-b|--branch|-t|--tag|-f|--fpath|-a|--autoload|-s|--source) -b|--branch|-t|--tag|-f|--fpath|-a|--autoload|-s|--source|-c|--cmd)
if (( # < 2 )); then if (( # < 2 )); then
print -u2 -PR "%F{red}x ${funcfiletrace[1]}:%B${zmodule}:%b Missing argument for zmodule option ${1}%f"$'\n\n'${zusage} print -u2 -PR "%F{red}x ${funcfiletrace[1]}:%B${zmodule}:%b Missing argument for zmodule option ${1}%f"$'\n\n'${zusage}
_zfailed=1 _zfailed=1
@ -315,7 +315,7 @@ _zimfw_compile() {
} }
_zimfw_info() { _zimfw_info() {
print -R 'zimfw version: '${_zversion}' (previous commit is ef4fe38)' print -R 'zimfw version: '${_zversion}' (previous commit is 78b4711)'
print -R 'ZIM_HOME: '${ZIM_HOME} print -R 'ZIM_HOME: '${ZIM_HOME}
print -R 'Zsh version: '${ZSH_VERSION} print -R 'Zsh version: '${ZSH_VERSION}
print -R 'System info: '$(command uname -a) print -R 'System info: '$(command uname -a)
@ -362,7 +362,7 @@ _zimfw_upgrade() {
} }
zimfw() { zimfw() {
local -r _zversion='1.3.3-SNAPSHOT' local -r _zversion='1.4.0-SNAPSHOT'
local -r zusage="Usage: %B${0}%b <action> [%B-q%b|%B-v%b] local -r zusage="Usage: %B${0}%b <action> [%B-q%b|%B-v%b]
Actions: Actions: