1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-10-16 11:40:46 +00:00

Compare commits

...

4 commits

Author SHA1 Message Date
Rafael Monico
30014d5d81
Merge b67d2f6cf6 into 367e9381df 2024-09-23 17:33:04 +02:00
Carlo Sala
367e9381df
chore(git): fix typo 2024-09-23 17:32:44 +02:00
dependabot[bot]
f11cc8fea1
chore(deps): bump idna in /.github/workflows/dependencies (#12688)
Bumps [idna](https://github.com/kjd/idna) from 3.9 to 3.10.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst)
- [Commits](https://github.com/kjd/idna/compare/v3.9...v3.10)

---
updated-dependencies:
- dependency-name: idna
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-22 16:20:33 +02:00
Rafael Monico
b67d2f6cf6 feat(oc): supporting OPENSHIFT_NAMESPACE variable 2024-05-22 13:54:53 -03:00
3 changed files with 32 additions and 2 deletions

View file

@ -1,6 +1,6 @@
certifi==2024.8.30
charset-normalizer==3.3.2
idna==3.9
idna==3.10
PyYAML==6.0.2
requests==2.32.3
semver==3.0.2

View file

@ -163,7 +163,7 @@ function git_current_branch() {
}
# Outputs the name of the previously checked out branch
# Usage example: git pull origin $(git_current_branch)
# Usage example: git pull origin $(git_previous_branch)
# rev-parse --symbolic-full-name @{-1} only prints if it is a branch
function git_previous_branch() {
local ref

View file

@ -5,4 +5,34 @@
if [ $commands[oc] ]; then
source <(oc completion zsh)
compdef _oc oc
OC_PLUGIN_INITIALIZED=no
function oc_prompt_info() {
[ -n "$OPENSHIFT_NAMESPACE" ] && echo -ne "\n(openshift: $OPENSHIFT_NAMESPACE)\n\x00"
}
# TODO Completion
function oc-namespace() {
# TODO -h / --help
# TODO "--clear" should unset variable
# when nothing passed should show usage
# TODO Rename this to "oc" and call binary oc with full path
# so this can become a subcommand: "oc localenv namespace xyz"
[ -n "$1" ] \
&& export OPENSHIFT_NAMESPACE="$1" \
|| unset OPENSHIFT_NAMESPACE
[ "$OC_PLUGIN_INITIALIZED" = "no" ] && {
export PROMPT='$(oc_prompt_info)'"$PROMPT"
# TODO Check if text "oc_prompt_info" is in "$PROMPT"
# instead set this variable
export OC_PLUGIN_INITIALIZED=yes
}
}
alias oc='oc ${OPENSHIFT_NAMESPACE:+"--namespace=$OPENSHIFT_NAMESPACE"}'
else
echo "oc plugin error: oc command not found..."
fi