make more compact with a function

This commit is contained in:
Vivianne Langdon 2022-03-12 04:24:22 -08:00
parent 822868bf87
commit 4530d4917a

View file

@ -40,7 +40,6 @@ function __bw_complete -a cmds cmd desc
complete -f -c bw-dev -n "not __fish_seen_subcommand_from $cmds" -a $cmd -d $desc complete -f -c bw-dev -n "not __fish_seen_subcommand_from $cmds" -a $cmd -d $desc
end end
__bw_complete "$commands" "up" "bring one or all service(s) up" __bw_complete "$commands" "up" "bring one or all service(s) up"
__bw_complete "$commands" "service_ports_web" "run command on the web container with its portsenabled and mapped" __bw_complete "$commands" "service_ports_web" "run command on the web container with its portsenabled and mapped"
__bw_complete "$commands" "initdb" "initialize database" __bw_complete "$commands" "initdb" "initialize database"
@ -76,22 +75,16 @@ __bw_complete "$commands" "setup" "perform first-time setup"
__bw_complete "$commands" "admin_code" "get the admin code" __bw_complete "$commands" "admin_code" "get the admin code"
__bw_complete "$commands" "runweb" "run a command on the web container" __bw_complete "$commands" "runweb" "run a command on the web container"
complete -f -c bw-dev -n "__fish_seen_subcommand_from up"\
-a "(docker-compose config --service)"
complete -x -c bw-dev -n "__fish_seen_subcommand_from migrate" function __bw_complete_subcommand -a cmd
complete -f -c bw-dev -n "__fish_seen_subcommand_from $cmd" $argv[2..-1]
end
complete -x -c bw-dev -n "__fish_seen_subcommand_from pytest"\ __bw_complete_subcommand "up" -a "(docker-compose config --service)"
-a "bookwyrm/tests/**.py" __bw_complete_subcommand "migrate"
__bw_complete_subcommand "pytest" -a "bookwyrm/tests/**.py"
complete -x -c bw-dev -n "__fish_seen_subcommand_from populate_streams"\ __bw_complete_subcommand "populate_streams" -a "--stream=" -d "pick a single stream to populate"
-a "--stream=" -d "pick a single stream to populate" __bw_complete_subcommand "populate_streams" -l stream -a "home local books"
__bw_complete_subcommand "generate_preview_images" -a "--all"\
complete -x -c bw-dev -n "__fish_seen_subcommand_from populate_streams"\ -d "Generates images for ALL types: site, users and books. Can use a lot of computing power."
-l stream -a "home local books" __bw_complete_subcommand "set_cors_to_s3" -a "**.json"
complete -x -c bw-dev -n "__fish_seen_subcommand_from generate_preview_images"\
-a "--all" -d "Generates images for ALL types: site, users and books. Can use a lot of computing power."
complete -x -c bw-dev -n "__fish_seen_subcommand_from set_cors_to_s3"\
-a "**.json"