2013-12-11 09:55:51 +08:00
|
|
|
function marks
|
2014-01-10 12:30:20 +08:00
|
|
|
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."
|
2013-12-11 09:55:51 +08:00
|
|
|
else
|
2014-01-10 12:30:20 +08:00
|
|
|
set -l mark_list
|
|
|
|
for file in $file_list
|
|
|
|
if test -d $MARKPATH/$file -a -L $MARKPATH/$file
|
|
|
|
set mark_list $mark_list $file
|
2013-12-11 09:55:51 +08:00
|
|
|
end
|
2014-01-10 12:30:20 +08:00
|
|
|
end
|
|
|
|
if test (count $mark_list) -eq 0
|
|
|
|
echo "No marks currently defined."
|
|
|
|
else
|
|
|
|
set -l current_dir (pwd)
|
2014-07-31 12:17:33 +08:00
|
|
|
set -l output ""
|
2014-01-10 12:30:20 +08:00
|
|
|
for mark_name in $mark_list
|
|
|
|
cd $MARKPATH/$mark_name
|
|
|
|
set -l real_path (pwd)
|
2014-07-31 12:17:33 +08:00
|
|
|
set output "$output$mark_name -> $real_path"\n
|
2014-01-10 12:30:20 +08:00
|
|
|
end
|
2014-07-31 12:17:33 +08:00
|
|
|
echo $output | column -t
|
2014-01-10 12:30:20 +08:00
|
|
|
cd $current_dir
|
|
|
|
end
|
2013-12-11 09:55:51 +08:00
|
|
|
end
|
2014-01-10 12:30:20 +08:00
|
|
|
end
|
2013-12-11 09:55:51 +08:00
|
|
|
end
|