Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kevin Lyda
vcsh
Commits
69269da3
Commit
69269da3
authored
Aug 29, 2017
by
Roland Hopferwieser
Browse files
Remove ==
parent
35eea7f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
vcsh
View file @
69269da3
...
...
@@ -172,7 +172,7 @@ alias_get() {
local
a cmd
if
[
-n
"
$1
"
]
;
then
alias_read |
while
read
a cmd
;
do
if
[
x
"
$1
"
=
=
x
"
$a
"
]
;
then
if
[
x
"
$1
"
=
x
"
$a
"
]
;
then
echo
$cmd
return
fi
...
...
@@ -184,7 +184,7 @@ alias_write() {
[
-w
"
$XDG_CONFIG_HOME
/vcsh/aliases"
]
||
[
!
-e
"
$XDG_CONFIG_HOME
/vcsh/aliases"
-a
-w
"
$XDG_CONFIG_HOME
/vcsh/"
]
||
fatal
"File '
$XDG_CONFIG_HOME
/vcsh/aliases' not writeable"
[
"
$2
"
=
=
'='
]
||
fatal
'Invalid alias format'
[
"
$2
"
=
'='
]
||
fatal
'Invalid alias format'
if
[
-n
"
$(
alias_get
$1
)
"
]
;
then
local
regex
=
"s/^
$1
\s
*=.*/
$@
/"
sed
-i
.bak
-re
"
$regex
"
"
$XDG_CONFIG_HOME
/vcsh/aliases"
...
...
@@ -206,12 +206,12 @@ aliases() {
if
[
-n
"
$1
"
]
;
then
local
opts subcmd
while
getopts
d: opts
;
do
if
[
$opts
=
=
d
]
;
then
if
[
$opts
=
d
]
;
then
alias_remove
"
$OPTARG
"
fi
done
shift
$((
$OPTIND
-
1
))
local alias
=
$(
echo
"
$@
"
|
sed
-nre
's/(\w+)\s*=\s*(\w.*)/\1 = \2/p'
)
local alias
=
"
$(
echo
"
$@
"
|
sed
-nre
's/(\w+)\s*=\s*(\w.*)/\1 = \2/p'
)
"
if
[
-n
"
$alias
"
]
;
then
alias_write
$alias
else
...
...
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