Skip to content

Commit

Permalink
complete ddev-ahoy elements
Browse files Browse the repository at this point in the history
  • Loading branch information
hanoii committed Mar 25, 2024
1 parent bd8b1ae commit 4dfaa3d
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .ddev/addon-metadata/pimp-my-shell/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: pimp-my-shell
repository: .
version: ""
install_date: "2024-03-25T12:13:21-03:00"
install_date: "2024-03-25T12:39:37-03:00"
project_files:
- web-build/Dockerfile.pimp-my-shell
- homeadditions/.bashrc.d/pimp-my-shell
- config.pimp-my-shell.yaml
- commands/web/ahoy
- homeadditions/.local/share/bash-completion/completions/ahoy
global_files: []
removal_actions: []
8 changes: 8 additions & 0 deletions .ddev/commands/web/ahoy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
#ddev-generated

## Description: Run ahoy inside the web container
## Usage: ahoy [args]
## Example: "ddev ahoy some:command"

ahoy $@
10 changes: 9 additions & 1 deletion .ddev/config.pimp-my-shell.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
#ddev-generated
webimage_extra_packages: [boxes, bsdmainutils, build-essential, kitty-terminfo, libarchive-tools, lua5.4, pv]
webimage_extra_packages:
- bash-completion
- boxes
- bsdmainutils
- build-essential
- kitty-terminfo
- libarchive-tools
- lua5.4
- pv
5 changes: 5 additions & 0 deletions .ddev/homeadditions/.bashrc.d/pimp-my-shell
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#ddev-generated

# ahoy
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}

# fzf
[ -f /opt/.fzf.bash ] && source /opt/.fzf.bash

# fzf-git
if ! grep -qxF "source /opt/fzf-git.sh/fzf-git.sh" ~/.bashrc ; then
echo -e "\n# Added by ddev-fzf add-on on $(date -u "+%Y-%m-%d %H:%m") \nsource /opt/fzf-git.sh/fzf-git.sh" >> ~/.bashrc
fi
Expand Down
16 changes: 16 additions & 0 deletions .ddev/homeadditions/.local/share/bash-completion/completions/ahoy
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
#ddev-generated
# @see https://ahoy-cli.readthedocs.io/en/latest/#bash-zsh-completion

: ${PROG:=$(basename ${BASH_SOURCE})}

_cli_bash_autocomplete() {
local cur opts base
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion )
COMPREPLY=( $(compgen -W "${opts}" -- $cur) )
return 0
}

complete -F _cli_bash_autocomplete $PROG
8 changes: 8 additions & 0 deletions commands/web/ahoy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
#ddev-generated

## Description: Run ahoy inside the web container
## Usage: ahoy [args]
## Example: "ddev ahoy some:command"

ahoy $@
10 changes: 9 additions & 1 deletion config.pimp-my-shell.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
#ddev-generated
webimage_extra_packages: [boxes, bsdmainutils, build-essential, kitty-terminfo, libarchive-tools, lua5.4, pv]
webimage_extra_packages:
- bash-completion
- boxes
- bsdmainutils
- build-essential
- kitty-terminfo
- libarchive-tools
- lua5.4
- pv
5 changes: 5 additions & 0 deletions homeadditions/.bashrc.d/pimp-my-shell
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#ddev-generated

# ahoy
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}

# fzf
[ -f /opt/.fzf.bash ] && source /opt/.fzf.bash

# fzf-git
if ! grep -qxF "source /opt/fzf-git.sh/fzf-git.sh" ~/.bashrc ; then
echo -e "\n# Added by ddev-fzf add-on on $(date -u "+%Y-%m-%d %H:%m") \nsource /opt/fzf-git.sh/fzf-git.sh" >> ~/.bashrc
fi
Expand Down
16 changes: 16 additions & 0 deletions homeadditions/.local/share/bash-completion/completions/ahoy
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
#ddev-generated
# @see https://ahoy-cli.readthedocs.io/en/latest/#bash-zsh-completion

: ${PROG:=$(basename ${BASH_SOURCE})}

_cli_bash_autocomplete() {
local cur opts base
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion )
COMPREPLY=( $(compgen -W "${opts}" -- $cur) )
return 0
}

complete -F _cli_bash_autocomplete $PROG
2 changes: 2 additions & 0 deletions install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ project_files:
- web-build/Dockerfile.pimp-my-shell
- homeadditions/.bashrc.d/pimp-my-shell
- config.pimp-my-shell.yaml
- commands/web/ahoy
- homeadditions/.local/share/bash-completion/completions/ahoy

0 comments on commit 4dfaa3d

Please sign in to comment.