sammyette
e6c4c32bd7
feat: handle -h option
2021-06-12 10:48:57 -04:00
sammyette
efc956a04c
fix: cleanup, store lua commands in map
2021-06-11 21:37:52 -04:00
sammyette
419e327d95
fix: prompt for new input on error with ContinuePrompt
...
basically, dont disregard the error we get and dont return previous
input. now we try to prompt for new input without running the
previous if the function got an error
2021-06-11 18:26:34 -04:00
sammyette
7a8df8b9f2
revert: fix: return previous input on continue input error
...
This reverts commit 5b03b3cef4
.
we shouldn't return this just to fix the panic,
instead just handle the error
2021-06-11 18:25:24 -04:00
sammyette
5b03b3cef4
fix: return previous input on continue input error
...
this is basically 72973eade7
but it actually works and doesnt break everything
if an error occurred with the ContinuePrompt function (in this case,
the error is simply EOL/ctrl d) then return previous input alone
2021-06-11 18:08:31 -04:00
sammyette
646cb93dec
feat: support comptime sample conf declaration
2021-06-09 20:33:30 -04:00
sammyette
13dc0cd857
feat: support comptime config dir declaration
2021-06-09 20:30:53 -04:00
sammyette
be5ebd6ada
feat: add back cancel input on ctrl c
2021-06-08 21:00:01 -04:00
sammyette
86dbb97cae
feat: define lua require paths in var
...
this makes it able to be changed compile time, which should help
in support for systems that dont follow fhs (damn nix)
and windows as well, but that'll be first class
2021-06-08 19:16:37 -04:00
sammyette
1623f0d85d
fix: dont go interactive if not terminal ( closes #48 )
2021-06-01 22:14:59 -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
ef1ced4a04
refactor: make `hilbish` an already required module and add run function
...
idk how to explain this man
in code `hilbish` is now a module, which can also be required like
others. but it is already a global export as the variable of the same
name.
also
2021-05-16 17:13:28 -04:00
sammyette
e29ba6a0d5
feat!: move username and version access to hilbish table
...
instead of having ugly `_user` and `_ver` variables,
`hilbish.user` and `hilbish.version` is used
2021-05-16 15:53:21 -04:00
sammyette
83591f9bba
fix: tryrun input from -c only if its provided
2021-05-16 08:42:20 -04:00
sammy
b86912be56
chore: change default version to be latest release
2021-05-15 23:13:15 -04:00
sammy
4ce223e2f4
fix: dont make continued input spaced out
...
basically, if i had something like
> here i want to \
complete
it would return "here i want to complete"
so now it doesnt anymore, if you want the space, do it manually
2021-05-15 22:25:29 -04:00
sammy
2c2eb8d69a
chore: remove old commented code
2021-05-15 09:21:19 -04:00
sammy
83a44954cd
fix(revert): feat: write errors and panics to tmp log file
...
This reverts commit 1e1b9d07b0
.
why did i even do this in the first place
2021-05-15 09:04:27 -04:00
sammy
1e1b9d07b0
feat: write errors and panics to tmp log file
2021-05-15 07:32:25 -04:00
sammy
69c0ccc807
fix: make `version` a var
...
so now, it can be changed in compile time
2021-05-13 21:02:56 -04:00
sammy
bb7f9e45f0
chore: bump version
2021-05-12 06:42:43 -04:00
sammy
f9c1eced68
chore: bump version
2021-05-11 19:39:51 -04:00
sammy
fd478e883f
feat: args variable ( resolves #49 )
...
anytime hilbish is ran as shebang or given a script to run,
itll provide an `args` variable which will be the args a user
provides to the script.
it includes the execute path, as most argv's do
2021-05-11 19:37:00 -04:00
sammy
cc995e0f34
chore: bump version
2021-05-11 18:52:49 -04:00
sammy
05f5bbcfdd
fix: add -c description
2021-05-11 18:19:53 -04:00
sammy
0acae37704
chore: revert "fix: reordering init code [...]"
...
this reverts commit 8d5e36bcde
.
apparently, when i reordered the code it caused hilbish's history
to be emptied and not work when used interactively
i literally have no idea why
2021-05-11 18:12:58 -04:00
sammy
1bacbfc778
fix: correct description for -n
2021-05-08 09:30:32 -04:00
sammy
8d5e36bcde
fix: reorder init code, making hilbish faster when used non-interactively
2021-05-08 09:30:14 -04:00
sammy
941902f43b
style: remove unneeded assign to _
2021-05-08 09:12:21 -04:00
sammy
e6382d454d
feat: add -n flag ( closes #47 )
2021-05-08 08:56:24 -04:00
sammy
9934ba417f
chore: bump to 0.4
2021-05-01 14:57:20 -04:00
sammy
a75100d15d
feat: add _user variable
...
this will probably change to a better global var in the
future, but it's `_user` now.
this provides a simple, guaranteed way of getting the
current user's name
$USER (in?)correctly shows the previous user when
`su` is used, _user will always be root in this case
2021-05-01 14:51:57 -04:00
sammy
60b1b50bb3
feat: add multiline hook ( resolves #19 )
2021-05-01 14:25:58 -04:00
sammy
f00063beaa
chore: bump version
2021-05-01 14:17:33 -04:00
sammy
7f8d8db53e
fix: errors and make login rc run before config
2021-05-01 14:17:14 -04:00
sammy
38f1d62598
feat: make hilbish act like a login shell
...
when a user logs in with hilbish as the user shell,
or -l/--login is passed
resolves #37
2021-05-01 14:08:42 -04:00
sammy
447775f8c4
chore: bump version
2021-05-01 13:33:05 -04:00
sammy
75d7c6acc6
chore: bump version
2021-05-01 10:51:00 -04:00
sammy
96600398b7
fix: dont be interactvive if source is provided
...
hilbish wont go into an interactive mode if its provided
a lua source file to run, even if -i is passed.
i feel like this makes the most sense.
2021-05-01 10:44:15 -04:00
sammy
88d9f2e21d
chore: bump version
2021-05-01 02:31:49 -04:00
sammy
a7d8851de0
fix: make -i false by default and fix cmdflag comparing
2021-05-01 01:50:22 -04:00
sammy
89fc544545
feat: switch to getopt library and add running lua source files from cli
2021-05-01 01:08:55 -04:00
sammy
e0cf87d272
refactor(minor): reduce the amount of module renaming
2021-04-28 18:57:28 -04:00
sammy
d4ecdd5ea0
feat: -i (--interactive) and -c (--command) flag
2021-04-24 00:12:18 -04:00
sammy
d9c05e485d
style: spacing between binary op
2021-04-23 23:44:59 -04:00
sammy
5d0fecf902
fix: use readline in continue prompt
2021-04-23 23:44:22 -04: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
08c56a54ca
style: formatting
2021-04-20 17:52:01 -04:00
sammy
428db24831
style: put all vars in 1 var()
2021-04-20 17:51:12 -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
050165d7b1
fix: make --login actually a flag
2021-04-18 19:01:55 -04:00
sammy
aa5b68ec2b
fix: assign loginshflag to throwaway var
2021-04-18 18:53:22 -04:00
sammy
55c05a9a92
feat: add login flag (todo)
2021-04-18 18:50:18 -04:00
sammy
53adc6ab21
chore: bump verison
2021-04-18 17:48:04 -04:00
sammy
e32639800e
fix: dont use readline at all
2021-04-18 15:41:37 -04:00
sammy
98ff54a4f4
fix: set prompt to nothing initially
2021-04-16 11:36:23 -04:00
sammy
385b59bfda
chore: bump version
2021-04-16 10:42:44 -04:00
sammy
e2c775a89d
fix: print newline on ctrlc
2021-04-16 10:27:11 -04:00
sammy
00ff4d6149
fix: dont print "// interrupt" on ctrlc
2021-04-15 06:28:47 -04:00
sammy
2089d71ed2
feat: switch to hilbiline
2021-04-14 19:55:03 -04:00
sammy
885c54ed3f
feat: ctrl c to cancel input
2021-04-14 13:20:03 -04:00
sammy
c393080a2e
chore: bump version
2021-04-10 08:37:51 -04:00
TorchedSammy
0fa3d50db7
feat: add -C flag ( closes #20 )
2021-04-07 08:40:40 -04:00
TorchedSammy
2b01d5edb2
feat: always print prompt on newline; complete missing linefeed - "\r"
2021-04-06 21:12:29 -04:00
TorchedSammy
0f01d077a4
chore: bump version
2021-04-05 23:02:29 -04:00
TorchedSammy
21033764a9
fix: use username in prompt format instead of user's real name
2021-04-05 23:01:21 -04:00
TorchedSammy
fad4282345
chore: bump version
2021-04-05 18:25:55 -04:00
TorchedSammy
84d55a38b0
feat: change multiline prompt via multiprompt function ( closes #13 )
2021-04-05 18:09:21 -04:00
TorchedSammy
22270dc537
fix: trim input and remove comment
2021-04-04 20:30:03 -04:00
TorchedSammy
cc183620c5
fix: move input checks to main.go, some cleanup
2021-04-04 18:42:56 -04:00
TorchedSammy
4f4237a3e9
chore: split up go source files
2021-04-03 13:13:45 -04:00
TorchedSammy
a0bc8e026a
feat: save history to file
2021-04-01 22:12:03 -04:00
TorchedSammy
0987899144
fix: throw command.success hook after successfullua input
2021-03-31 12:53:39 -04:00
TorchedSammy
1d22e4cdc1
fix: move LuaInit function to lua.go
2021-03-30 22:37:08 -04:00
TorchedSammy
09a4cb4787
chore: update version
2021-03-30 19:50:35 -04:00
TorchedSammy
f20be5153f
feat: add hooks/events
2021-03-30 19:47:02 -04:00
TorchedSammy
e561be0c9f
chore: comments everywhere
2021-03-28 18:58:58 -04:00
TorchedSammy
479968f79e
fix: dont replace ^^ in commands before, or in quotes
2021-03-28 18:15:51 -04:00
TorchedSammy
b735421af8
feat: add ^^ for last command
2021-03-28 17:51:15 -04:00
TorchedSammy
d945d510f7
feat: printf-like formatting for prompt
2021-03-28 17:11:57 -04:00
TorchedSammy
7486d58465
fix: merge conflicts
2021-03-26 01:14:25 -04:00
TorchedSammy
c5fa238156
wip: get prompt from format function
2021-03-26 01:06:14 -04:00
devins2518
e4218a135a
fix: only create rc file if it doesn't exist ( #10 )
2021-03-25 12:07:51 -04:00
TorchedSammy
913d6486ac
fix: merge conflicts; dont set /bin/zsh explicitly unless used with flag (for neofetch to use hilbish :))
2021-03-24 20:58:31 -04:00
TorchedSammy
deb1bc8a5e
chore: bump version
2021-03-24 20:22:25 -04:00
TorchedSammy
1c1ec87612
feat: add to history for lua
2021-03-24 20:21:55 -04:00
TorchedSammy
972c6e44b3
feat: go to next line if sh input is incomplete
2021-03-24 19:18:30 -04:00
TorchedSammy
d3bd47963d
chore: bump version
2021-03-24 15:04:09 -04:00
TorchedSammy
76d0806375
feat: switch to master's readline lib; add tab complete and sh support
2021-03-24 14:50:22 -04:00
TorchedSammy
5186d785a9
feat: aliases via alias(alias, orig)
2021-03-21 17:20:19 -04:00
TorchedSammy
b27b656dd6
fix: try loading preload in current directory
2021-03-21 14:47:27 -04:00
TorchedSammy
adb3c0df16
feat: use commanding table to store custom commands, load preload file and set require path in go
2021-03-21 12:42:04 -04:00
TorchedSammy
511c734eed
fix: my stupidity in handling both configs not found
2021-03-21 03:58:04 -04:00
TorchedSammy
45064af34f
create config if missing
2021-03-21 03:51:44 -04:00
TorchedSammy
646a138dcd
chore: bump version
2021-03-21 02:46:47 -04:00
TorchedSammy
f943a55940
fix: dont replace ~ if in quotes; replace ~ with $HOME
2021-03-21 02:45:27 -04:00
TorchedSammy
b0ab7fb8d7
feat: replace home char
2021-03-21 02:44:03 -04:00