mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-24 15:17:56 +08:00
Two-space indentation
This commit is contained in:
parent
7960f78019
commit
e0dc54480a
|
@ -1,11 +1,11 @@
|
|||
function jump
|
||||
if test (count $argv) -ne 1
|
||||
echo "Usage: jump <MARK_NAME>"
|
||||
if test (count $argv) -ne 1
|
||||
echo "Usage: jump <MARK_NAME>"
|
||||
else
|
||||
if test -d $MARKPATH/$argv[1] -a -L $MARKPATH/$argv[1]
|
||||
cd $MARKPATH/$argv[1]
|
||||
else
|
||||
if test -d $MARKPATH/$argv[1] -a -L $MARKPATH/$argv[1]
|
||||
cd $MARKPATH/$argv[1]
|
||||
else
|
||||
echo "No such mark: $argv[1]"
|
||||
end
|
||||
echo "No such mark: $argv[1]"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
set -x MARKPATH $HOME/.marks
|
||||
set -gx MARKPATH $HOME/.marks
|
||||
command mkdir -p $MARKPATH
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
function mark
|
||||
if test (count $argv) -eq 0 -o (count $argv) -gt 2
|
||||
echo "Usage: mark <MARK_NAME> [DIRECTORY]"
|
||||
else if test -e $MARKPATH/$argv[1]
|
||||
if test -d $MARKPATH/$argv[1] -a -L $MARKPATH/$argv[1]
|
||||
echo "A mark named $argv[1] already exists."
|
||||
else
|
||||
echo "$MARKPATH/$argv[1] already exists."
|
||||
end
|
||||
else if test (count $argv) -eq 1
|
||||
command ln -s (pwd) $MARKPATH/$argv[1]
|
||||
else if test (count $argv) -eq 2
|
||||
if test -d $argv[2]
|
||||
set -l current_dir (pwd)
|
||||
cd $argv[2]
|
||||
command ln -s (pwd) $MARKPATH/$argv[1]
|
||||
cd $current_dir
|
||||
else
|
||||
echo "$argv[2] is not a valid directory."
|
||||
end
|
||||
if test (count $argv) -eq 0 -o (count $argv) -gt 2
|
||||
echo "Usage: mark <MARK_NAME> [DIRECTORY]"
|
||||
else if test -e $MARKPATH/$argv[1]
|
||||
if test -d $MARKPATH/$argv[1] -a -L $MARKPATH/$argv[1]
|
||||
echo "A mark named $argv[1] already exists."
|
||||
else
|
||||
echo "$MARKPATH/$argv[1] already exists."
|
||||
end
|
||||
else if test (count $argv) -eq 1
|
||||
command ln -s (pwd) $MARKPATH/$argv[1]
|
||||
else if test (count $argv) -eq 2
|
||||
if test -d $argv[2]
|
||||
set -l current_dir (pwd)
|
||||
cd $argv[2]
|
||||
command ln -s (pwd) $MARKPATH/$argv[1]
|
||||
cd $current_dir
|
||||
else
|
||||
echo "$argv[2] is not a valid directory."
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
function marks
|
||||
if test (count $argv) -gt 0
|
||||
echo "Usage: marks"
|
||||
if test (count $argv) -gt 0
|
||||
echo "Usage: marks"
|
||||
else
|
||||
set -l file_list (command ls $MARKPATH)
|
||||
if test (count $file_list) -eq 0
|
||||
echo "No marks currently defined."
|
||||
else
|
||||
set -l file_list (command ls $MARKPATH)
|
||||
if test (count $file_list) -eq 0
|
||||
echo "No marks currently defined."
|
||||
else
|
||||
set -l mark_list
|
||||
for file in $file_list
|
||||
if test -d $MARKPATH/$file -a -L $MARKPATH/$file
|
||||
set mark_list $mark_list $file
|
||||
end
|
||||
end
|
||||
if test (count $mark_list) -eq 0
|
||||
echo "No marks currently defined."
|
||||
else
|
||||
set -l current_dir (pwd)
|
||||
for mark_name in $mark_list
|
||||
cd $MARKPATH/$mark_name
|
||||
set -l real_path (pwd)
|
||||
echo "$mark_name -> $real_path"
|
||||
end
|
||||
cd $current_dir
|
||||
end
|
||||
set -l mark_list
|
||||
for file in $file_list
|
||||
if test -d $MARKPATH/$file -a -L $MARKPATH/$file
|
||||
set mark_list $mark_list $file
|
||||
end
|
||||
end
|
||||
if test (count $mark_list) -eq 0
|
||||
echo "No marks currently defined."
|
||||
else
|
||||
set -l current_dir (pwd)
|
||||
for mark_name in $mark_list
|
||||
cd $MARKPATH/$mark_name
|
||||
set -l real_path (pwd)
|
||||
echo "$mark_name -> $real_path"
|
||||
end
|
||||
cd $current_dir
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
function unmark
|
||||
if test (count $argv) -eq 0
|
||||
echo "Usage: unmark <MARK_NAME>..."
|
||||
else
|
||||
for mark_name in $argv
|
||||
if test -d $MARKPATH/$mark_name -a -L $MARKPATH/$mark_name
|
||||
command rm -i $MARKPATH/$mark_name
|
||||
else
|
||||
echo "No such mark: $mark_name"
|
||||
end
|
||||
end
|
||||
if test (count $argv) -eq 0
|
||||
echo "Usage: unmark <MARK_NAME>..."
|
||||
else
|
||||
for mark_name in $argv
|
||||
if test -d $MARKPATH/$mark_name -a -L $MARKPATH/$mark_name
|
||||
command rm -i $MARKPATH/$mark_name
|
||||
else
|
||||
echo "No such mark: $mark_name"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user