i use arch btw
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add bun completions

+163
+163
fish/.config/fish/completions/bun.fish
··· 1 + # This is terribly complicated 2 + # It's because: 3 + # 1. bun run has to have dynamic completions 4 + # 2. there are global options 5 + # 3. bun {install add remove} gets special options 6 + # 4. I don't know how to write fish completions well 7 + # Contributions very welcome!! 8 + 9 + function __fish__get_bun_bins 10 + string split ' ' (bun getcompletes b) 11 + end 12 + 13 + function __fish__get_bun_scripts 14 + set -lx SHELL bash 15 + set -lx MAX_DESCRIPTION_LEN 40 16 + string trim (string split '\n' (string split '\t' (bun getcompletes z))) 17 + end 18 + 19 + function __fish__get_bun_packages 20 + if test (commandline -ct) != "" 21 + set -lx SHELL fish 22 + string split ' ' (bun getcompletes a (commandline -ct)) 23 + end 24 + end 25 + 26 + function __history_completions 27 + set -l tokens (commandline --current-process --tokenize) 28 + history --prefix (commandline) | string replace -r \^$tokens[1]\\s\* "" | string replace -r \^$tokens[2]\\s\* "" | string split ' ' 29 + end 30 + 31 + function __fish__get_bun_bun_js_files 32 + string split ' ' (bun getcompletes j) 33 + end 34 + 35 + function bun_fish_is_nth_token --description 'Test if current token is on Nth place' --argument-names n 36 + set -l tokens (commandline -poc) 37 + set -l tokens (string replace -r --filter '^([^-].*)' '$1' -- $tokens) 38 + test (count $tokens) -eq "$n" 39 + end 40 + 41 + function __bun_command_count --argument-names n 42 + set -l cmds (commandline -poc) 43 + 44 + test (count cmds) -eq "$n" 45 + end 46 + 47 + function __bun_last_cmd --argument-names n 48 + set -l cmds (commandline -poc) 49 + 50 + test "(cmds[-1])" = "$n" 51 + end 52 + 53 + set -l bun_install_boolean_flags yarn production optional development no-save dry-run force no-cache silent verbose global 54 + set -l bun_install_boolean_flags_descriptions "Write a yarn.lock file (yarn v1)" "Don't install devDependencies" "Add dependency to optionalDependencies" "Add dependency to devDependencies" "Don't install devDependencies" "Don't install anything" "Always request the latest versions from the registry & reinstall all dependenices" "Ignore manifest cache entirely" "Don't output anything" "Excessively verbose logging" "Use global folder" 55 + 56 + set -l bun_builtin_cmds dev create help bun upgrade discord run install remove add init link unlink pm x 57 + set -l bun_builtin_cmds_without_run dev create help bun upgrade discord install remove add init pm x 58 + set -l bun_builtin_cmds_without_bun dev create help upgrade run discord install remove add init pm x 59 + set -l bun_builtin_cmds_without_create dev help bun upgrade discord run install remove add init pm x 60 + set -l bun_builtin_cmds_without_install create dev help bun upgrade discord run remove add init pm x 61 + set -l bun_builtin_cmds_without_remove create dev help bun upgrade discord run install add init pm x 62 + set -l bun_builtin_cmds_without_add create dev help bun upgrade discord run remove install init pm x 63 + set -l bun_builtin_cmds_without_pm create dev help bun upgrade discord run init pm x 64 + 65 + # clear 66 + complete -e -c bun 67 + 68 + complete -c bun \ 69 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -a '(__fish__get_bun_scripts)' -d 'script' 70 + complete -c bun \ 71 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from run" -a '(__fish__get_bun_bins)' -d 'package bin' 72 + complete -c bun \ 73 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from run" -a '(__fish__get_bun_scripts)' -d 'script' 74 + complete -c bun \ 75 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from run" -a '(__fish__get_bun_bun_js_files)' -d 'Bun.js' 76 + complete -c bun \ 77 + -n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __fish_use_subcommand" -a 'run' -f -d 'Run a script or bin' 78 + complete -c bun \ 79 + -n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -s 'u' -l 'origin' -r -d 'Server URL. Rewrites import paths' 80 + complete -c bun \ 81 + -n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -s 'p' -l 'port' -r -d 'Port number to start server from' 82 + complete -c bun \ 83 + -n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -s 'd' -l 'define' -r -d 'Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:\"development\"' 84 + complete -c bun \ 85 + -n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -s 'e' -l 'external' -r -d 'Exclude module from transpilation (can use * wildcards). ex: -e react' 86 + complete -c bun \ 87 + -n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -l 'use' -r -d 'Use a framework (ex: next)' 88 + complete -c bun \ 89 + -n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -l 'hot' -r -d 'Enable hot reloading in Bun\'s JavaScript runtime' 90 + 91 + complete -c bun \ 92 + -n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __fish_use_subcommand" -a 'dev' -d 'Start dev server' 93 + complete -c bun \ 94 + -n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'create' -f -d 'Create a new project from a template' 95 + 96 + complete -c bun \ 97 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_create next react; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from create;" -a 'next' -d 'new Next.js project' 98 + 99 + complete -c bun \ 100 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_create next react; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from create;" -a 'react' -d 'new React project' 101 + 102 + complete -c bun \ 103 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -a 'upgrade' -d 'Upgrade bun to the latest version' -x 104 + complete -c bun \ 105 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -a '--help' -d 'See all commands and flags' -x 106 + 107 + complete -c bun \ 108 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -l "version" -s "v" -a '--version' -d 'Bun\'s version' -x 109 + complete -c bun \ 110 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -a 'discord' -d 'Open bun\'s Discord server' -x 111 + 112 + 113 + complete -c bun \ 114 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_bun; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); __fish_use_subcommand" -a 'bun' -d 'Generate a new bundle' 115 + 116 + 117 + complete -c bun \ 118 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_bun; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from bun" -F -d 'Bundle this' 119 + 120 + complete -c bun \ 121 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_create; and not __fish_seen_subcommand_from (__fish__get_bun_bins); and not __fish_seen_subcommand_from (__fish__get_bun_scripts); and __fish_seen_subcommand_from react; or __fish_seen_subcommand_from next" -F -d "Create in directory" 122 + 123 + 124 + complete -c bun \ 125 + -n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'init' -F -d 'Start an empty Bun project' 126 + 127 + complete -c bun \ 128 + -n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'install' -f -d 'Install packages from package.json' 129 + 130 + complete -c bun \ 131 + -n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'add' -F -d 'Add a package to package.json' 132 + 133 + complete -c bun \ 134 + -n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'remove' -F -d 'Remove a package from package.json' 135 + 136 + complete -c bun \ 137 + -n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand add remove" -F 138 + 139 + 140 + for i in (seq (count $bun_install_boolean_flags)) 141 + complete -c bun \ 142 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from install add remove;" -l "$bun_install_boolean_flags[$i]" -d "$bun_install_boolean_flags_descriptions[$i]" 143 + end 144 + 145 + complete -c bun \ 146 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from install add remove;" -l 'cwd' -d 'Change working directory' 147 + 148 + complete -c bun \ 149 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from install add remove;" -l 'cache-dir' -d 'Choose a cache directory (default: $HOME/.bun/install/cache)' 150 + 151 + complete -c bun \ 152 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from add;" -d 'Popular' -a '(__fish__get_bun_packages)' 153 + 154 + complete -c bun \ 155 + -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from add;" -d 'History' -a '(__history_completions)' 156 + 157 + complete -c bun \ 158 + -n "__fish_seen_subcommand_from pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) cache;" -a 'bin ls cache hash hash-print hash-string' -f 159 + 160 + complete -c bun \ 161 + -n "__fish_seen_subcommand_from pm; and __fish_seen_subcommand_from cache; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts);" -a 'rm' -f 162 + 163 + complete -c bun -n "not __fish_seen_subcommand_from $bun_builtin_cmds (__fish__get_bun_bins) (__fish__get_bun_scripts)" -a "$bun_builtin_cmds" -f