Skip to content

Commit

Permalink
fix ffd, ffind, fcd
Browse files Browse the repository at this point in the history
  • Loading branch information
zqb-all committed Sep 16, 2019
1 parent 0df7785 commit 7b08aa2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
15 changes: 15 additions & 0 deletions PathMarker.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@
sys.stdout.write("\t%s" % (name))
f.close

if sys.argv[1] == "setall":
count = 0
f = open(PathMarker_buffer_file,"w")
for name in sys.stdin.readlines():
formattedLine = FormattedText(name)
result=parse.matchLine(str(formattedLine), allInput=True)
if result:
path = parse.prependDir(result[0], withFileInspection=False)
count += 1
sys.stdout.write("%d\t%s" % (count, name))
f.write("%s\n" % path)
else:
sys.stdout.write("\t%s" % (name))
f.close

if sys.argv[1] == "get":
for i in range(2, len(sys.argv)):
if sys.argv[i].isdigit():
Expand Down
8 changes: 4 additions & 4 deletions PathMarker_help.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ gitmark()
ffd()
{
type fd > /dev/null 2>&1 && {
fd $@ | PathMarker.py set
fd $@ | PathMarker.py setall
return
}
find $@ | PathMarker.py set
find $@ | PathMarker.py setall
}

ffind()
{
find $@ | PathMarker.py set
find $@ | PathMarker.py setall
}

fcd()
Expand All @@ -43,5 +43,5 @@ fcd()
fcd_target=${fcd_target%/*}
}
# echo ${fcd_target}
cd "${fcd_target}"
cd ${fcd_target}
}

0 comments on commit 7b08aa2

Please sign in to comment.