From 3ab29c094aa79ad65b14ed0de0e4d51277db8df6 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Tue, 8 Aug 2023 02:03:45 +0900 Subject: [PATCH 1/2] Enable dprint completions in each main shells eval style makes 8~10ms slower --- home-manager/bash.nix | 2 ++ home-manager/fish.nix | 4 +++- home-manager/zsh.nix | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/home-manager/bash.nix b/home-manager/bash.nix index a3b7c062..745b3fc9 100644 --- a/home-manager/bash.nix +++ b/home-manager/bash.nix @@ -72,6 +72,8 @@ } # shellcheck disable=SC2034 starship_precmd_user_func="set_win_title" + + eval "$(${lib.getBin pkgs.dprint}/bin/dprint completions bash)" '' + builtins.readFile ./initExtra.bash; logoutExtra = '' diff --git a/home-manager/fish.nix b/home-manager/fish.nix index 23358037..ed9cbf49 100644 --- a/home-manager/fish.nix +++ b/home-manager/fish.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: { programs.starship.enableFishIntegration = true; @@ -41,6 +41,8 @@ # I define another la as a homemade scripts # See https://stackoverflow.com/a/36700734/1212807 for using `--erase` functions --erase la + + ${lib.getBin pkgs.dprint}/bin/dprint completions fish | source ''; plugins = [{ diff --git a/home-manager/zsh.nix b/home-manager/zsh.nix index 87d9aa98..9cb9edde 100644 --- a/home-manager/zsh.nix +++ b/home-manager/zsh.nix @@ -118,6 +118,8 @@ } precmd_functions+=(set_win_title) + eval "$(${lib.getBin pkgs.dprint}/bin/dprint completions zsh)" + zshaddhistory() { whence ''${''${(z)1}[1]} >| /dev/null || return 1 } ''; From bd477705b955a81e21d4af5ee6f6b5869797d638 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Tue, 8 Aug 2023 03:46:47 +0900 Subject: [PATCH 2/2] Prefer loading pregenerated file for dprint completions --- dependencies/dprint/completions.bash | 935 +++++++++++++++++++++++++++ dependencies/dprint/completions.fish | 123 ++++ dependencies/dprint/completions.zsh | 611 +++++++++++++++++ home-manager/bash.nix | 2 +- home-manager/fish.nix | 2 +- home-manager/zsh.nix | 2 +- path.go | 2 +- 7 files changed, 1673 insertions(+), 4 deletions(-) create mode 100644 dependencies/dprint/completions.bash create mode 100644 dependencies/dprint/completions.fish create mode 100644 dependencies/dprint/completions.zsh diff --git a/dependencies/dprint/completions.bash b/dependencies/dprint/completions.bash new file mode 100644 index 00000000..9de40993 --- /dev/null +++ b/dependencies/dprint/completions.bash @@ -0,0 +1,935 @@ +_dprint() { + local i cur prev opts cmd + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD - 1]}" + cmd="" + opts="" + + for i in ${COMP_WORDS[@]}; do + case "${cmd},${i}" in + ",$1") + cmd="dprint" + ;; + dprint,check) + cmd="dprint__check" + ;; + dprint,clear-cache) + cmd="dprint__clear__cache" + ;; + dprint,completions) + cmd="dprint__completions" + ;; + dprint,config) + cmd="dprint__config" + ;; + dprint,editor-info) + cmd="dprint__editor__info" + ;; + dprint,editor-service) + cmd="dprint__editor__service" + ;; + dprint,fmt) + cmd="dprint__fmt" + ;; + dprint,help) + cmd="dprint__help" + ;; + dprint,init) + cmd="dprint__init" + ;; + dprint,license) + cmd="dprint__license" + ;; + dprint,output-file-paths) + cmd="dprint__output__file__paths" + ;; + dprint,output-format-times) + cmd="dprint__output__format__times" + ;; + dprint,output-resolved-config) + cmd="dprint__output__resolved__config" + ;; + dprint,upgrade) + cmd="dprint__upgrade" + ;; + dprint__config,add) + cmd="dprint__config__add" + ;; + dprint__config,help) + cmd="dprint__config__help" + ;; + dprint__config,init) + cmd="dprint__config__init" + ;; + dprint__config,update) + cmd="dprint__config__update" + ;; + dprint__config__help,add) + cmd="dprint__config__help__add" + ;; + dprint__config__help,help) + cmd="dprint__config__help__help" + ;; + dprint__config__help,init) + cmd="dprint__config__help__init" + ;; + dprint__config__help,update) + cmd="dprint__config__help__update" + ;; + dprint__help,check) + cmd="dprint__help__check" + ;; + dprint__help,clear-cache) + cmd="dprint__help__clear__cache" + ;; + dprint__help,completions) + cmd="dprint__help__completions" + ;; + dprint__help,config) + cmd="dprint__help__config" + ;; + dprint__help,editor-info) + cmd="dprint__help__editor__info" + ;; + dprint__help,editor-service) + cmd="dprint__help__editor__service" + ;; + dprint__help,fmt) + cmd="dprint__help__fmt" + ;; + dprint__help,help) + cmd="dprint__help__help" + ;; + dprint__help,init) + cmd="dprint__help__init" + ;; + dprint__help,license) + cmd="dprint__help__license" + ;; + dprint__help,output-file-paths) + cmd="dprint__help__output__file__paths" + ;; + dprint__help,output-format-times) + cmd="dprint__help__output__format__times" + ;; + dprint__help,output-resolved-config) + cmd="dprint__help__output__resolved__config" + ;; + dprint__help,upgrade) + cmd="dprint__help__upgrade" + ;; + dprint__help__config,add) + cmd="dprint__help__config__add" + ;; + dprint__help__config,init) + cmd="dprint__help__config__init" + ;; + dprint__help__config,update) + cmd="dprint__help__config__update" + ;; + *) ;; + esac + done + + case "${cmd}" in + dprint) + opts="-c -h -V --config --plugins --verbose --help --version init fmt check config output-file-paths output-resolved-config output-format-times clear-cache upgrade completions license editor-info editor-service help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__check) + opts="-c -h --excludes --allow-node-modules --incremental --config --plugins --verbose --help [files]..." + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --excludes) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --incremental) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__clear__cache) + opts="-c -h --config --plugins --verbose --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__completions) + opts="-c -h --config --plugins --verbose --help bash elvish fish powershell zsh" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__config) + opts="-c -h --config --plugins --verbose --help init update add help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__config__add) + opts="-c -h --config --plugins --verbose --help [url-or-plugin-name]" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__config__help) + opts="init update add help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__config__help__add) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__config__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__config__help__init) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__config__help__update) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__config__init) + opts="-c -h --config --plugins --verbose --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__config__update) + opts="-y -c -h --yes --config --plugins --verbose --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__editor__info) + opts="-c -h --config --plugins --verbose --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__editor__service) + opts="-c -h --parent-pid --config --plugins --verbose --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --parent-pid) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__fmt) + opts="-c -h --excludes --allow-node-modules --incremental --stdin --diff --skip-stable-format --config --plugins --verbose --help [files]..." + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --excludes) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --incremental) + COMPREPLY=($(compgen -W "true false" -- "${cur}")) + return 0 + ;; + --stdin) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help) + opts="init fmt check config output-file-paths output-resolved-config output-format-times clear-cache upgrade completions license editor-info editor-service help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__check) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__clear__cache) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__completions) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__config) + opts="init update add" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__config__add) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__config__init) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__config__update) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__editor__info) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__editor__service) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__fmt) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__init) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__license) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__output__file__paths) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__output__format__times) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__output__resolved__config) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__help__upgrade) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__init) + opts="-c -h --config --plugins --verbose --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__license) + opts="-c -h --config --plugins --verbose --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__output__file__paths) + opts="-c -h --excludes --allow-node-modules --config --plugins --verbose --help [files]..." + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --excludes) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__output__format__times) + opts="-c -h --excludes --allow-node-modules --config --plugins --verbose --help [files]..." + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --excludes) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__output__resolved__config) + opts="-c -h --config --plugins --verbose --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + dprint__upgrade) + opts="-c -h --config --plugins --verbose --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]]; then + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + fi + case "${prev}" in + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --plugins) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + esac +} + +complete -F _dprint -o bashdefault -o default dprint diff --git a/dependencies/dprint/completions.fish b/dependencies/dprint/completions.fish new file mode 100644 index 00000000..6ff4e0f1 --- /dev/null +++ b/dependencies/dprint/completions.fish @@ -0,0 +1,123 @@ +complete -c dprint -n "__fish_use_subcommand" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_use_subcommand" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_use_subcommand" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_use_subcommand" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_use_subcommand" -s V -l version -d 'Print version' +complete -c dprint -n "__fish_use_subcommand" -f -a "init" -d 'Initializes a configuration file in the current directory.' +complete -c dprint -n "__fish_use_subcommand" -f -a "fmt" -d 'Formats the source files and writes the result to the file system.' +complete -c dprint -n "__fish_use_subcommand" -f -a "check" -d 'Checks for any files that haven\'t been formatted.' +complete -c dprint -n "__fish_use_subcommand" -f -a "config" -d 'Functionality related to the configuration file.' +complete -c dprint -n "__fish_use_subcommand" -f -a "output-file-paths" -d 'Prints the resolved file paths for the plugins based on the args and configuration.' +complete -c dprint -n "__fish_use_subcommand" -f -a "output-resolved-config" -d 'Prints the resolved configuration for the plugins based on the args and configuration.' +complete -c dprint -n "__fish_use_subcommand" -f -a "output-format-times" -d 'Prints the amount of time it takes to format each file. Use this for debugging.' +complete -c dprint -n "__fish_use_subcommand" -f -a "clear-cache" -d 'Deletes the plugin cache directory.' +complete -c dprint -n "__fish_use_subcommand" -f -a "upgrade" -d 'Upgrades the dprint executable.' +complete -c dprint -n "__fish_use_subcommand" -f -a "completions" -d 'Generate shell completions script for dprint' +complete -c dprint -n "__fish_use_subcommand" -f -a "license" -d 'Outputs the software license.' +complete -c dprint -n "__fish_use_subcommand" -f -a "editor-info" +complete -c dprint -n "__fish_use_subcommand" -f -a "editor-service" +complete -c dprint -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c dprint -n "__fish_seen_subcommand_from init" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_seen_subcommand_from init" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from init" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_seen_subcommand_from init" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_seen_subcommand_from fmt" -l excludes -d 'List of file patterns or directories in quotes to exclude when formatting. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from fmt" -l incremental -d 'Only format files when they change. This may alternatively be specified in the configuration file.' -r -f -a "{true ,false }" +complete -c dprint -n "__fish_seen_subcommand_from fmt" -l stdin -d 'Format stdin and output the result to stdout. Provide an absolute file path to apply the inclusion and exclusion rules or an extension or file name to always format the text.' -r +complete -c dprint -n "__fish_seen_subcommand_from fmt" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_seen_subcommand_from fmt" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from fmt" -l allow-node-modules -d 'Allows traversing node module directories (unstable - This flag will be renamed to be non-node specific in the future).' +complete -c dprint -n "__fish_seen_subcommand_from fmt" -l diff -d 'Outputs a check-like diff of every formatted file.' +complete -c dprint -n "__fish_seen_subcommand_from fmt" -l skip-stable-format -d 'Whether to skip formatting a file multiple times until the output is stable' +complete -c dprint -n "__fish_seen_subcommand_from fmt" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_seen_subcommand_from fmt" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_seen_subcommand_from check" -l excludes -d 'List of file patterns or directories in quotes to exclude when formatting. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from check" -l incremental -d 'Only format files when they change. This may alternatively be specified in the configuration file.' -r -f -a "{true ,false }" +complete -c dprint -n "__fish_seen_subcommand_from check" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_seen_subcommand_from check" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from check" -l allow-node-modules -d 'Allows traversing node module directories (unstable - This flag will be renamed to be non-node specific in the future).' +complete -c dprint -n "__fish_seen_subcommand_from check" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_seen_subcommand_from check" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from update; and not __fish_seen_subcommand_from add; and not __fish_seen_subcommand_from help" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from update; and not __fish_seen_subcommand_from add; and not __fish_seen_subcommand_from help" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from update; and not __fish_seen_subcommand_from add; and not __fish_seen_subcommand_from help" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from update; and not __fish_seen_subcommand_from add; and not __fish_seen_subcommand_from help" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from update; and not __fish_seen_subcommand_from add; and not __fish_seen_subcommand_from help" -f -a "init" -d 'Initializes a configuration file in the current directory.' +complete -c dprint -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from update; and not __fish_seen_subcommand_from add; and not __fish_seen_subcommand_from help" -f -a "update" -d 'Updates the plugins in the configuration file.' +complete -c dprint -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from update; and not __fish_seen_subcommand_from add; and not __fish_seen_subcommand_from help" -f -a "add" -d 'Adds a plugin to the configuration file.' +complete -c dprint -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from update; and not __fish_seen_subcommand_from add; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from init" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from init" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from init" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from init" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from update" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from update" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from update" -s y -l yes -d 'Upgrade process plugins without prompting to confirm checksums.' +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from update" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from update" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from add" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from add" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from add" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from add" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from update; and not __fish_seen_subcommand_from add; and not __fish_seen_subcommand_from help" -f -a "init" -d 'Initializes a configuration file in the current directory.' +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from update; and not __fish_seen_subcommand_from add; and not __fish_seen_subcommand_from help" -f -a "update" -d 'Updates the plugins in the configuration file.' +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from update; and not __fish_seen_subcommand_from add; and not __fish_seen_subcommand_from help" -f -a "add" -d 'Adds a plugin to the configuration file.' +complete -c dprint -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from update; and not __fish_seen_subcommand_from add; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c dprint -n "__fish_seen_subcommand_from output-file-paths" -l excludes -d 'List of file patterns or directories in quotes to exclude when formatting. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from output-file-paths" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_seen_subcommand_from output-file-paths" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from output-file-paths" -l allow-node-modules -d 'Allows traversing node module directories (unstable - This flag will be renamed to be non-node specific in the future).' +complete -c dprint -n "__fish_seen_subcommand_from output-file-paths" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_seen_subcommand_from output-file-paths" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_seen_subcommand_from output-resolved-config" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_seen_subcommand_from output-resolved-config" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from output-resolved-config" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_seen_subcommand_from output-resolved-config" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_seen_subcommand_from output-format-times" -l excludes -d 'List of file patterns or directories in quotes to exclude when formatting. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from output-format-times" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_seen_subcommand_from output-format-times" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from output-format-times" -l allow-node-modules -d 'Allows traversing node module directories (unstable - This flag will be renamed to be non-node specific in the future).' +complete -c dprint -n "__fish_seen_subcommand_from output-format-times" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_seen_subcommand_from output-format-times" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_seen_subcommand_from clear-cache" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_seen_subcommand_from clear-cache" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from clear-cache" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_seen_subcommand_from clear-cache" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_seen_subcommand_from upgrade" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_seen_subcommand_from upgrade" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from upgrade" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_seen_subcommand_from upgrade" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_seen_subcommand_from completions" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_seen_subcommand_from completions" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from completions" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_seen_subcommand_from completions" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_seen_subcommand_from license" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_seen_subcommand_from license" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from license" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_seen_subcommand_from license" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_seen_subcommand_from editor-info" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_seen_subcommand_from editor-info" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from editor-info" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_seen_subcommand_from editor-info" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_seen_subcommand_from editor-service" -l parent-pid -r +complete -c dprint -n "__fish_seen_subcommand_from editor-service" -s c -l config -d 'Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.' -r +complete -c dprint -n "__fish_seen_subcommand_from editor-service" -l plugins -d 'List of urls or file paths of plugins to use. This overrides what is specified in the config file.' -r +complete -c dprint -n "__fish_seen_subcommand_from editor-service" -l verbose -d 'Prints additional diagnostic information.' +complete -c dprint -n "__fish_seen_subcommand_from editor-service" -s h -l help -d 'Print help' +complete -c dprint -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from fmt; and not __fish_seen_subcommand_from check; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from output-file-paths; and not __fish_seen_subcommand_from output-resolved-config; and not __fish_seen_subcommand_from output-format-times; and not __fish_seen_subcommand_from clear-cache; and not __fish_seen_subcommand_from upgrade; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from license; and not __fish_seen_subcommand_from editor-info; and not __fish_seen_subcommand_from editor-service; and not __fish_seen_subcommand_from help" -f -a "init" -d 'Initializes a configuration file in the current directory.' +complete -c dprint -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from fmt; and not __fish_seen_subcommand_from check; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from output-file-paths; and not __fish_seen_subcommand_from output-resolved-config; and not __fish_seen_subcommand_from output-format-times; and not __fish_seen_subcommand_from clear-cache; and not __fish_seen_subcommand_from upgrade; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from license; and not __fish_seen_subcommand_from editor-info; and not __fish_seen_subcommand_from editor-service; and not __fish_seen_subcommand_from help" -f -a "fmt" -d 'Formats the source files and writes the result to the file system.' +complete -c dprint -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from fmt; and not __fish_seen_subcommand_from check; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from output-file-paths; and not __fish_seen_subcommand_from output-resolved-config; and not __fish_seen_subcommand_from output-format-times; and not __fish_seen_subcommand_from clear-cache; and not __fish_seen_subcommand_from upgrade; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from license; and not __fish_seen_subcommand_from editor-info; and not __fish_seen_subcommand_from editor-service; and not __fish_seen_subcommand_from help" -f -a "check" -d 'Checks for any files that haven\'t been formatted.' +complete -c dprint -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from fmt; and not __fish_seen_subcommand_from check; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from output-file-paths; and not __fish_seen_subcommand_from output-resolved-config; and not __fish_seen_subcommand_from output-format-times; and not __fish_seen_subcommand_from clear-cache; and not __fish_seen_subcommand_from upgrade; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from license; and not __fish_seen_subcommand_from editor-info; and not __fish_seen_subcommand_from editor-service; and not __fish_seen_subcommand_from help" -f -a "config" -d 'Functionality related to the configuration file.' +complete -c dprint -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from fmt; and not __fish_seen_subcommand_from check; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from output-file-paths; and not __fish_seen_subcommand_from output-resolved-config; and not __fish_seen_subcommand_from output-format-times; and not __fish_seen_subcommand_from clear-cache; and not __fish_seen_subcommand_from upgrade; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from license; and not __fish_seen_subcommand_from editor-info; and not __fish_seen_subcommand_from editor-service; and not __fish_seen_subcommand_from help" -f -a "output-file-paths" -d 'Prints the resolved file paths for the plugins based on the args and configuration.' +complete -c dprint -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from fmt; and not __fish_seen_subcommand_from check; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from output-file-paths; and not __fish_seen_subcommand_from output-resolved-config; and not __fish_seen_subcommand_from output-format-times; and not __fish_seen_subcommand_from clear-cache; and not __fish_seen_subcommand_from upgrade; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from license; and not __fish_seen_subcommand_from editor-info; and not __fish_seen_subcommand_from editor-service; and not __fish_seen_subcommand_from help" -f -a "output-resolved-config" -d 'Prints the resolved configuration for the plugins based on the args and configuration.' +complete -c dprint -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from fmt; and not __fish_seen_subcommand_from check; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from output-file-paths; and not __fish_seen_subcommand_from output-resolved-config; and not __fish_seen_subcommand_from output-format-times; and not __fish_seen_subcommand_from clear-cache; and not __fish_seen_subcommand_from upgrade; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from license; and not __fish_seen_subcommand_from editor-info; and not __fish_seen_subcommand_from editor-service; and not __fish_seen_subcommand_from help" -f -a "output-format-times" -d 'Prints the amount of time it takes to format each file. Use this for debugging.' +complete -c dprint -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from fmt; and not __fish_seen_subcommand_from check; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from output-file-paths; and not __fish_seen_subcommand_from output-resolved-config; and not __fish_seen_subcommand_from output-format-times; and not __fish_seen_subcommand_from clear-cache; and not __fish_seen_subcommand_from upgrade; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from license; and not __fish_seen_subcommand_from editor-info; and not __fish_seen_subcommand_from editor-service; and not __fish_seen_subcommand_from help" -f -a "clear-cache" -d 'Deletes the plugin cache directory.' +complete -c dprint -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from fmt; and not __fish_seen_subcommand_from check; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from output-file-paths; and not __fish_seen_subcommand_from output-resolved-config; and not __fish_seen_subcommand_from output-format-times; and not __fish_seen_subcommand_from clear-cache; and not __fish_seen_subcommand_from upgrade; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from license; and not __fish_seen_subcommand_from editor-info; and not __fish_seen_subcommand_from editor-service; and not __fish_seen_subcommand_from help" -f -a "upgrade" -d 'Upgrades the dprint executable.' +complete -c dprint -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from fmt; and not __fish_seen_subcommand_from check; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from output-file-paths; and not __fish_seen_subcommand_from output-resolved-config; and not __fish_seen_subcommand_from output-format-times; and not __fish_seen_subcommand_from clear-cache; and not __fish_seen_subcommand_from upgrade; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from license; and not __fish_seen_subcommand_from editor-info; and not __fish_seen_subcommand_from editor-service; and not __fish_seen_subcommand_from help" -f -a "completions" -d 'Generate shell completions script for dprint' +complete -c dprint -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from fmt; and not __fish_seen_subcommand_from check; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from output-file-paths; and not __fish_seen_subcommand_from output-resolved-config; and not __fish_seen_subcommand_from output-format-times; and not __fish_seen_subcommand_from clear-cache; and not __fish_seen_subcommand_from upgrade; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from license; and not __fish_seen_subcommand_from editor-info; and not __fish_seen_subcommand_from editor-service; and not __fish_seen_subcommand_from help" -f -a "license" -d 'Outputs the software license.' +complete -c dprint -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from fmt; and not __fish_seen_subcommand_from check; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from output-file-paths; and not __fish_seen_subcommand_from output-resolved-config; and not __fish_seen_subcommand_from output-format-times; and not __fish_seen_subcommand_from clear-cache; and not __fish_seen_subcommand_from upgrade; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from license; and not __fish_seen_subcommand_from editor-info; and not __fish_seen_subcommand_from editor-service; and not __fish_seen_subcommand_from help" -f -a "editor-info" +complete -c dprint -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from fmt; and not __fish_seen_subcommand_from check; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from output-file-paths; and not __fish_seen_subcommand_from output-resolved-config; and not __fish_seen_subcommand_from output-format-times; and not __fish_seen_subcommand_from clear-cache; and not __fish_seen_subcommand_from upgrade; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from license; and not __fish_seen_subcommand_from editor-info; and not __fish_seen_subcommand_from editor-service; and not __fish_seen_subcommand_from help" -f -a "editor-service" +complete -c dprint -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from fmt; and not __fish_seen_subcommand_from check; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from output-file-paths; and not __fish_seen_subcommand_from output-resolved-config; and not __fish_seen_subcommand_from output-format-times; and not __fish_seen_subcommand_from clear-cache; and not __fish_seen_subcommand_from upgrade; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from license; and not __fish_seen_subcommand_from editor-info; and not __fish_seen_subcommand_from editor-service; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c dprint -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from update; and not __fish_seen_subcommand_from add" -f -a "init" -d 'Initializes a configuration file in the current directory.' +complete -c dprint -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from update; and not __fish_seen_subcommand_from add" -f -a "update" -d 'Updates the plugins in the configuration file.' +complete -c dprint -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from init; and not __fish_seen_subcommand_from update; and not __fish_seen_subcommand_from add" -f -a "add" -d 'Adds a plugin to the configuration file.' diff --git a/dependencies/dprint/completions.zsh b/dependencies/dprint/completions.zsh new file mode 100644 index 00000000..1e181efb --- /dev/null +++ b/dependencies/dprint/completions.zsh @@ -0,0 +1,611 @@ +#compdef dprint + +autoload -U is-at-least + +_dprint() { + typeset -A opt_args + typeset -a _arguments_options + local ret=1 + + if is-at-least 5.2; then + _arguments_options=(-s -S -C) + else + _arguments_options=(-s -C) + fi + + local context curcontext="$curcontext" state line + _arguments "${_arguments_options[@]}" \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +'-V[Print version]' \ +'--version[Print version]' \ +":: :_dprint_commands" \ +"*::: :->dprint" \ +&& ret=0 + case $state in + (dprint) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:dprint-command-$line[1]:" + case $line[1] in + (init) +_arguments "${_arguments_options[@]}" \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(fmt) +_arguments "${_arguments_options[@]}" \ +'--excludes=[List of file patterns or directories in quotes to exclude when formatting. This overrides what is specified in the config file.]:patterns: ' \ +'--incremental=[Only format files when they change. This may alternatively be specified in the configuration file.]' \ +'--stdin=[Format stdin and output the result to stdout. Provide an absolute file path to apply the inclusion and exclusion rules or an extension or file name to always format the text.]:extension/file-name/file-path: ' \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'--allow-node-modules[Allows traversing node module directories (unstable - This flag will be renamed to be non-node specific in the future).]' \ +'--diff[Outputs a check-like diff of every formatted file.]' \ +'--skip-stable-format[Whether to skip formatting a file multiple times until the output is stable]' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +'*::files -- List of file patterns in quotes to format. This overrides what is specified in the config file.:' \ +&& ret=0 +;; +(check) +_arguments "${_arguments_options[@]}" \ +'--excludes=[List of file patterns or directories in quotes to exclude when formatting. This overrides what is specified in the config file.]:patterns: ' \ +'--incremental=[Only format files when they change. This may alternatively be specified in the configuration file.]' \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'--allow-node-modules[Allows traversing node module directories (unstable - This flag will be renamed to be non-node specific in the future).]' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +'*::files -- List of file patterns in quotes to format. This overrides what is specified in the config file.:' \ +&& ret=0 +;; +(config) +_arguments "${_arguments_options[@]}" \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_dprint__config_commands" \ +"*::: :->config" \ +&& ret=0 + + case $state in + (config) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:dprint-config-command-$line[1]:" + case $line[1] in + (init) +_arguments "${_arguments_options[@]}" \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(update) +_arguments "${_arguments_options[@]}" \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'-y[Upgrade process plugins without prompting to confirm checksums.]' \ +'--yes[Upgrade process plugins without prompting to confirm checksums.]' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(add) +_arguments "${_arguments_options[@]}" \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +'::url-or-plugin-name:' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +":: :_dprint__config__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:dprint-config-help-command-$line[1]:" + case $line[1] in + (init) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(update) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(add) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(output-file-paths) +_arguments "${_arguments_options[@]}" \ +'--excludes=[List of file patterns or directories in quotes to exclude when formatting. This overrides what is specified in the config file.]:patterns: ' \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'--allow-node-modules[Allows traversing node module directories (unstable - This flag will be renamed to be non-node specific in the future).]' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +'*::files -- List of file patterns in quotes to format. This overrides what is specified in the config file.:' \ +&& ret=0 +;; +(output-resolved-config) +_arguments "${_arguments_options[@]}" \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(output-format-times) +_arguments "${_arguments_options[@]}" \ +'--excludes=[List of file patterns or directories in quotes to exclude when formatting. This overrides what is specified in the config file.]:patterns: ' \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'--allow-node-modules[Allows traversing node module directories (unstable - This flag will be renamed to be non-node specific in the future).]' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +'*::files -- List of file patterns in quotes to format. This overrides what is specified in the config file.:' \ +&& ret=0 +;; +(clear-cache) +_arguments "${_arguments_options[@]}" \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(upgrade) +_arguments "${_arguments_options[@]}" \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(completions) +_arguments "${_arguments_options[@]}" \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +':shell:(bash elvish fish powershell zsh)' \ +&& ret=0 +;; +(license) +_arguments "${_arguments_options[@]}" \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(editor-info) +_arguments "${_arguments_options[@]}" \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(editor-service) +_arguments "${_arguments_options[@]}" \ +'--parent-pid=[]: : ' \ +'-c+[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--config=[Path or url to JSON configuration file. Defaults to dprint.json(c) or .dprint.json(c) in current or ancestor directory when not provided.]: : ' \ +'--plugins=[List of urls or file paths of plugins to use. This overrides what is specified in the config file.]:urls/files: ' \ +'--verbose[Prints additional diagnostic information.]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +":: :_dprint__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:dprint-help-command-$line[1]:" + case $line[1] in + (init) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(fmt) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(check) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(config) +_arguments "${_arguments_options[@]}" \ +":: :_dprint__help__config_commands" \ +"*::: :->config" \ +&& ret=0 + + case $state in + (config) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:dprint-help-config-command-$line[1]:" + case $line[1] in + (init) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(update) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(add) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; +(output-file-paths) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(output-resolved-config) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(output-format-times) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(clear-cache) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(upgrade) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(completions) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(license) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(editor-info) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(editor-service) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +} + +(( $+functions[_dprint_commands] )) || +_dprint_commands() { + local commands; commands=( +'init:Initializes a configuration file in the current directory.' \ +'fmt:Formats the source files and writes the result to the file system.' \ +'check:Checks for any files that haven'\''t been formatted.' \ +'config:Functionality related to the configuration file.' \ +'output-file-paths:Prints the resolved file paths for the plugins based on the args and configuration.' \ +'output-resolved-config:Prints the resolved configuration for the plugins based on the args and configuration.' \ +'output-format-times:Prints the amount of time it takes to format each file. Use this for debugging.' \ +'clear-cache:Deletes the plugin cache directory.' \ +'upgrade:Upgrades the dprint executable.' \ +'completions:Generate shell completions script for dprint' \ +'license:Outputs the software license.' \ +'editor-info:' \ +'editor-service:' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'dprint commands' commands "$@" +} +(( $+functions[_dprint__config__add_commands] )) || +_dprint__config__add_commands() { + local commands; commands=() + _describe -t commands 'dprint config add commands' commands "$@" +} +(( $+functions[_dprint__config__help__add_commands] )) || +_dprint__config__help__add_commands() { + local commands; commands=() + _describe -t commands 'dprint config help add commands' commands "$@" +} +(( $+functions[_dprint__help__config__add_commands] )) || +_dprint__help__config__add_commands() { + local commands; commands=() + _describe -t commands 'dprint help config add commands' commands "$@" +} +(( $+functions[_dprint__check_commands] )) || +_dprint__check_commands() { + local commands; commands=() + _describe -t commands 'dprint check commands' commands "$@" +} +(( $+functions[_dprint__help__check_commands] )) || +_dprint__help__check_commands() { + local commands; commands=() + _describe -t commands 'dprint help check commands' commands "$@" +} +(( $+functions[_dprint__clear-cache_commands] )) || +_dprint__clear-cache_commands() { + local commands; commands=() + _describe -t commands 'dprint clear-cache commands' commands "$@" +} +(( $+functions[_dprint__help__clear-cache_commands] )) || +_dprint__help__clear-cache_commands() { + local commands; commands=() + _describe -t commands 'dprint help clear-cache commands' commands "$@" +} +(( $+functions[_dprint__completions_commands] )) || +_dprint__completions_commands() { + local commands; commands=() + _describe -t commands 'dprint completions commands' commands "$@" +} +(( $+functions[_dprint__help__completions_commands] )) || +_dprint__help__completions_commands() { + local commands; commands=() + _describe -t commands 'dprint help completions commands' commands "$@" +} +(( $+functions[_dprint__config_commands] )) || +_dprint__config_commands() { + local commands; commands=( +'init:Initializes a configuration file in the current directory.' \ +'update:Updates the plugins in the configuration file.' \ +'add:Adds a plugin to the configuration file.' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'dprint config commands' commands "$@" +} +(( $+functions[_dprint__help__config_commands] )) || +_dprint__help__config_commands() { + local commands; commands=( +'init:Initializes a configuration file in the current directory.' \ +'update:Updates the plugins in the configuration file.' \ +'add:Adds a plugin to the configuration file.' \ + ) + _describe -t commands 'dprint help config commands' commands "$@" +} +(( $+functions[_dprint__editor-info_commands] )) || +_dprint__editor-info_commands() { + local commands; commands=() + _describe -t commands 'dprint editor-info commands' commands "$@" +} +(( $+functions[_dprint__help__editor-info_commands] )) || +_dprint__help__editor-info_commands() { + local commands; commands=() + _describe -t commands 'dprint help editor-info commands' commands "$@" +} +(( $+functions[_dprint__editor-service_commands] )) || +_dprint__editor-service_commands() { + local commands; commands=() + _describe -t commands 'dprint editor-service commands' commands "$@" +} +(( $+functions[_dprint__help__editor-service_commands] )) || +_dprint__help__editor-service_commands() { + local commands; commands=() + _describe -t commands 'dprint help editor-service commands' commands "$@" +} +(( $+functions[_dprint__fmt_commands] )) || +_dprint__fmt_commands() { + local commands; commands=() + _describe -t commands 'dprint fmt commands' commands "$@" +} +(( $+functions[_dprint__help__fmt_commands] )) || +_dprint__help__fmt_commands() { + local commands; commands=() + _describe -t commands 'dprint help fmt commands' commands "$@" +} +(( $+functions[_dprint__config__help_commands] )) || +_dprint__config__help_commands() { + local commands; commands=( +'init:Initializes a configuration file in the current directory.' \ +'update:Updates the plugins in the configuration file.' \ +'add:Adds a plugin to the configuration file.' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'dprint config help commands' commands "$@" +} +(( $+functions[_dprint__config__help__help_commands] )) || +_dprint__config__help__help_commands() { + local commands; commands=() + _describe -t commands 'dprint config help help commands' commands "$@" +} +(( $+functions[_dprint__help_commands] )) || +_dprint__help_commands() { + local commands; commands=( +'init:Initializes a configuration file in the current directory.' \ +'fmt:Formats the source files and writes the result to the file system.' \ +'check:Checks for any files that haven'\''t been formatted.' \ +'config:Functionality related to the configuration file.' \ +'output-file-paths:Prints the resolved file paths for the plugins based on the args and configuration.' \ +'output-resolved-config:Prints the resolved configuration for the plugins based on the args and configuration.' \ +'output-format-times:Prints the amount of time it takes to format each file. Use this for debugging.' \ +'clear-cache:Deletes the plugin cache directory.' \ +'upgrade:Upgrades the dprint executable.' \ +'completions:Generate shell completions script for dprint' \ +'license:Outputs the software license.' \ +'editor-info:' \ +'editor-service:' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'dprint help commands' commands "$@" +} +(( $+functions[_dprint__help__help_commands] )) || +_dprint__help__help_commands() { + local commands; commands=() + _describe -t commands 'dprint help help commands' commands "$@" +} +(( $+functions[_dprint__config__help__init_commands] )) || +_dprint__config__help__init_commands() { + local commands; commands=() + _describe -t commands 'dprint config help init commands' commands "$@" +} +(( $+functions[_dprint__config__init_commands] )) || +_dprint__config__init_commands() { + local commands; commands=() + _describe -t commands 'dprint config init commands' commands "$@" +} +(( $+functions[_dprint__help__config__init_commands] )) || +_dprint__help__config__init_commands() { + local commands; commands=() + _describe -t commands 'dprint help config init commands' commands "$@" +} +(( $+functions[_dprint__help__init_commands] )) || +_dprint__help__init_commands() { + local commands; commands=() + _describe -t commands 'dprint help init commands' commands "$@" +} +(( $+functions[_dprint__init_commands] )) || +_dprint__init_commands() { + local commands; commands=() + _describe -t commands 'dprint init commands' commands "$@" +} +(( $+functions[_dprint__help__license_commands] )) || +_dprint__help__license_commands() { + local commands; commands=() + _describe -t commands 'dprint help license commands' commands "$@" +} +(( $+functions[_dprint__license_commands] )) || +_dprint__license_commands() { + local commands; commands=() + _describe -t commands 'dprint license commands' commands "$@" +} +(( $+functions[_dprint__help__output-file-paths_commands] )) || +_dprint__help__output-file-paths_commands() { + local commands; commands=() + _describe -t commands 'dprint help output-file-paths commands' commands "$@" +} +(( $+functions[_dprint__output-file-paths_commands] )) || +_dprint__output-file-paths_commands() { + local commands; commands=() + _describe -t commands 'dprint output-file-paths commands' commands "$@" +} +(( $+functions[_dprint__help__output-format-times_commands] )) || +_dprint__help__output-format-times_commands() { + local commands; commands=() + _describe -t commands 'dprint help output-format-times commands' commands "$@" +} +(( $+functions[_dprint__output-format-times_commands] )) || +_dprint__output-format-times_commands() { + local commands; commands=() + _describe -t commands 'dprint output-format-times commands' commands "$@" +} +(( $+functions[_dprint__help__output-resolved-config_commands] )) || +_dprint__help__output-resolved-config_commands() { + local commands; commands=() + _describe -t commands 'dprint help output-resolved-config commands' commands "$@" +} +(( $+functions[_dprint__output-resolved-config_commands] )) || +_dprint__output-resolved-config_commands() { + local commands; commands=() + _describe -t commands 'dprint output-resolved-config commands' commands "$@" +} +(( $+functions[_dprint__config__help__update_commands] )) || +_dprint__config__help__update_commands() { + local commands; commands=() + _describe -t commands 'dprint config help update commands' commands "$@" +} +(( $+functions[_dprint__config__update_commands] )) || +_dprint__config__update_commands() { + local commands; commands=() + _describe -t commands 'dprint config update commands' commands "$@" +} +(( $+functions[_dprint__help__config__update_commands] )) || +_dprint__help__config__update_commands() { + local commands; commands=() + _describe -t commands 'dprint help config update commands' commands "$@" +} +(( $+functions[_dprint__help__upgrade_commands] )) || +_dprint__help__upgrade_commands() { + local commands; commands=() + _describe -t commands 'dprint help upgrade commands' commands "$@" +} +(( $+functions[_dprint__upgrade_commands] )) || +_dprint__upgrade_commands() { + local commands; commands=() + _describe -t commands 'dprint upgrade commands' commands "$@" +} + +if [ "$funcstack[1]" = "_dprint" ]; then + _dprint "$@" +else + compdef _dprint dprint +fi diff --git a/home-manager/bash.nix b/home-manager/bash.nix index 745b3fc9..3ade0038 100644 --- a/home-manager/bash.nix +++ b/home-manager/bash.nix @@ -73,7 +73,7 @@ # shellcheck disable=SC2034 starship_precmd_user_func="set_win_title" - eval "$(${lib.getBin pkgs.dprint}/bin/dprint completions bash)" + source "${../dependencies/dprint/completions.bash}" '' + builtins.readFile ./initExtra.bash; logoutExtra = '' diff --git a/home-manager/fish.nix b/home-manager/fish.nix index ed9cbf49..1effd9f9 100644 --- a/home-manager/fish.nix +++ b/home-manager/fish.nix @@ -42,7 +42,7 @@ # See https://stackoverflow.com/a/36700734/1212807 for using `--erase` functions --erase la - ${lib.getBin pkgs.dprint}/bin/dprint completions fish | source + source "${../dependencies/dprint/completions.fish}" ''; plugins = [{ diff --git a/home-manager/zsh.nix b/home-manager/zsh.nix index 9cb9edde..730f1e2c 100644 --- a/home-manager/zsh.nix +++ b/home-manager/zsh.nix @@ -118,7 +118,7 @@ } precmd_functions+=(set_win_title) - eval "$(${lib.getBin pkgs.dprint}/bin/dprint completions zsh)" + source "${../dependencies/dprint/completions.zsh}" zshaddhistory() { whence ''${''${(z)1}[1]} >| /dev/null || return 1 } ''; diff --git a/path.go b/path.go index 05b69a48..5efa4c4f 100644 --- a/path.go +++ b/path.go @@ -28,7 +28,7 @@ type Walker struct { func GetWalker() Walker { w := Walker{ - ignoredDirectories: []string{".git", ".direnv", "dist"}, + ignoredDirectories: []string{".git", ".direnv", "dist", "dependencies"}, } w.reports = w.GetReports()