complete_bwdev.fish 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # bw-dev auto-completions for fish-shell.
  2. # copy this to ~/.config/fish/completions/ with the name `bw-dev.fish`
  3. # this will only work if renamed to `bw-dev.fish`.
  4. set -l commands up \
  5. service_ports_web \
  6. initdb \
  7. resetdb \
  8. makemigrations \
  9. migrate \
  10. bash \
  11. shell \
  12. dbshell \
  13. restart_celery \
  14. pytest \
  15. pytest_coverage_report \
  16. compile_themes \
  17. collectstatic \
  18. makemessages \
  19. compilemessages \
  20. update_locales \
  21. build \
  22. clean \
  23. black \
  24. prettier \
  25. eslint \
  26. stylelint \
  27. formatters \
  28. mypy \
  29. collectstatic_watch \
  30. populate_streams \
  31. populate_lists_streams \
  32. populate_suggestions \
  33. generate_thumbnails \
  34. generate_preview_images \
  35. remove_remote_user_preview_images \
  36. copy_media_to_s3 \
  37. set_cors_to_s3 \
  38. setup \
  39. admin_code \
  40. remove_2fa \
  41. confirm_email \
  42. runweb
  43. function __bw_complete -a cmds cmd desc
  44. complete -f -c bw-dev -n "not __fish_seen_subcommand_from $cmds" -a $cmd -d $desc
  45. end
  46. __bw_complete "$commands" "up" "bring one or all service(s) up"
  47. __bw_complete "$commands" "service_ports_web" "run command on the web container with its portsenabled and mapped"
  48. __bw_complete "$commands" "initdb" "initialize database"
  49. __bw_complete "$commands" "resetdb" "!! WARNING !! reset database"
  50. __bw_complete "$commands" "makemigrations" "create new migrations"
  51. __bw_complete "$commands" "migrate" "perform all migrations"
  52. __bw_complete "$commands" "bash" "open up bash within the web container"
  53. __bw_complete "$commands" "shell" "open the Python shell within the web container"
  54. __bw_complete "$commands" "dbshell" "open the database shell within the web container"
  55. __bw_complete "$commands" "restart_celery" "restart the celery container"
  56. __bw_complete "$commands" "pytest" "run unit tests"
  57. __bw_complete "$commands" "compile_themes" "compile themes css files"
  58. __bw_complete "$commands" "collectstatic" "copy changed static files into the installation"
  59. __bw_complete "$commands" "makemessages" "extract all localizable messages from the code"
  60. __bw_complete "$commands" "compilemessages" "compile .po localization files to .mo"
  61. __bw_complete "$commands" "update_locales" "run makemessages and compilemessages for the en_US and additional locales"
  62. __bw_complete "$commands" "build" "build the containers"
  63. __bw_complete "$commands" "clean" "bring the cluster down and remove all containers"
  64. __bw_complete "$commands" "black" "run Python code formatting tool"
  65. __bw_complete "$commands" "prettier" "run JavaScript code formatting tool"
  66. __bw_complete "$commands" "eslint" "run JavaScript linting tool"
  67. __bw_complete "$commands" "stylelint" "run SCSS linting tool"
  68. __bw_complete "$commands" "formatters" "run multiple formatter tools"
  69. __bw_complete "$commands" "populate_streams" "populate the main streams"
  70. __bw_complete "$commands" "populate_lists_streams" "populate streams for book lists"
  71. __bw_complete "$commands" "populate_suggestions" "populate book suggestions"
  72. __bw_complete "$commands" "generate_thumbnails" "generate book thumbnails"
  73. __bw_complete "$commands" "generate_preview_images" "generate site/book/user preview images"
  74. __bw_complete "$commands" "remove_remote_user_preview_images" "remove preview images for remote users"
  75. __bw_complete "$commands" "collectstatic_watch" "watch filesystem and copy changed static files"
  76. __bw_complete "$commands" "copy_media_to_s3" "run the `s3 cp` command to copy media to a bucket on S3"
  77. __bw_complete "$commands" "sync_media_to_s3" "run the `s3 sync` command to sync media with a bucket on S3"
  78. __bw_complete "$commands" "set_cors_to_s3" "push a CORS configuration defined in .json to s3"
  79. __bw_complete "$commands" "setup" "perform first-time setup"
  80. __bw_complete "$commands" "admin_code" "get the admin code"
  81. __bw_complete "$commands" "remove_2fa" "remove 2FA from user"
  82. __bw_complete "$commands" "confirm_email" "manually confirm email of user and set active"
  83. __bw_complete "$commands" "runweb" "run a command on the web container"
  84. function __bw_complete_subcommand -a cmd
  85. complete -f -c bw-dev -n "__fish_seen_subcommand_from $cmd" $argv[2..-1]
  86. end
  87. __bw_complete_subcommand "up" -a "(docker-compose config --service)"
  88. __bw_complete_subcommand "pytest" -a "bookwyrm/tests/**.py"
  89. __bw_complete_subcommand "populate_streams" -a "--stream=" -d "pick a single stream to populate"
  90. __bw_complete_subcommand "populate_streams" -l stream -a "home local books"
  91. __bw_complete_subcommand "generate_preview_images" -a "--all"\
  92. -d "Generates images for ALL types: site, users and books. Can use a lot of computing power."
  93. __bw_complete_subcommand "set_cors_to_s3" -a "**.json"