dfd7bf9f4141fe6d2ec9cd067b01ad9920e80a24

Author
Laurent Commarieu <laurent.commarieu@iadvize.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

feat(nomad): add common commands and new readme

Diff

This diff is truncated to protect this page.

  1diff --git a/plugins/nomad/README.md b/plugins/nomad/README.md
  2index ff07e917be093d485a92957df647c6d8bb7ceea6..04b3616834d0a570600c784e3f4c93a2affec6dc 100644
  3--- a/plugins/nomad/README.md
  4+++ b/plugins/nomad/README.md
  5@@ -1,11 +1,15 @@
  6-## About
  7+# Nomad
  8 
  9-Plugin for Nomad, a tool from Hashicorp for easily deploy applications at any scale.
 10+The `nomad` plugin provides a simple autocompletion for [Nomad](https://nomadproject.io/), a tool from Hashicorp for easily deploy applications at any scale.
 11 
 12-### Requirements
 13+## Usage
 14 
 15- * [Nomad](https://nomadproject.io/)
 16+1. Enable the `nomad` plugin:
 17 
 18-### Usage
 19+   ```zsh
 20+   plugins=(... nomad)
 21+   ```
 22 
 23- * Type `nomad` into your prompt and hit `TAB` to see available completion options
 24+2.  Install [Nomad](https://nomadproject.io/)
 25+
 26+3.  Type `nomad` into your prompt and hit `TAB` to see available completion options.
 27diff --git a/plugins/nomad/_nomad b/plugins/nomad/_nomad
 28index 25169f394eddf2c707753912aa712d4c8729e01a..1c935a02eac939ab3bfc6c564d9b63c8f2e150ab 100644
 29--- a/plugins/nomad/_nomad
 30+++ b/plugins/nomad/_nomad
 31@@ -24,7 +24,6 @@ _nomad_cmds=(
 32   'version:Prints the Nomad version'
 33 )
 34 
 35-
 36 __allocstatus() {
 37   _arguments \
 38     '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
 39@@ -37,6 +36,93 @@ __allocstatus() {
 40     '-t[Format and display allocation using a Go template.]'
 41 }
 42 
 43+__evalstatus() {
 44+  _arguments \
 45+    '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
 46+    '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \
 47+    '-no-color[Disables colored command output.]' \
 48+    '-monitor[Monitor an outstanding evaluation.]' \
 49+    '-verbose[Show full information.]' \
 50+    '-json[Output the allocation in its JSON format.]' \
 51+    '-t[Format and display allocation using a Go template.]'
 52+}
 53+
 54+__inspect() {
 55+  _arguments \
 56+    '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
 57+    '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \
 58+    '-no-color[Disables colored command output.]' \
 59+    '-json[Output the allocation in its JSON format.]' \
 60+    '-t[Format and display allocation using a Go template.]'
 61+}
 62+
 63+__logs() {
 64+  _arguments \
 65+    '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
 66+    '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \
 67+    '-no-color[Disables colored command output.]' \
 68+    '-stderr[ Display stderr logs.]' \
 69+    '-job[<job-id> Use a random allocation from the specified job ID.]' \
 70+    '-verbose[Show full information.]' \
 71+    '-f[Causes the output to not stop when the end of the logs are reached, but rather to wait for additional output.]' \
 72+    '-tail[Show the logs contents with offsets relative to the end of the logs. If no offset is given, -n is defaulted to 10.]' \
 73+    '-n[Sets the tail location in best-efforted number of lines relative to the end of the logs.]' \
 74+    '-c[Sets the tail location in number of bytes relative to the end of the logs.]'
 75+}
 76+
 77+__nodestatus() {
 78+  _arguments \
 79+    '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
 80+    '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \
 81+    '-no-color[Disables colored command output.]' \
 82+    '-self[Query the status of the local node.]' \
 83+    '-allocs[ Display a count of running allocations for each node.]' \
 84+    '-short[Display short output. Shows only the most recent task event.]' \
 85+    '-stats[Display detailed resource usage statistics.]' \
 86+    '-verbose[Show full information.]' \
 87+    '-json[Output the allocation in its JSON format.]' \
 88+    '-t[Format and display allocation using a Go template.]'
 89+}
 90+
 91+__plan() {
 92+  _arguments \
 93+    '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
 94+    '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \
 95+    '-no-color[Disables colored command output.]' \
 96+    '-diff[Determines whether the diff between the remote job and planned job is shown. Defaults to true.]' 
 97+}
 98+
 99+__run() {
100+  _arguments \
101+    '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
102+    '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \
103+    '-no-color[Disables colored command output.]' \