Commit Graph

49 Commits (54635072f6252730d677236e275b690dfb6c0caf)

Author SHA1 Message Date
sammyette e4833bdba9
feat: add command.preexec hook
it provides 2 arguments: what the user typed, and the command hilbish
will execute.
2021-10-14 08:51:29 -04:00
Gabriel Rato c29b6c6fd4
fix: break for loop after finding the aliased command (#73) 2021-10-11 21:45:52 -04:00
sammyette bc4e0f835f
fix: revert "fix: reuse sh runner"
This reverts commit 822b2876e9.
this broke a few things with the shell so probably shouldnt do this yet
2021-09-25 22:46:06 -04:00
sammyette 822b2876e9
fix: reuse sh runner
this makes it so env variables persist, and some other stuff
builtin cd actually works now :]
2021-06-20 21:48:07 -04:00
sammyette 30ffe9cab0
fix: handle error before getting commander exit code
this fixes a register underflow issue if a commander causes an error
2021-06-14 18:02:44 -04:00
sammyette 36ea20b550
fix: aliases in sh interp exec handler 2021-06-12 11:52:56 -04:00
sammyette b974ada64e
fix: comment out unused module 2021-06-12 10:43:13 -04:00
sammyette 7e5f9e9541
fix: remove debug logging 2021-06-12 10:41:51 -04:00
sammyette efc956a04c
fix: cleanup, store lua commands in map 2021-06-11 21:37:52 -04:00
sammyette 03b98bdd26
revert: fix: panic on ctrl d on continued input
This reverts commit 72973eade7.
i'm kinda a bit dumb
this fix broke basically everything else that used the splitInput
function
2021-06-11 18:03:52 -04:00
sammyette 72973eade7
fix: panic on ctrl d on continued input
basically when a person did the continue prompt (input ending with `\`)
and exited with ctrl d it caused a panic
this was the simplest way to fix that
2021-06-11 17:58:35 -04:00
sammyette 95dee1f4dd
fix: check aliases before going to sh interp 2021-06-09 19:16:08 -04:00
sammyette 084f049ba5
style: add spaces between multiply op 2021-06-09 18:10:34 -04:00
sammyette 9defa737f4
fix!: remove recursive aliases
i dont think this is really useful and since the `args` provided
by the sh interp dont include quotes i can't split with our own
function, which is a problem
i also removed running lua code like a sh command, now its only
entire input for lua; like it was before
2021-05-25 20:05:11 -04:00
sammyette e86c95818a
fix: added a return in lua command check 2021-05-20 05:36:00 -04:00
sammyette 08a3e75fd1
fix: check for lua defined commands before going to sh interp (mvdan/sh#705) 2021-05-19 18:39:56 -04:00
sammyette d4a595d2a8
feat: run lua in sh interp exec handler 2021-05-19 18:38:15 -04:00
sammyette 14e6ae5a3c
feat: add command.not-found hook 2021-05-18 21:04:49 -04:00
sammyette a655ff00ce
feat: use custom exec handler for sh interpreter
so, here we use a custom function for the sh interpreter to run
individual commands now. what does this mean?
1. aliases will work not only on the 1st command, since it was
replaced in the beginning before.
want to run `cmd; alias`? now you can!
2. custom error message when a command isnt found :} i can also
add the command.not-found hook (will do in next commit)
3. sh and lua can be mixed (not in this commit, but itll work)

this means all code for handling commands is in the single `execCommand`
function in shell.go and will probably able to clean things up soon,
ditching the `RunInput` function entirely
2021-05-18 20:49:55 -04:00
sammyette e0851809ab
feat: make readline agnostic, add hilbiline to test 2021-05-17 19:03:56 -04:00
sammyette 1ff3ff854b
fix: add input to history before alias expansion
since im stupid, normal commands that are aliased add
the expanded version to the history, and not the alias itself.
lua alias was added since im dumb and did `input` instead of `cmdString`
so now, history is handled once, in main.go
2021-05-16 20:09:47 -04:00
sammyette 9415c5193e
feat(wip): check if lua input is incomplete 2021-05-16 15:50:49 -04:00
sammyette 0850247615
feat: recursively alias commands 2021-05-16 09:32:02 -04:00
sammyette 415e66ab9c
fix: trim prefix of alias instead of trim 2021-05-16 09:29:39 -04:00
sammyette ad14b98b1f
feat: lua code can now be aliased 2021-05-16 08:43:19 -04:00
sammyette 83bcb35dcf
fix: remove unused imports 2021-05-16 06:58:48 -04:00
sammyette dfb8ec9a90
fix: remove unused function 2021-05-16 06:55:11 -04:00
sammy edd45e4182
fix: resplit input on alias
this makes it so itll properly check if the aliased *command* is
defined in lua
therefore, cd with an argument can be aliased now
2021-05-12 06:40:30 -04:00
sammy 0f9d3732fb
fix: check if type assertion of return value is valid 2021-05-11 19:00:07 -04:00
sammy 0ddfc5bea0
feat: allow command defined by commander to return exit code 2021-05-11 18:53:24 -04:00
sammy e6382d454d
feat: add -n flag (closes #47) 2021-05-08 08:56:24 -04:00
sammy 9b3f8e818c
style: add space between binary op 2021-05-01 11:55:09 -04:00
sammy e0cf87d272
refactor(minor): reduce the amount of module renaming 2021-04-28 18:57:28 -04:00
sammy dc9bd1864c
chore: remove redundant module renaming 2021-04-28 18:52:42 -04:00
Devin Singh 4476a96eec
feat(wip): add appendpath 2021-04-28 16:57:06 -05:00
sammy 935bed3dc6
fix: switch back to readline for the time being 2021-04-23 23:42:34 -04:00
sammy 17e12c8c2a
chore: merge from master, resolve conflicts 2021-04-20 19:31:19 -04:00
sammy bdc8c770e6
fix: aliases for lua commands 2021-04-20 19:26:33 -04:00
sammy 7b0b06d9bf
fix: dont make continue prompt input include a newline 2021-04-19 22:08:16 -04:00
Devin Singh 94f0ccf9f6
chore: formatting 2021-04-18 21:09:27 -05:00
sammy e32639800e
fix: dont use readline at all 2021-04-18 15:41:37 -04:00
TorchedSammy 84d55a38b0 feat: change multiline prompt via multiprompt function (closes #13) 2021-04-05 18:09:21 -04:00
TorchedSammy 807ec15faa fix: cleanup and move exit command to lua side 2021-04-05 15:21:44 -04:00
TorchedSammy 3cb3b34023 fix: add back sh, cleanup a bit and use new functions 2021-04-04 20:30:47 -04:00
TorchedSammy cfdab00684 fix: make shell continue prompt "sh> " 2021-04-04 18:46:37 -04:00
TorchedSammy cc183620c5 fix: move input checks to main.go, some cleanup 2021-04-04 18:42:56 -04:00
TorchedSammy f4b45b370e feat: multiline input with \ (hilbish only has lua input currently) 2021-04-04 13:04:57 -04:00
Jack ad1be6b5f5
feat: Add command.exit signal to bait (#15) 2021-04-03 14:33:38 -04:00
TorchedSammy 4f4237a3e9 chore: split up go source files 2021-04-03 13:13:45 -04:00