Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
240b25da
Commit
240b25da
authored
Nov 26, 2013
by
Markus Færevaag
Browse files
wd.plugin: Fixed nested dirs
parent
6f48f586
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/wd
2/wd2
/wd.plugin.zsh
→
plugins/wd/wd.plugin.zsh
View file @
240b25da
...
...
@@ -6,4 +6,4 @@
#
# @github.com/mfaerevaag/wd
alias
wd
=
'.
~/.oh-my-zsh
/plugins/wd/wd.sh'
alias
wd
=
'.
$ZSH
/plugins/wd/wd.sh'
plugins/wd
2/wd2
/wd.sh
→
plugins/wd/wd.sh
View file @
240b25da
...
...
@@ -19,6 +19,13 @@ RED="\033[91m"
NOC
=
"
\0
33[m"
# check if config file exists
if
[[
!
-a
$CONFIG
]]
then
# if not: create config file
touch
$CONFIG
fi
## load warp points
typeset
-A
points
while
read
line
...
...
@@ -120,11 +127,12 @@ wd_print_msg()
wd_print_usage
()
{
print
"Usage: wd [add|-a|--add] [rm|-r|--remove] [ls|-l|--list] <point>"
print
"Usage: wd [add|-a|--add] [rm|-r|--remove] [ls|-l|--list] <point>"
print
"
\n
Commands:"
print
"
\t
add
\t
Adds the current working directory to your warp points"
print
"
\t
add!
\t
Overwrites existing warp point"
print
"
\t
remove Removes the given warp point"
print
"
\t
show
\t
Outputs warp points to current directory"
print
"
\t
list
\t
Outputs all stored warp points"
print
"
\t
help
\t
Show this extremely helpful text"
}
...
...
@@ -135,13 +143,20 @@ wd_print_usage()
# get opts
args
=
`
getopt
-o
a:r:lhs
-l
add:,remove:,list,help,show
--
$*
`
# check if no arguments were given
if
[[
$?
-ne
0
||
$#*
-eq
0
]]
then
wd_print_usage
else
# can't exit, as this would exit the excecuting shell
# e.i. your terminal
# check if config file is writeable
elif
[[
!
-w
$CONFIG
]]
then
wd_print_msg
$RED
"
\'
$CONFIG
\'
is not writeable."
# do nothing => exit
# can't run `exit`, as this would exit the executing shell
# i.e. your terminal
else
#set -- $args # WTF
for
i
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment