From d3939a5f7d48c82b35c36e3fd554c5a60e185255 Mon Sep 17 00:00:00 2001 From: Sachin George Thomas Date: Tue, 25 Oct 2016 19:55:46 +0530 Subject: [PATCH] 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 2463815ac..e53fdc582 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 }