From 2f6e52f82c69ca5aedfbd7c73a63f8fb20bb39f6 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sat, 13 Dec 2025 09:40:31 -0500 Subject: add a note on bash completions --- bash_completion | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 bash_completion diff --git a/bash_completion b/bash_completion new file mode 100644 index 0000000..a1d413b --- /dev/null +++ b/bash_completion @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# I don't use bash on the regular, but this seems to work and I imagine is +# useful to many. +_dpw_complete() { + local cur + cur="${COMP_WORDS[COMP_CWORD]}" + local sub="show copy type list ls mv cp rm edit otp fnd find insert" + + if [[ ${COMP_CWORD} -eq 1 ]]; then + COMPREPLY=($(compgen -W "${sub}" -- "${cur}")) + elif [[ ${COMP_CWORD} -eq 2 ]]; then + COMPREPLY=($(compgen -W "$(command dpw list)" -- "${cur}")) + else + COMPREPLY=($(compgen -f -- "${cur}")) + fi + + return 0 +} +complete -F _dpw_complete dpw -- cgit v1.2.3