Documentation
¶
Overview ¶
Copyright © 2024 lflxp <382023823@qq.com>
Copyright © 2020 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
Copyright © 2020 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 NAME lflxp <382023823@qq.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 lflxp <382023823@qq.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
Index ¶
Constants ¶
const ZshCompletion = `compdef _k k # 添加 _gmt 函数
__showme-cli_debug()
{
local file="$BASH_COMP_DEBUG_FILE"
if [[ -n ${file} ]]; then
echo "$*" >> "${file}"
fi
}
_k() {
local matches namespace result
# 获取一次性结果
result=$(command showme smart ${LBUFFER})
__showme-cli_debug "namespace ${result}"
namespace=$(command echo ${result}|head -1|awk '/^NAMESPACE/ {print "yes"}')
__showme-cli_debug "namespace ${namespace}"
# 根据标题是否含有NAMESPACE动态切换显示结果
if [[ -n "$namespace" ]]; then
matches=$(command echo ${result} | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-50%} --header-lines=1 --min-height 15 --reverse $FZF_DEFAULT_OPTS --preview 'echo {}' --preview-window down:3:wrap $FZF_COMPLETION_OPTS" showme -m|awk '{print "-n "$1" "$2}'|tr '\n' ' ')
else
matches=$(command echo ${result} | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-50%} --header-lines=1 --min-height 15 --reverse $FZF_DEFAULT_OPTS --preview 'echo {}' --preview-window down:3:wrap $FZF_COMPLETION_OPTS" showme -m|awk '{print $1}'|tr '\n' ' ')
fi
#_describe 'command' ns
if [ -n "$matches" ]; then
LBUFFER="${LBUFFER}$matches"
# LBUFFER="${BUFFER} $matches"
fi
zle reset-prompt
}
zle -N _k
#定义快捷键为: [Esc] [Esc]
` + "bindkey '`' _k"
const ZshCompletionDebug = `compdef _k k # 添加 _gmt 函数
__showme-cli_debug()
{
local file="$BASH_COMP_DEBUG_FILE"
if [[ -n ${file} ]]; then
echo "$*" >> "${file}"
fi
}
_k() {
local matches namespace result
# 获取一次性结果
result=$(command showme smart -d ${LBUFFER})
__showme-cli_debug "namespace ${result}"
namespace=$(command echo ${result}|head -1|awk '/^NAMESPACE/ {print "yes"}')
__showme-cli_debug "namespace ${namespace}"
# 根据标题是否含有NAMESPACE动态切换显示结果
if [[ -n "$namespace" ]]; then
matches=$(command echo ${result} | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-50%} --header-lines=1 --min-height 15 --reverse $FZF_DEFAULT_OPTS --preview 'echo {}' --preview-window down:3:wrap $FZF_COMPLETION_OPTS" showme -m|awk '{print "-n "$1" "$2}'|tr '\n' ' ')
else
matches=$(command echo ${result} | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-50%} --header-lines=1 --min-height 15 --reverse $FZF_DEFAULT_OPTS --preview 'echo {}' --preview-window down:3:wrap $FZF_COMPLETION_OPTS" showme -m|awk '{print $1}'|tr '\n' ' ')
fi
#_describe 'command' ns
if [ -n "$matches" ]; then
LBUFFER="${LBUFFER}$matches"
# LBUFFER="${BUFFER} $matches"
fi
zle reset-prompt
}
zle -N _k
#定义快捷键为: [Esc] [Esc]
` + "bindkey '`' _k"
Variables ¶
var (
MaxConnections int64
)
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.