From e0dc54480adb16229d0e79dfffef04200fc23214 Mon Sep 17 00:00:00 2001 From: Charles Thorley Date: Thu, 9 Jan 2014 20:30:20 -0800 Subject: [PATCH] Two-space indentation --- plugins/jump/jump.fish | 14 ++++++------ plugins/jump/jump.load | 2 +- plugins/jump/mark.fish | 38 ++++++++++++++++----------------- plugins/jump/marks.fish | 46 ++++++++++++++++++++-------------------- plugins/jump/unmark.fish | 20 ++++++++--------- 5 files changed, 60 insertions(+), 60 deletions(-) diff --git a/plugins/jump/jump.fish b/plugins/jump/jump.fish index dbfc73c..b054c36 100644 --- a/plugins/jump/jump.fish +++ b/plugins/jump/jump.fish @@ -1,11 +1,11 @@ function jump - if test (count $argv) -ne 1 - echo "Usage: jump " + if test (count $argv) -ne 1 + echo "Usage: jump " + 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 diff --git a/plugins/jump/jump.load b/plugins/jump/jump.load index 8707c13..20081b5 100644 --- a/plugins/jump/jump.load +++ b/plugins/jump/jump.load @@ -1,2 +1,2 @@ -set -x MARKPATH $HOME/.marks +set -gx MARKPATH $HOME/.marks command mkdir -p $MARKPATH diff --git a/plugins/jump/mark.fish b/plugins/jump/mark.fish index 7a228db..6c175a8 100644 --- a/plugins/jump/mark.fish +++ b/plugins/jump/mark.fish @@ -1,22 +1,22 @@ function mark - if test (count $argv) -eq 0 -o (count $argv) -gt 2 - echo "Usage: mark [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 [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 diff --git a/plugins/jump/marks.fish b/plugins/jump/marks.fish index e658bbf..9787e2f 100644 --- a/plugins/jump/marks.fish +++ b/plugins/jump/marks.fish @@ -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 diff --git a/plugins/jump/unmark.fish b/plugins/jump/unmark.fish index a383b19..8965e1c 100644 --- a/plugins/jump/unmark.fish +++ b/plugins/jump/unmark.fish @@ -1,13 +1,13 @@ function unmark - if test (count $argv) -eq 0 - echo "Usage: unmark ..." - 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 ..." + 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