quote $foo when running with unknown options; fixes #453

pull/471/head
romkatv 5 years ago
parent c08d1e846b
commit eb9da89ad9

@ -59,7 +59,7 @@ function _p9k_can_configure() {
} }
function p9k_configure() { function p9k_configure() {
eval $__p9k_intro eval "$__p9k_intro"
( (
set -- -f set -- -f
source $__p9k_root_dir/internal/wizard.zsh source $__p9k_root_dir/internal/wizard.zsh

@ -1,4 +1,4 @@
if [[ $__p9k_sourced != 3 ]]; then if [[ $__p9k_sourced != 4 ]]; then
>&2 print -P "" >&2 print -P ""
>&2 print -P "[%F{1}ERROR%f]: Corrupted powerlevel10k installation." >&2 print -P "[%F{1}ERROR%f]: Corrupted powerlevel10k installation."
>&2 print -P "" >&2 print -P ""
@ -112,7 +112,7 @@ typeset -grA __p9k_colors=(
# #
# Type `getColorCode background` or `getColorCode foreground` to see the list of predefined colors. # Type `getColorCode background` or `getColorCode foreground` to see the list of predefined colors.
function getColorCode() { function getColorCode() {
eval $__p9k_intro eval "$__p9k_intro"
if (( ARGC == 1 )); then if (( ARGC == 1 )); then
case $1 in case $1 in
foreground) foreground)
@ -139,7 +139,7 @@ function getColorCode() {
# Sadly, this is a part of public API. Its use is emphatically discouraged. # Sadly, this is a part of public API. Its use is emphatically discouraged.
function print_icon() { function print_icon() {
eval $__p9k_intro eval "$__p9k_intro"
(( $+functions[_p9k_print_icon] )) || source "${__p9k_root_dir}/internal/icons.zsh" (( $+functions[_p9k_print_icon] )) || source "${__p9k_root_dir}/internal/icons.zsh"
_p9k_print_icon "$@" _p9k_print_icon "$@"
} }
@ -150,7 +150,7 @@ function print_icon() {
# otherwise "print_icon" is used, which takes the users # otherwise "print_icon" is used, which takes the users
# overrides into account. # overrides into account.
function get_icon_names() { function get_icon_names() {
eval $__p9k_intro eval "$__p9k_intro"
(( $+functions[_p9k_get_icon_names] )) || source "${__p9k_root_dir}/internal/icons.zsh" (( $+functions[_p9k_get_icon_names] )) || source "${__p9k_root_dir}/internal/icons.zsh"
_p9k_get_icon_names "$@" _p9k_get_icon_names "$@"
} }
@ -3589,7 +3589,7 @@ function _p9k_maybe_ignore_git_repo() {
} }
function _p9k_vcs_resume() { function _p9k_vcs_resume() {
eval $__p9k_intro eval "$__p9k_intro"
_p9k_maybe_ignore_git_repo _p9k_maybe_ignore_git_repo
@ -5215,7 +5215,7 @@ function _p9k_on_expand() {
(( _p9k__expanded && ! $+__p9k_instant_prompt_active )) && return (( _p9k__expanded && ! $+__p9k_instant_prompt_active )) && return
() { () {
eval $__p9k_intro eval "$__p9k_intro"
_p9k_maybe_dump _p9k_maybe_dump
(( $+__p9k_instant_prompt_active )) && _p9k_clear_instant_prompt (( $+__p9k_instant_prompt_active )) && _p9k_clear_instant_prompt
@ -5305,7 +5305,7 @@ function _p9k_on_expand() {
functions -M _p9k_on_expand functions -M _p9k_on_expand
_p9k_precmd_impl() { _p9k_precmd_impl() {
eval $__p9k_intro eval "$__p9k_intro"
(( __p9k_enabled )) || return (( __p9k_enabled )) || return
@ -5404,7 +5404,7 @@ _p9k_precmd_impl() {
_p9k_trapint() { _p9k_trapint() {
if (( __p9k_enabled )); then if (( __p9k_enabled )); then
eval $__p9k_intro eval "$__p9k_intro"
zle && _p9k_on_widget_zle-line-finish int zle && _p9k_on_widget_zle-line-finish int
fi fi
return 0 return 0
@ -6023,7 +6023,7 @@ function _p9k_widget_hook() {
fi fi
fi fi
eval $__p9k_intro eval "$__p9k_intro"
(( _p9k__restore_prompt_fd )) && _p9k_restore_prompt $_p9k__restore_prompt_fd (( _p9k__restore_prompt_fd )) && _p9k_restore_prompt $_p9k__restore_prompt_fd
__p9k_reset_state=1 __p9k_reset_state=1
local pat idx var local pat idx var
@ -6097,7 +6097,7 @@ function _p9k_wrap_widgets() {
} }
function _p9k_restore_prompt() { function _p9k_restore_prompt() {
eval $__p9k_intro eval "$__p9k_intro"
{ {
(( _p9k__must_restore_prompt )) || return (( _p9k__must_restore_prompt )) || return
_p9k__must_restore_prompt=0 _p9k__must_restore_prompt=0
@ -6891,7 +6891,7 @@ _p9k_setup() {
prompt_opts+=cr prompt_opts+=cr
fi fi
eval $__p9k_intro eval "$__p9k_intro"
prompt_powerlevel9k_teardown prompt_powerlevel9k_teardown
__p9k_enabled=1 __p9k_enabled=1
typeset -ga preexec_functions=(_p9k_preexec1 $preexec_functions _p9k_preexec2) typeset -ga preexec_functions=(_p9k_preexec1 $preexec_functions _p9k_preexec2)
@ -6901,7 +6901,7 @@ _p9k_setup() {
prompt_powerlevel9k_setup() { _p9k_setup } prompt_powerlevel9k_setup() { _p9k_setup }
prompt_powerlevel9k_teardown() { prompt_powerlevel9k_teardown() {
eval $__p9k_intro eval "$__p9k_intro"
add-zsh-hook -D precmd '(_p9k_|powerlevel9k_)*' add-zsh-hook -D precmd '(_p9k_|powerlevel9k_)*'
add-zsh-hook -D preexec '(_p9k_|powerlevel9k_)*' add-zsh-hook -D preexec '(_p9k_|powerlevel9k_)*'
PROMPT='%m%# ' PROMPT='%m%# '
@ -7069,7 +7069,7 @@ typeset -gi __p9k_reset_state
function p10k() { function p10k() {
[[ $# != 1 || $1 != finalize ]] || { p10k-instant-prompt-finalize; return 0 } [[ $# != 1 || $1 != finalize ]] || { p10k-instant-prompt-finalize; return 0 }
eval $__p9k_intro eval "$__p9k_intro"
if (( !ARGC )); then if (( !ARGC )); then
print -rP -- $__p9k_p10k_usage >&2 print -rP -- $__p9k_p10k_usage >&2

@ -141,7 +141,7 @@ function _p9k_parse_buffer() {
local rcquotes local rcquotes
[[ -o rcquotes ]] && rcquotes=rcquotes [[ -o rcquotes ]] && rcquotes=rcquotes
eval $__p9k_intro eval "$__p9k_intro"
setopt no_nomatch $rcquotes setopt no_nomatch $rcquotes
typeset -ga P9K_COMMANDS=() typeset -ga P9K_COMMANDS=()

@ -85,7 +85,7 @@ function _p9k_worker_invoke() {
} }
function _p9k_worker_cleanup() { function _p9k_worker_cleanup() {
eval $__p9k_intro eval "$__p9k_intro"
[[ $_p9k__worker_shell_pid == $sysparams[pid] ]] && _p9k_worker_stop [[ $_p9k__worker_shell_pid == $sysparams[pid] ]] && _p9k_worker_stop
return 0 return 0
} }
@ -106,7 +106,7 @@ function _p9k_worker_stop() {
} }
function _p9k_worker_receive() { function _p9k_worker_receive() {
eval $__p9k_intro eval "$__p9k_intro"
[[ -z $_p9k__worker_resp_fd ]] && return [[ -z $_p9k__worker_resp_fd ]] && return

@ -26,7 +26,7 @@
[[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale' [[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale'
() { () {
eval $__p9k_intro eval "$__p9k_intro"
if (( $+__p9k_sourced )); then if (( $+__p9k_sourced )); then
(( $+functions[_p9k_setup] )) && _p9k_setup (( $+functions[_p9k_setup] )) && _p9k_setup
return 0 return 0
@ -35,7 +35,7 @@
if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file ]] && (( ! $+functions[_p9k_preinit] )) && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file ]] && (( ! $+functions[_p9k_preinit] )) && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then
_p9k_preinit _p9k_preinit
fi fi
typeset -gr __p9k_sourced=3 typeset -gr __p9k_sourced=4
if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus && ${(%):-%#} == % ]]; then if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus && ${(%):-%#} == % ]]; then
local f local f
for f in $__p9k_root_dir/{powerlevel9k.zsh-theme,powerlevel10k.zsh-theme,internal/p10k.zsh,internal/icons.zsh,internal/configure.zsh,internal/worker.zsh,internal/parser.zsh,gitstatus/gitstatus.plugin.zsh}; do for f in $__p9k_root_dir/{powerlevel9k.zsh-theme,powerlevel10k.zsh-theme,internal/p10k.zsh,internal/icons.zsh,internal/configure.zsh,internal/worker.zsh,internal/parser.zsh,gitstatus/gitstatus.plugin.zsh}; do

Loading…
Cancel
Save