aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Bynens <mathias@qiwi.be>2011-12-31 11:49:56 +0100
committerMathias Bynens <mathias@qiwi.be>2011-12-31 11:49:56 +0100
commit42d5c26ae2f903349f39b6ec2fc0422234499310 (patch)
tree3a360e3cc728fb3a225497d8d31155e8ffd5dc52
parent0abbaf746578ac02f0ff3e474bef20ab7552839a (diff)
downloaddotfiles-42d5c26ae2f903349f39b6ec2fc0422234499310.tar.gz
dotfiles-42d5c26ae2f903349f39b6ec2fc0422234499310.tar.bz2
dotfiles-42d5c26ae2f903349f39b6ec2fc0422234499310.zip
`server`: Use parameter expansion instead of a fake ternary
-rw-r--r--.functions3
1 files changed, 1 insertions, 2 deletions
diff --git a/.functions b/.functions
index 4301825..990a0cc 100644
--- a/.functions
+++ b/.functions
@@ -5,8 +5,7 @@ function md() {
# Start an HTTP server from a directory, optionally specifying the port
function server() {
- local port="$1"
- [ -z "$port" ] && port=8000
+ local port="${1:-8000}"
open "http://localhost:${port}/" && python -m SimpleHTTPServer "$port"
}