1b5af717a987a58deda1873cb28e4b05ba26bba8

Author
Carlo Sala <carlosalag@protonmail.com>
Committer
Carlo Sala <carlosalag@protonmail.com>
Date

Message

fix(pm2): update completion

Closes #12733

Diff

This diff is truncated to protect this page.

  1diff --git a/plugins/pm2/_pm2 b/plugins/pm2/_pm2
  2index 66320b810e25fd127807149369e59ceb05d419b1..afe4ae0dbec09565c9e712f39c32eb5438abf6ff 100644
  3--- a/plugins/pm2/_pm2
  4+++ b/plugins/pm2/_pm2
  5@@ -1,16 +1,233 @@
  6-#!/bin/zsh -f
  7 #compdef pm2
  8-#autoload
  9+# ------------------------------------------------------------------------------
 10+# Description
 11+# -----------
 12+#
 13+#  Completion script for pm2 5.2.2 (https://pm2.keymetrics.io/).
 14+#
 15+# ------------------------------------------------------------------------------
 16+# Authors
 17+# -------
 18+#
 19+#  * Myoungdo Park <mdo.park@gmail.com>
 20+#  * Shohei Yoshida <https://github.com/syohex>
 21+#
 22+# ------------------------------------------------------------------------------
 23 
 24-local -a _1st_arguments
 25+_pm2() {
 26+  typeset -A opt_args
 27+  local context state line
 28 
 29-_1st_arguments=(
 30+  local curcontext="$curcontext"
 31+
 32+  local ret=1
 33+
 34+  _arguments -C \
 35+    '(- *)'{-v,-V,--version}'[print pm2 version]' \
 36+    '(-s --silent)'{-s,--silent}'[hide all messages]' \
 37+    '--ext[watch only this file extension]:extension' \
 38+    '(-n --name)'{-n,--name}'[set a name for the process in the process list]:name' \
 39+    '(-m --mini-list)'{-m,--mini-list}'[display a compacted list without formatting]' \
 40+    '--interpreter[set a specific interpreter to use for executing app(default: node)]:prog' \
 41+    '(--interpreter-args --node-args)'{--interpreter-args,--node-args}'[set arguments to pass to the interpreter]:args' \
 42+    '(-o --output)'{-o,--output}'[specify log file for stdout]: :_files' \
 43+    '(-e --error)'{-e,--error}'[specify log file for stderr]: :_files' \
 44+    '(-l --log)'{-l,--log}'[specify log file which gathers both stdout and stderr]' \
 45+    '--filter-env[filter out outgoing global values that contain provided strings]:envs' \
 46+    '--log-type[specify log output style]: :(raw json)' \
 47+    '--log-date-format[specify log output style]:format' \
 48+    '--time[enable time logging]' \
 49+    '--disable-logs[disable all logs storage]' \
 50+    '*--env[specify which set of environment variables from ecosystem file must be injected]:env' \
 51+    '(-a --update-env)'{-a,--update-env}'[force and update of the environment with restart/reload]' \
 52+    '(-f --force)'{-f,--force}'[force actions]' \
 53+    '(-i --instances)'{-i,--instances}'[launch number instances]:num' \
 54+    '--parallel[number of parallel actions]:num' \
 55+    '--shutdown-with-message[shutdown an application with process.send("shutdown") instead of process.kill(pid, SIGINT)]' \
 56+    '(-p --pid)'{-p,--pid}'[specify pid file]: :_files' \
 57+    '(-k --kill-timeout)'{-k,--kill-timeout}'[delay before sending final SIGKILL signal to process]:delay' \
 58+    '--listen-timeout[listen timeout an application reload]:delay' \
 59+    '--max-memory-restart[restart the app if an amount of memory is exceeded (in bytes)]:bytes' \
 60+    '--restart-delay[specify a delay between restarts(in milliseconds)]:delay' \
 61+    '--exp-backoff-restart-delay[specify a delay between restarts(in milliseconds)]:delay' \
 62+    '(-x --execute-command)'{-e,--execute-command}'[execute a program using fork system]' \
 63+    '--max-restarts[only start the script COUNT times]:count' \
 64+    '(-u --user)'{-u,--user}'[define user when generating startup script]:username' \
 65+    '--uid[run target script with <uid> rights]:uid' \
 66+    '--gid[run target script with <gid> rights]:gui' \
 67+    '--namespace[start application within specified namespace]:namespace' \
 68+    '--cwd[run target script from path <cwd>]:cwd:_paths -/' \
 69+    '--hp[define home path when generating startup script]: :_paths -/' \
 70+    '--wait-ip[override systemd script to wait for full internet connectivity to launch pm2]' \
 71+    '--service-name[define service name when generating startup script]' \
 72+    '(-c --cron --cron-restart)'{-c,--cron,--cron-restart}'[restart a running process based on a cron pattern]:pattern' \
 73+    '(-w --write)'{-w,--write}'[write configuration in local folder]' \
 74+    '--no-daemon[run pm2 daemon in the foreground if it does not exist already]' \
 75+    '(--disable-source-map-support --source-map-support)--source-map-support[force source map support]' \
 76+    '--only[with json declaration, allow to only act on one application]:app' \
 77+    '(--disable-source-map-support --source-map-support)--disable-source-map-support[force disable source map support]' \
 78+    '--wait-ready[ask pm2 to wait for ready event from your app]' \
 79+    '--merge-logs[merge logs from different instances but keep error and out separated]' \
 80+    '*--watch[watch application folder for changes]: :_files -/' \
 81+    '*--ignore-watch[list of paths to ignore]: :_files' \
 82+    '--no-color[skip colors]' \
 83+    '--no-vizion[start an app without vizion feature]' \
 84+    '--np-autorestart[start an app without automatic restart]' \
 85+    '--no-treekill[Only kill the main process, not detached children]' \
 86+    '--no-pmx[start an app without pmx]' \
 87+    '--no-automation[start an app without automation]' \
 88+    '(--disable-trace --trace)--trace[enable transaction tracing with km]' \
 89+    '(--disable-trace --trace)--disable-trace[disable transaction tracing with km]' \
 90+    "--sort[sort process according to field's]:field_name" \
 91+    '--attach[attach logging after your start/restart/stop/reload]' \
 92+    '--v8[enable v8 data collecting]' \
 93+    '--event-loop-inspector[enable event-loop-inspector dump in pmx]' \
 94+    '--deep-monitoring[enable all monitoring tools]' \
 95+    '(- *)'{-h,--help}'[output usage information]' \
 96+    '1: :_pm2_subcommands' \
 97+    '*:: :->subcmds' && return 0
 98+
 99+  case "$state" in
100+    (subcmds)
101+      case $words[1] in
102+        (start)
103+          _arguments \
104+            '--watch[watch folder for changes]' \