diff --git a/qcd_function b/qcd_function index 7394709..7b76d8e 100644 --- a/qcd_function +++ b/qcd_function @@ -197,7 +197,7 @@ function fcd() { # gcd future fork local cdto { cdto=$( python -c ' -import sys,os,re,termios,tty +import sys,os,re if len(sys.argv)==1: print("Arguments: [dir/]pattern_to_match_folders") sys.exit(0) @@ -241,9 +241,9 @@ matches=[repl_case.sub(G()+"\g<1>"+Z(),d) for d in matching_folders] if len(matching_folders)==0: match_nocase=re.compile(".*"+pat_base+".*",re.I) - repl_nocase=re.compile(pat_base,re.I) + repl_nocase=re.compile("("+pat_base+")",re.I) matching_folders=[d for d in current_folders if match_nocase.match(d)] - matches=[repl_case.sub(G()+pat_base+Z(),d) for d in matching_folders] + matches=[repl_nocase.sub(G()+"\g<1>"+Z(),d) for d in matching_folders] if len(matching_folders)==1: print(matches[0]) @@ -254,6 +254,9 @@ if len(matching_folders)==0: sys.exit(1) for i,m in enumerate(matches[0:20]): print(CS()[i]+": "+m) +if len(matches)>20: + print("Skipping rest...") +import termios,tty ch=getch() key_in=ch.get() try: