From d3939a5f7d48c82b35c36e3fd554c5a60e185255 Mon Sep 17 00:00:00 2001 From: Sachin George Thomas Date: Tue, 25 Oct 2016 19:55:46 +0530 Subject: [PATCH 1/2] add conditions to open module specific node documentation --- plugins/node/node.plugin.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/node/node.plugin.zsh b/plugins/node/node.plugin.zsh index 2463815aca57..e53fdc582ef9 100644 --- a/plugins/node/node.plugin.zsh +++ b/plugins/node/node.plugin.zsh @@ -1,5 +1,9 @@ # Open the node api for your current version to the optional section. # TODO: Make the section part easier to use. function node-docs { - open_command "http://nodejs.org/docs/$(node --version)/api/all.html#all_$1" + if [ $# -eq 0 ]; then + open_command "http://nodejs.org/docs/$(node --version)/api/all.html" + else + open_command "http://nodejs.org/docs/$(node --version)/api/$1.html" + fi } From a7643c554c246a901fb4a35b3f40002778eeceb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 2 Nov 2016 15:51:07 +0100 Subject: [PATCH 2/2] node plugin: simplify URL computation --- plugins/node/node.plugin.zsh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/node/node.plugin.zsh b/plugins/node/node.plugin.zsh index e53fdc582ef9..e2f18a032d7a 100644 --- a/plugins/node/node.plugin.zsh +++ b/plugins/node/node.plugin.zsh @@ -1,9 +1,6 @@ # Open the node api for your current version to the optional section. # TODO: Make the section part easier to use. function node-docs { - if [ $# -eq 0 ]; then - open_command "http://nodejs.org/docs/$(node --version)/api/all.html" - else - open_command "http://nodejs.org/docs/$(node --version)/api/$1.html" - fi + local section=${1:-all} + open_command "http://nodejs.org/docs/$(node --version)/api/$section.html" }