File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ func main() {
2929 switch args [1 ] {
3030 case "fish" :
3131 dirp .PrintFishHook ()
32+ case "es" :
33+ dirp .PrintEsHook ()
3234 case "rc" :
3335 dirp .PrintRcHook ()
3436 default :
Original file line number Diff line number Diff line change @@ -78,3 +78,23 @@ func PrintRcHook() {
7878
7979 fmt .Println (strings .ReplaceAll (src , "\t " , " " ))
8080}
81+
82+ // PrintEsHook emits code for es, a shell based on rc
83+ func PrintEsHook () {
84+ fmt .Println (`fn dir {
85+ stdout=` + "`" + `{dirp $*};
86+ if {~ $bqstatus 2 } {
87+ $EDITOR $stdout;
88+ return $status;
89+ };
90+
91+ if {~ "x$stdout" "x" } {
92+ echo -n "How are we doing @";
93+ uptime;
94+ return $status;
95+ };
96+
97+ echo Switching to $stdout;
98+ cd $stdout
99+ }` )
100+ }
You can’t perform that action at this time.
0 commit comments