node plugin: simplify URL computation

This commit is contained in:
Marc Cornellà 2016-11-02 15:51:07 +01:00 committed by GitHub
commit a7643c554c

View file

@ -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"
}