Skip to content

feat: exegol aliases #13207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions plugins/exegol/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Exegol plugin

The Exegol plugin provides useful aliases

To use it, add `exegol` to the plugins array of your zshrc file:

```zsh
plugins=(... exegol)
```

## Aliases

| Alias | Command | Description |
| :------ | :------------------------------- | :-------------------------------------------------------- |
| `e` | `exegol` | Shorthand for exegol command |
| `ei` | `exegol info` | Displays exegol information |
| `eu` | `exegol update` | Updates exegol to the latest version |
| `es` | `exegol start` | Starts an Exegol instance |
| `esn` | `exegol start [default] nightly` | Starts a nightly Exegol instance |
| `esf` | `exegol start [default] full` | Starts a full Exegol instance |
| `esf!` | `esf --privileged` | Starts a full Exegol instance with privileged access |
| `esn!` | `esn --privileged` | Starts a nightly Exegol instance with privileged access |
| `etmpn` | `exegol exec --tmp nightly` | Executes a command in a temporary nightly Exegol instance |
| `etmpf` | `exegol exec --tmp full` | Executes a command in a temporary full Exegol instance |
| `estp` | `exegol stop` | Stops an Exegol instance |
| `estpa` | `exegol stop --all` | Stops all Exegol instances |
| `erm` | `exegol remove` | Removes an Exegol instance |
| `erm!` | `exegol remove --force` | Removes an Exegol instance forcefully |
| `erma` | `exegol remove --all` | Removes all Exegol instances |
| `erma!` | `exegol remove --force --all` | Removes all Exegol instances forcefully |
55 changes: 55 additions & 0 deletions plugins/exegol/exegol.plugin.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Return immediately if exegol is not found
if (( ! ${+commands[exegol]} )); then
echo OK
fi

alias e='exegol'
alias ei='exegol info'
alias eu='exegol update'

alias es='exegol start'
function esn() {
local only_dashes=true
for arg in "$@"; do
if [[ ! "$arg" == -* ]]; then
only_dashes=false
break
fi
done

if [[ "$#" == 0 ]] || $only_dashes; then
# If all arguments are dashes or empty, use default name
exegol start default nightly "$@"
else
exegol start "$@" nightly
fi
}
function esf() {
local only_dashes=true
for arg in "$@"; do
if [[ ! "$arg" == -* ]]; then
only_dashes=false
break
fi
done

if [[ "$#" == 0 ]] || $only_dashes; then
# If all arguments are dashes or empty, use default name
exegol start default full "$@"
else
exegol start "$@" full
fi
}
alias esf!='esf --privileged'
alias esn!='esn --privileged'

alias etmpn='exegol exec --tmp nightly'
alias etmpf='exegol exec --tmp full'

alias estp='exegol stop'
alias estpa='exegol stop --all'

alias erm='exegol remove'
alias erm!='exegol remove --force'
alias erma='exegol remove --all'
alias erma!='exegol remove --force --all'