a2dab42c35cfcd7e5f7e7d5ecc58bbd8699028ce

Author
Josh Parnham <joshparnham@gmail.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

nanoc: update to latest version (#7282)

* nanoc: update command aliases

- remove deprecated commands
- update `create-site`
- add `prune`

* nanoc: update README

* nanoc: update autompletion

- update commands
- add flag options to subcommands

Diff

This diff is truncated to protect this page.

  1diff --git a/plugins/nanoc/README.md b/plugins/nanoc/README.md
  2index 9e21805f44f86d7ee04dfca30688058a26c2f319..d5d437d8a88885d2cd5b3a5967ca2128ae8da236 100644
  3--- a/plugins/nanoc/README.md
  4+++ b/plugins/nanoc/README.md
  5@@ -10,14 +10,11 @@ plugins=(... nanoc)
  6 
  7 ## Aliases
  8 
  9-| Alias | Command               | Description                                        |
 10-|-------|-----------------------|----------------------------------------------------|
 11-| n     | `nanoc`               | Main Nanoc command                                 |
 12-| na    | `nanoc autocompile`   | The autocompile command has been deprecated since Nanoc 3.6. Use [guard-nanoc](https://github.com/nanoc/nanoc/tree/master/guard-nanoc) instead. |
 13-| nco   | `nanoc compile`       | Compile all items of the current site. |
 14-| nci   | `nanoc create_item`   | Command was deprecated in Nanoc v.3 and completely removed in v.4 |
 15-| ncl   | `nanoc create_layout` | Command was deprecated in Nanoc v.3 and completely removed in v.4 |
 16-| ncs   | `nanoc create_site`   | Create a new site at the given path. The site will use the filesystem data source. |
 17-| nd    | `nanoc deploy`        | Deploys the compiled site. The compiled site contents in the output directory will be uploaded to the destination, which is specified using the --target option. |
 18-| nv    | `nanoc view`          | Start the static web server. Unless specified, the web server will run on port 3000 and listen on all IP addresses. |
 19-| nw    | `nanoc watch`         | The watch command has been deprecated since Nanoc 3.6. Use [guard-nanoc](https://github.com/nanoc/nanoc/tree/master/guard-nanoc) instead. |
 20+| Alias | Command               | Description                                                                       |
 21+|-------|-----------------------|-----------------------------------------------------------------------------------|
 22+| n     | `nanoc`               | Main Nanoc command                                                                |
 23+| nco   | `nanoc compile`       | Compile all items of the current site                                             |
 24+| ncs   | `nanoc create-site`   | Create a new site at the given path. The site will use the filesystem data source |
 25+| nd    | `nanoc deploy`        | Deploy the compiled site to the destination (specified with `--target`)           |
 26+| np    | `nanoc prune`         | Remove files not managed by Nanoc from the output directory                       |
 27+| nv    | `nanoc view`          | Start the static web server (on port 3000 and all IP addresses, unless specified) |
 28diff --git a/plugins/nanoc/_nanoc b/plugins/nanoc/_nanoc
 29index fde07c3fccc5c8faae39916f8a7dd9e5edc43afe..a6a4792ad2bbba6acaaee5ba7ee30bc0fa5d0f6f 100644
 30--- a/plugins/nanoc/_nanoc
 31+++ b/plugins/nanoc/_nanoc
 32@@ -1,28 +1,21 @@
 33 #compdef nanoc
 34 #autoload
 35 
 36-# nanoc zsh completion - based on the homebrew zsh completion
 37 # requires the 'nanoc' gem to be installed
 38 
 39 local -a _1st_arguments
 40 _1st_arguments=(
 41-  'autocompile:start the autocompiler'
 42+  'check:run issue checks'
 43   'compile:compile items of this site'
 44-  'create-item:create an item'
 45-  'create-layout:create a layout'
 46   'create-site:create a site'
 47   'deploy:deploy the compiled site'
 48   'help:show help'
 49   'prune:remove files not managed by nanoc from the output directory'
 50+  'shell:open a shell on the Nanoc environment'
 51   'show-data:show data in this site'
 52   'show-plugins:show all available plugins'
 53   'show-rules:describe the rules for each item'
 54-  'update:update the data stored by the data source to a newer version'
 55-  'validate-css:validate the site’s CSS'
 56-  'validate-html:validate the site’s HTML'
 57-  'validate-links:validate links in site'
 58   'view:start the web server that serves static files'
 59-  'watch:start the watcher'
 60 )
 61 
 62 local expl
 63@@ -31,13 +24,68 @@ local -a pkgs installed_pkgs
 64 _arguments \
 65   '(--color)--color[enable color]' \
 66   '(--debug)--debug[enable debugging]' \
 67+  '(--env)--env[set environment]' \
 68   '(--help)--help[show the help message and quit]' \
 69   '(--no-color)--no-color[disable color]' \
 70-  '(--verbose)--verbose[make nanoc output more detailed]' \
 71+  '(--verbose)--verbose[make output more detailed]' \
 72   '(--version)--version[show version information and quit]' \
 73   '(--warn)--warn[enable warnings]' \
 74   '*:: :->subcmds' && return 0
 75 
 76+case "$state" in
 77+  subcmds)
 78+    case $words[1] in
 79+      check)
 80+        _arguments \
 81+          '(--preprocess)--preprocess[run preprocessor]'
 82+      ;;
 83+
 84+      compile)
 85+        _arguments \
 86+          '(--diff)--diff[generate diff]'
 87+      ;;
 88+
 89+      compile)
 90+        _arguments \
 91+          '(--diff)--diff[generate diff]'
 92+      ;;
 93+
 94+      create-site)
 95+        _arguments \
 96+          '(--force)--force[force creation of new site]'
 97+      ;;
 98+
 99+      deploy)
100+        _arguments \
101+          '(--target)--target[specify the location to deploy to (default: `default`)]' \
102+          '(--no-check)--no-check[do not run the issue checks marked for deployment]' \
103+          '(--list)--list[list available locations to deploy to]' \
104+          '(--list-deployers)--list-deployers[list available deployers]' \
105+          '(--dry-run)--dry-run[show what would be deployed]'
106+      ;;
107+
108+      prune)
109+        _arguments \
110+          '(--yes)--yes[confirm deletion]' \
111+          '(--dry-run)--dry-run[print files to be deleted instead of actually deleting them]'
112+      ;;
113+
114+      shell)
115+        _arguments \
116+          '(--preprocess)--preprocess[run preprocessor]'
117+      ;;
118+
119+      view)
120+        _arguments \
121+          '(--handler)--handler[specify the handler to use (webrick/mongrel/...)]' \
122+          '(--host)--host[specify the host to listen on (default: 127.0.0.1)]' \
123+          '(--port)--port[specify the port to listen on (default: 3000]' \
124+          '(--live-reload)--live-reload[reload on changes]'
125+      ;;
126+    esac
127+  ;;
128+esac
129+
130 if (( CURRENT == 1 )); then
131   _describe -t commands "nanoc subcommand" _1st_arguments
132diff --git a/plugins/nanoc/nanoc.plugin.zsh b/plugins/nanoc/nanoc.plugin.zsh
133index 5a5064613a999f01d98fea4ccc9f7a384e80460f..05272ed666f43a6621e12ad72ec7ce3542b3abc2 100644
134--- a/plugins/nanoc/nanoc.plugin.zsh
135+++ b/plugins/nanoc/nanoc.plugin.zsh
136@@ -1,9 +1,6 @@
137 alias n='nanoc'
138-alias na='nanoc autocompile'
139 alias nco='nanoc compile'
140-alias nci='nanoc create_item'
141-alias ncl='nanoc create_layout'
142-alias ncs='nanoc create_site'
143+alias ncs='nanoc create-site'
144 alias nd='nanoc deploy'
145+alias np='nanoc prune'
146 alias nv='nanoc view'
147-alias nw='nanoc watch'