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N#H
zOX38lq`dP%T_amT(>oXNGUXu_N8X&+`yVbSk%mgs%{Bz1wv24h;V#GjGcRDmoZ{$u
zC<%zUFwVXQR1y
z<37#E#Zx7DG$g*Rv%QctdvS(t>6NQ1D$gdL%0C(GcUSJG)5PPw6L+eWpRhV2eDU>*
zSDv$eJQcJkXJ2CrvpDMU4ClML>Q_th_f31^W;gM~p8X!Fs-N2{`u}}1c0D}nQAF?8
z)U%gY@t)7fih5FNvvTDpx3>Xr7bOZGwXSWHoA+SildDHuyQkcKV_esxceHQOR;#S9
z!Jn0@cB=S)z1q7s|A?P*v3r^(_baAd|*1KFbvx^(l_>wDBPwuMh=d!=EzEpDMr)_2#<(0YnWnVO$?-X^-E?u$j
z*z!Q*^Q(ai2ksY1{kArGZBW74{la(JkJRPGY1MOfe_4L`R(^d;3IFA<&r5iA0P7YB
zv3oc5GvEL6uKK$5{TKOk83rEde>a&K7{rs^`579zH!fypIB+!M3j@OriC#IN@ZyWi
z3=fh_su&nzdfY%NF1}!7C@_?=Wnj>Aqle-f{~J1YcHLX%r3^gghr!d;&t;ucLK6VF
C)KP>0
literal 0
HcmV?d00001
From 72d6b0a4a0266eb1b3ab1b6c17ea90a3020cc152 Mon Sep 17 00:00:00 2001
From: sammyette
Date: Wed, 28 Dec 2022 20:53:38 -0400
Subject: [PATCH 080/119] chore: add 2.0.1 tag to changelog
---
CHANGELOG.md | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 885cefd..6f80bb6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
# 🎀 Changelog
+## [2.0.1] - 2022-12-28
+### Fixed
+- Corrected documentation for hooks, removing outdated `command.no-perm`
+- Fixed an issue where `cd` with no args would not update the old pwd
+- Tiny documentation enhancements for the `hilbish.timer` interface
+
## [2.0.0] - 2022-12-20
**NOTES FOR USERS/PACKAGERS UPDATING:**
- Hilbish now uses [Task] insead of Make for builds.
@@ -611,6 +617,7 @@ This input for example will prompt for more input to complete:
First "stable" release of Hilbish.
+[2.0.1]: https://github.com/Rosettea/Hilbish/compare/v2.0.0...v2.0.1
[2.0.0]: https://github.com/Rosettea/Hilbish/compare/v1.2.0...v2.0.0
[2.0.0-rc1]: https://github.com/Rosettea/Hilbish/compare/v1.2.0...v2.0.0-rc1
[1.2.0]: https://github.com/Rosettea/Hilbish/compare/v1.1.4...v1.2.0
From 2a80795331bf80578548d6f3a8b54ab9bdf11810 Mon Sep 17 00:00:00 2001
From: sammyette
Date: Wed, 28 Dec 2022 22:23:47 -0400
Subject: [PATCH 081/119] chore: update version
---
vars.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vars.go b/vars.go
index 810c1ee..4dd080c 100644
--- a/vars.go
+++ b/vars.go
@@ -11,7 +11,7 @@ var (
// Version info
var (
- ver = "v2.0.0"
+ ver = "v2.0.1"
releaseName = "Hibiscus"
gitCommit string
gitBranch string
From 91ec0cf4a46fed395b75a8781bfae0ed9afd5219 Mon Sep 17 00:00:00 2001
From: sammyette
Date: Wed, 28 Dec 2022 22:26:20 -0400
Subject: [PATCH 082/119] docs: remove api index (there is already _index)
---
docs/api/index.md | 1 -
1 file changed, 1 deletion(-)
delete mode 100644 docs/api/index.md
diff --git a/docs/api/index.md b/docs/api/index.md
deleted file mode 100644
index 4effa19..0000000
--- a/docs/api/index.md
+++ /dev/null
@@ -1 +0,0 @@
-hello!
From 246fc4d7ee3239b4d220eeae04bee43d6165df6a Mon Sep 17 00:00:00 2001
From: sammyette
Date: Wed, 28 Dec 2022 22:27:05 -0400
Subject: [PATCH 083/119] website: add blog
---
website/config.toml | 12 +-
website/content/blog/v2.0-release.md | 114 ++++++++++++++++++
website/content/blog/welcome.md | 6 +
website/content/install.md | 1 +
.../layouts/_default/_markup/render-link.html | 5 +-
website/themes/hsh/layouts/_default/list.html | 21 ++++
.../themes/hsh/layouts/_default/single.html | 11 +-
7 files changed, 164 insertions(+), 6 deletions(-)
create mode 100644 website/content/blog/v2.0-release.md
create mode 100644 website/content/blog/welcome.md
diff --git a/website/config.toml b/website/config.toml
index ff6b801..31f42d5 100644
--- a/website/config.toml
+++ b/website/config.toml
@@ -20,6 +20,16 @@ enableGitInfo = true
name = 'Docs'
pageref = '/docs'
weight = 3
-
+[[menu.nav]]
+ identifier = 'blog'
+ name = 'Blog'
+ pageref = '/blog'
+ weight = 4
+
[markup.goldmark.renderer]
unsafe = true
+
+[author]
+ [author.sammyette]
+ name = 'sammyette'
+ picture = 'https://avatars1.githubusercontent.com/u/38820196?s=460&u=b9f4efb2375bae6cb30656d790c6e0a2939327c0&v=4'
diff --git a/website/content/blog/v2.0-release.md b/website/content/blog/v2.0-release.md
new file mode 100644
index 0000000..23b8f6f
--- /dev/null
+++ b/website/content/blog/v2.0-release.md
@@ -0,0 +1,114 @@
+---
+title: "Hilbish v2.0 Release"
+date: 2022-12-29T01:55:21+00:00
+---
+
+Hilbish v2.0 has been released!
+Well actually, it was released a week ago, but I only wrote this
+Hilbish blog *after* that.
+
+This is a **big** release, coming 9 months after the previous v1.2.0 and
+featuring over 40+ bug fixes and tons of new features and enhancements, so
+let's see what is in this release.
+
+# Documentation
+When querying about the problems people have with Hilbish, one of the
+issues was its poor documentation. Hilbish had plain text, autogenerated
+documentation which only covered the module functions (bait, hilbish,
+commander, etc.) and did not include the interfaces (`hilbish.timers`,
+`hilbish.jobs` and all that).
+
+I have tried to improve this by working on documenting all the
+interfaces (except for some functions of `hilbish.runner`, that's hard to do)
+and made the documentation markdown for use on this website. This means
+that users can look at documentation here or with the `doc` command.
+
+Hopefully this addresses documentation complaints, and if not, please open an issue.
+
+# Main Bug Fixes
+As this is a piece of software with no unit testing that is maintained by me alone,
+there is gonna be either some bug or something that I overlooked when
+making a change. I make a lot of mistakes. There's also the other fact that
+sometimes there's just bugs for any other reasosn. Good thing I fixed
+more than 40 of those bugs in this release!
+
+## Readline Bug Fixes
+The pure Go readline library is good in some ways and bad in others.
+A good portion of the bug fixes are for the readline library, and also
+related to text input with east asian characters and the like (Korean, Japanese,
+etc.)
+
+A few of the fixes (and additions) include:
+
+- Fixing various crashes, including when there is a "stray" newline at the end of text
+- Grid completion menu causing spam and duplicate text when there are items longer than
+the terminal and/or contain Japanese or other characters.
+- Cursor positioning with CJK characters
+- Adding new keybinds and fixing others
+
+## Other fixes
+There are a lot more fixes, even more than the ones listed here, but these are the main ones:
+ - Don't put alias expanded command in history (I've fixed this 5 times now....)
+ - Handle stdin being nonblocking
+ - Completion related fixes, like showing the full name, completing files with spaces
+
+# Breaking changes
+This release is a major version bump not only because there are tons of fixes, but because
+there are breaking changes. This means that there are some changes done which would
+cause errors with an old user config (breaking).
+
+## Lua 5.4
+The most important is the use of a new Lua VM library. Previously, Hilbish
+used gopher-lua, which implements Lua 5.1. This has been changed to
+[golua](https://github.com/arnodel/golua/), which implements Lua 5.4.
+
+Moving from 5.1 to 5.4 does have breaking changes even if it doesn't seem like it,
+and since these are different Lua implementations, there may be some differences there too.
+
+## Userdata
+Previously, objects such as jobs or timers were represented by tables.
+This has been changed to userdata to make more sense.
+
+## Other changes
+Runner functions are now required to return a table.
+It can (at the moment) have 4 variables:
+ - `input` (user input)
+ - `exitCode` (exit code)
+ - `error` (error message)
+ - `continue` (whether to prompt for more input)
+User input has been added to the return to account for runners wanting to
+prompt for continued input, and to add it properly to history. `continue`
+got added so that it would be easier for runners to get continued input
+without having to actually handle it at all.
+
+The MacOS config paths now match Linux, since it makes more sense for
+a program like Hilbish.
+
+The Hilbish greeting is now an *opt*, and is printed by default.
+
+# Feature Additions
+Besides fixes and changes, this release also includes a good portion of
+new features! Users can now add handlers for syntax highlighting and
+inline hinting.
+
+Some new hooks have been added, like `hilbish.cancel` and `hilbish.init`.
+You can look at all the hooks via the `doc hooks` command
+
+Job management functions have also been added. You can now put jobs in the
+foreground/background and disown them via the expected commands and also
+via the Lua API.
+
+The `hilbish.timers` API interface was also added in this release!
+
+# Closing Off
+Hilbish has gone from something small and simple for myself to a slightly
+advanced shell with a decent amount of features, and a few users. It
+still hasn't reached levels of other alt shells in regards to literally
+everything, but the goal is to get there!
+
+If you want to check the FULL changelog, you can [do so here.](https://github.com/Rosettea/Hilbish/releases/tag/v2.0.0)
+This v2.0 release marks an advancement in Hilbish (and also how long
+one of my projects hasn't died) and I hope it can advance even further.
+
+Thanks for reading, and I'll be back for the v2.1 release notes, or maybe
+something else in between.
diff --git a/website/content/blog/welcome.md b/website/content/blog/welcome.md
new file mode 100644
index 0000000..16a878d
--- /dev/null
+++ b/website/content/blog/welcome.md
@@ -0,0 +1,6 @@
+---
+title: "Welcome to the Hilbish blog"
+---
+
+Hello! Welcome to the Hilbish blog. This will mainly contain release
+announcements and some other things relating to Hilbish (development).
diff --git a/website/content/install.md b/website/content/install.md
index 1ae103f..498dc6d 100644
--- a/website/content/install.md
+++ b/website/content/install.md
@@ -2,6 +2,7 @@
title: Install
description: Steps on how to install Hilbish on all the OSes and distros supported.
layout: page
+draft: true
---
## Official Binaries
diff --git a/website/themes/hsh/layouts/_default/_markup/render-link.html b/website/themes/hsh/layouts/_default/_markup/render-link.html
index 9c2a95e..b0d800e 100644
--- a/website/themes/hsh/layouts/_default/_markup/render-link.html
+++ b/website/themes/hsh/layouts/_default/_markup/render-link.html
@@ -1,4 +1 @@
-
- {{ .Text | safeHTML }}
-
-
+{{ .Text | safeHTML }}
diff --git a/website/themes/hsh/layouts/_default/list.html b/website/themes/hsh/layouts/_default/list.html
index e69de29..bbb9e8a 100644
--- a/website/themes/hsh/layouts/_default/list.html
+++ b/website/themes/hsh/layouts/_default/list.html
@@ -0,0 +1,21 @@
+{{ define "main" }}
+
+
+ {{ range where .Site.RegularPages "Section" "in" "blog" }}
+
+
+
+
{{ .Title }}
+
+ {{- if isset .Params "date" -}}
+ {{ .Date.Format "January 2, 2006" }}
+ {{- end -}}
+
+
{{if .Description}}{{ .Description }}{{ else }}{{ .Summary }}{{ end }}
+
+
+
+ {{- end }}
+
+
+{{ end }}
diff --git a/website/themes/hsh/layouts/_default/single.html b/website/themes/hsh/layouts/_default/single.html
index 0ac0e37..bd7e18c 100644
--- a/website/themes/hsh/layouts/_default/single.html
+++ b/website/themes/hsh/layouts/_default/single.html
@@ -2,7 +2,16 @@
{{ .Title }}
- {{.Content}}
+
+
+ by {{ .Site.Author.sammyette.name }}
+ {{- if isset .Params "date" -}}
+ // {{ .Date.Format "January 2, 2006" }}
+ {{- end -}}
+
+
+ {{.Content}}
+
{{ end }}
From ef5363cb1ff9d90e8d97c2c1b25a359f8b1a4ee7 Mon Sep 17 00:00:00 2001
From: sammyette
Date: Sat, 31 Dec 2022 20:01:10 -0400
Subject: [PATCH 084/119] website: dont set install as draft
---
website/content/install.md | 1 -
1 file changed, 1 deletion(-)
diff --git a/website/content/install.md b/website/content/install.md
index 498dc6d..1ae103f 100644
--- a/website/content/install.md
+++ b/website/content/install.md
@@ -2,7 +2,6 @@
title: Install
description: Steps on how to install Hilbish on all the OSes and distros supported.
layout: page
-draft: true
---
## Official Binaries
From 887260cd8ab539f3e9253d33b10cb6e72579fac6 Mon Sep 17 00:00:00 2001
From: sammyette
Date: Sat, 7 Jan 2023 07:39:36 -0400
Subject: [PATCH 085/119] fix: print error on event error and dont release hook
(closes #226)
---
nature/init.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nature/init.lua b/nature/init.lua
index ecd1054..d1f919c 100644
--- a/nature/init.lua
+++ b/nature/init.lua
@@ -67,7 +67,7 @@ do
end
bait.catch('error', function(event, handler, err)
- bait.release(event, handler)
+ print(string.format('Encountered an error in %s handler\n%s', event, err:sub(8)))
end)
bait.catch('command.not-found', function(cmd)
From 07a7a75b463db52a46f5cda0f75c0f41f96498a8 Mon Sep 17 00:00:00 2001
From: sammyette
Date: Sat, 7 Jan 2023 11:52:05 -0400
Subject: [PATCH 086/119] docs: fix return type for hilbish.aliases.list
---
aliases.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/aliases.go b/aliases.go
index d9416d9..bfacc43 100644
--- a/aliases.go
+++ b/aliases.go
@@ -92,9 +92,9 @@ func (a *aliasModule) Loader(rtm *rt.Runtime) *rt.Table {
func _hlalias() {}
// #interface aliases
-// list() -> aliases (table)
+// list() -> table
// Get a table of all aliases, with string keys as the alias and the value as the command.
-// @returns table
+// --- @returns table
func (a *aliasModule) luaList(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
aliasesList := rt.NewTable()
for k, v := range a.All() {
From a2f0ff3e091aae80bd3008af9dd77a06616780c1 Mon Sep 17 00:00:00 2001
From: TorchedSammy
Date: Sat, 7 Jan 2023 15:52:49 +0000
Subject: [PATCH 087/119] docs: [ci] generate new docs
---
docs/api/hilbish/hilbish.aliases.md | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/docs/api/hilbish/hilbish.aliases.md b/docs/api/hilbish/hilbish.aliases.md
index 9b90e5c..34182ad 100644
--- a/docs/api/hilbish/hilbish.aliases.md
+++ b/docs/api/hilbish/hilbish.aliases.md
@@ -17,9 +17,8 @@ This is an alias (ha) for the `hilbish.alias` function.
### delete(name)
Removes an alias.
-### list() -> aliases (table)
+### list() -> table
Get a table of all aliases, with string keys as the alias and the value as the command.
-@returns table
### resolve(alias) -> command (string)
Tries to resolve an alias to its command.
From 354f257c0385153663be19c6f867d9335479a86b Mon Sep 17 00:00:00 2001
From: sammyette
Date: Sat, 7 Jan 2023 13:54:08 -0400
Subject: [PATCH 088/119] feat(commands/doc): make it easier to get interface
docs
---
nature/commands/doc.lua | 3 +++
1 file changed, 3 insertions(+)
diff --git a/nature/commands/doc.lua b/nature/commands/doc.lua
index bc45eea..f8eec18 100644
--- a/nature/commands/doc.lua
+++ b/nature/commands/doc.lua
@@ -24,6 +24,9 @@ commander.register('doc', function(args)
subdocName = '_index'
end
f = io.open(moddocPath .. subdocName .. '.md', 'rb')
+ if not f then
+ f = io.open(moddocPath .. subdocName:match '%w+' .. '/' .. subdocName .. '.md', 'rb')
+ end
if not f then
moddocPath = moddocPath .. subdocName .. '/'
subdocName = args[3] or '_index'
From 4e023703b6bc6955c4de4805f673482bb85166d0 Mon Sep 17 00:00:00 2001
From: sammyette
Date: Sat, 7 Jan 2023 14:01:57 -0400
Subject: [PATCH 089/119] feat(commands/doc): use local docs directory if
hilbish branch is found
---
nature/commands/doc.lua | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/nature/commands/doc.lua b/nature/commands/doc.lua
index f8eec18..295e042 100644
--- a/nature/commands/doc.lua
+++ b/nature/commands/doc.lua
@@ -4,6 +4,11 @@ local lunacolors = require 'lunacolors'
commander.register('doc', function(args)
local moddocPath = hilbish.dataDir .. '/docs/'
+ local stat = fs.stat '.git/refs/heads/extended-job-api'
+ if stat then
+ -- hilbish git
+ moddocPath = './docs/'
+ end
local apidocHeader = [[
# %s
{grayBg} {white}{italic}%s {reset}
From a6bcfdfca92e1958e77f7bd1880faeaf1336754b Mon Sep 17 00:00:00 2001
From: sammyette
Date: Sat, 7 Jan 2023 14:02:21 -0400
Subject: [PATCH 090/119] feat(commands/doc): return 1 exit code when doc not
found
---
nature/commands/doc.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nature/commands/doc.lua b/nature/commands/doc.lua
index 295e042..6f39306 100644
--- a/nature/commands/doc.lua
+++ b/nature/commands/doc.lua
@@ -39,7 +39,7 @@ commander.register('doc', function(args)
end
if not f then
print('No documentation found for ' .. mod .. '.')
- return
+ return 1
end
end
funcdocs = f:read '*a':gsub('-([%d]+)', '%1')
From 109b5785af3421b55da241bd300c3d52d5378346 Mon Sep 17 00:00:00 2001
From: sammyette
Date: Sat, 7 Jan 2023 14:59:55 -0400
Subject: [PATCH 091/119] chore: bump version to 2.1
---
vars.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vars.go b/vars.go
index 4dd080c..41c7a02 100644
--- a/vars.go
+++ b/vars.go
@@ -11,7 +11,7 @@ var (
// Version info
var (
- ver = "v2.0.1"
+ ver = "v2.1.0"
releaseName = "Hibiscus"
gitCommit string
gitBranch string
From d99e056a76508c8efd5df4e6a9a6bb5a99a3c053 Mon Sep 17 00:00:00 2001
From: sammyette
Date: Tue, 17 Jan 2023 22:04:54 -0400
Subject: [PATCH 092/119] feat: add function to get current runner name
---
nature/runner.lua | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/nature/runner.lua b/nature/runner.lua
index 9b62ad1..235ab77 100644
--- a/nature/runner.lua
+++ b/nature/runner.lua
@@ -75,6 +75,12 @@ function hilbish.runner.setCurrent(name)
hilbish.runner.setMode(r.run)
end
+--- Returns the current runner by name.
+--- @returns string
+function hilbish.runner.getCurrent()
+ return currentRunner
+end
+
hilbish.runner.add('hybrid', function(input)
local cmdStr = hilbish.aliases.resolve(input)
From 6530d48b004f15c0deeb4b52ec231b59136bec2a Mon Sep 17 00:00:00 2001
From: sammyette
Date: Wed, 18 Jan 2023 06:39:26 -0400
Subject: [PATCH 093/119] docs: document types properly (#227)
---
.gitignore | 1 +
website/.hugo_build.lock => .hugo_build.lock | 0
CHANGELOG.md | 5 +
api.go | 23 +--
cmd/docgen/docgen.go | 164 +++++++++++++++++-
docs/api/hilbish/_index.md | 17 +-
docs/api/hilbish/hilbish.aliases.md | 2 +-
docs/api/hilbish/hilbish.jobs.md | 50 +++---
docs/api/hilbish/hilbish.timers.md | 31 ++--
emmyLuaDocs/hilbish.lua | 15 +-
job.go | 22 +--
nature/commands/doc.lua | 53 +++---
timer.go | 5 +
timerhandler.go | 12 +-
.../_default/_markup/render-heading.html | 9 +-
website/themes/hsh/layouts/partials/head.html | 16 +-
16 files changed, 306 insertions(+), 119 deletions(-)
rename website/.hugo_build.lock => .hugo_build.lock (100%)
diff --git a/.gitignore b/.gitignore
index b2be7c4..1abf82c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@ docgen
.vim
petals/
+.hugo_build.lock
diff --git a/website/.hugo_build.lock b/.hugo_build.lock
similarity index 100%
rename from website/.hugo_build.lock
rename to .hugo_build.lock
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6f80bb6..6645d80 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
# 🎀 Changelog
+## Unreleased
+### Added
+- Documented custom userdata types (Job and Timer Objects)
+ - Coming with fix is also adding the return types for some functions that were missing it
+
## [2.0.1] - 2022-12-28
### Fixed
- Corrected documentation for hooks, removing outdated `command.no-perm`
diff --git a/api.go b/api.go
index 3ac7c92..d5a3fa4 100644
--- a/api.go
+++ b/api.go
@@ -231,8 +231,9 @@ func hlrun(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
return c.PushingNext(t.Runtime, rt.IntValue(int64(exitcode)), rt.StringValue(stdoutStr), rt.StringValue(stderrStr)), nil
}
-// cwd()
+// cwd() -> string
// Returns the current directory of the shell
+// --- @returns string
func hlcwd(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
cwd, _ := os.Getwd()
@@ -444,12 +445,12 @@ func hlgoro(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
return c.Next(), nil
}
-// timeout(cb, time)
-// Runs the `cb` function after `time` in milliseconds
-// Returns a `timer` object (see `doc timers`).
+// timeout(cb, time) -> @Timer
+// Runs the `cb` function after `time` in milliseconds.
+// This creates a timer that starts immediately.
// --- @param cb function
// --- @param time number
-// --- @returns table
+// --- @returns Timer
func hltimeout(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
if err := c.CheckNArgs(2); err != nil {
return nil, err
@@ -470,12 +471,12 @@ func hltimeout(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
return c.PushingNext1(t.Runtime, rt.UserDataValue(timer.ud)), nil
}
-// interval(cb, time)
+// interval(cb, time) -> @Timer
// Runs the `cb` function every `time` milliseconds.
-// Returns a `timer` object (see `doc timers`).
+// This creates a timer that starts immediately.
// --- @param cb function
// --- @param time number
-// --- @return table
+// --- @return Timer
func hlinterval(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
if err := c.CheckNArgs(2); err != nil {
return nil, err
@@ -536,9 +537,11 @@ func hlprependPath(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
return c.Next(), nil
}
-// which(name)
-// Checks if `name` is a valid command
+// which(name) -> string
+// Checks if `name` is a valid command.
+// Will return the path of the binary, or a basename if it's a commander.
// --- @param name string
+// --- @returns string
func hlwhich(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
if err := c.Check1Arg(); err != nil {
return nil, err
diff --git a/cmd/docgen/docgen.go b/cmd/docgen/docgen.go
index cf70840..faa7845 100644
--- a/cmd/docgen/docgen.go
+++ b/cmd/docgen/docgen.go
@@ -7,6 +7,7 @@ import (
"go/doc"
"go/parser"
"go/token"
+ "regexp"
"strings"
"os"
"sync"
@@ -31,6 +32,7 @@ type emmyPiece struct {
}
type module struct {
+ Types []docPiece
Docs []docPiece
Fields []docPiece
Properties []docPiece
@@ -38,6 +40,7 @@ type module struct {
Description string
ParentModule string
HasInterfaces bool
+ HasTypes bool
}
type docPiece struct {
@@ -49,6 +52,7 @@ type docPiece struct {
GoFuncName string
IsInterface bool
IsMember bool
+ IsType bool
Fields []docPiece
Properties []docPiece
}
@@ -61,6 +65,7 @@ type tag struct {
var docs = make(map[string]module)
var interfaceDocs = make(map[string]module)
var emmyDocs = make(map[string][]emmyPiece)
+var typeTable = make(map[string][]string) // [0] = parentMod, [1] = interfaces
var prefix = map[string]string{
"main": "hl",
"hilbish": "hl",
@@ -119,6 +124,71 @@ func docPieceTag(tagName string, tags map[string][]tag) []docPiece {
return dps
}
+func setupDocType(mod string, typ *doc.Type) *docPiece {
+ docs := strings.TrimSpace(typ.Doc)
+ inInterface := strings.HasPrefix(docs, "#interface")
+ if !inInterface {
+ return nil
+ }
+
+ tags, doc := getTagsAndDocs(docs)
+
+ var interfaces string
+ typeName := strings.ToUpper(string(typ.Name[0])) + typ.Name[1:]
+ typeDoc := []string{}
+
+ if inInterface {
+ interfaces = tags["interface"][0].id
+ }
+
+ fields := docPieceTag("field", tags)
+ properties := docPieceTag("property", tags)
+
+ for _, d := range doc {
+ if strings.HasPrefix(d, "---") {
+ // TODO: document types in lua
+ /*
+ emmyLine := strings.TrimSpace(strings.TrimPrefix(d, "---"))
+ emmyLinePieces := strings.Split(emmyLine, " ")
+ emmyType := emmyLinePieces[0]
+ if emmyType == "@param" {
+ em.Params = append(em.Params, emmyLinePieces[1])
+ }
+ if emmyType == "@vararg" {
+ em.Params = append(em.Params, "...") // add vararg
+ }
+ em.Annotations = append(em.Annotations, d)
+ */
+ } else {
+ typeDoc = append(typeDoc, d)
+ }
+ }
+
+ var isMember bool
+ if tags["member"] != nil {
+ isMember = true
+ }
+ var parentMod string
+ if inInterface {
+ parentMod = mod
+ }
+ dps := &docPiece{
+ Doc: typeDoc,
+ FuncName: typeName,
+ Interfacing: interfaces,
+ IsInterface: inInterface,
+ IsMember: isMember,
+ IsType: true,
+ ParentModule: parentMod,
+ Fields: fields,
+ Properties: properties,
+ }
+
+ typeTable[strings.ToLower(typeName)] = []string{parentMod, interfaces}
+
+ return dps
+}
+
func setupDoc(mod string, fun *doc.Func) *docPiece {
docs := strings.TrimSpace(fun.Doc)
inInterface := strings.HasPrefix(docs, "#interface")
@@ -220,6 +290,7 @@ func main() {
for l, f := range pkgs {
p := doc.New(f, "./", doc.AllDecls)
pieces := []docPiece{}
+ typePieces := []docPiece{}
mod := l
if mod == "main" {
mod = "hilbish"
@@ -237,6 +308,14 @@ func main() {
}
}
for _, t := range p.Types {
+ typePiece := setupDocType(mod, t)
+ if typePiece != nil {
+ typePieces = append(typePieces, *typePiece)
+ if typePiece.IsInterface {
+ hasInterfaces = true
+ }
+ }
+
for _, m := range t.Methods {
piece := setupDoc(mod, m)
if piece == nil {
@@ -254,6 +333,7 @@ func main() {
shortDesc := descParts[0]
desc := descParts[1:]
filteredPieces := []docPiece{}
+ filteredTypePieces := []docPiece{}
for _, piece := range pieces {
if !piece.IsInterface {
filteredPieces = append(filteredPieces, piece)
@@ -276,10 +356,28 @@ func main() {
interfaceModules[modname].Properties = piece.Properties
continue
}
+
interfaceModules[modname].Docs = append(interfaceModules[modname].Docs, piece)
}
+ for _, piece := range typePieces {
+ if !piece.IsInterface {
+ filteredTypePieces = append(filteredTypePieces, piece)
+ continue
+ }
+
+ modname := piece.ParentModule + "." + piece.Interfacing
+ if interfaceModules[modname] == nil {
+ interfaceModules[modname] = &module{
+ ParentModule: piece.ParentModule,
+ }
+ }
+
+ interfaceModules[modname].Types = append(interfaceModules[modname].Types, piece)
+ }
+
docs[mod] = module{
+ Types: filteredTypePieces,
Docs: filteredPieces,
ShortDescription: shortDesc,
Description: strings.Join(desc, "\n"),
@@ -335,17 +433,71 @@ func main() {
}
f.WriteString("\n")
}
+
if len(modu.Docs) != 0 {
+ typeTag, _ := regexp.Compile(`@\w+`)
f.WriteString("## Functions\n")
+ for _, dps := range modu.Docs {
+ if dps.IsMember {
+ continue
+ }
+ htmlSig := typeTag.ReplaceAllStringFunc(strings.Replace(dps.FuncSig, "<", `\<`, -1), func(typ string) string {
+ typName := typ[1:]
+ typLookup := typeTable[strings.ToLower(typName)]
+ linkedTyp := fmt.Sprintf("/Hilbish/docs/api/%s/%s/#%s", typLookup[0], typLookup[0] + "." + typLookup[1], strings.ToLower(typName))
+ return fmt.Sprintf(`%s `, linkedTyp, typName)
+ })
+ f.WriteString(fmt.Sprintf("### %s\n", htmlSig))
+ for _, doc := range dps.Doc {
+ if !strings.HasPrefix(doc, "---") {
+ f.WriteString(doc + "\n")
+ }
+ }
+ f.WriteString("\n")
+ }
}
- for _, dps := range modu.Docs {
- f.WriteString(fmt.Sprintf("### %s\n", dps.FuncSig))
- for _, doc := range dps.Doc {
- if !strings.HasPrefix(doc, "---") {
- f.WriteString(doc + "\n")
+
+ if len(modu.Types) != 0 {
+ f.WriteString("## Types\n")
+ for _, dps := range modu.Types {
+ f.WriteString(fmt.Sprintf("## %s\n", dps.FuncName))
+ for _, doc := range dps.Doc {
+ if !strings.HasPrefix(doc, "---") {
+ f.WriteString(doc + "\n")
+ }
+ }
+ if len(dps.Properties) != 0 {
+ f.WriteString("### Properties\n")
+ for _, dps := range dps.Properties {
+ f.WriteString(fmt.Sprintf("- `%s`: ", dps.FuncName))
+ f.WriteString(strings.Join(dps.Doc, " "))
+ f.WriteString("\n")
+ }
+ }
+ f.WriteString("\n")
+ typeTag, _ := regexp.Compile(`@\w+`)
+
+ f.WriteString("### Methods\n")
+ for _, dps := range modu.Docs {
+ if !dps.IsMember {
+ continue
+ }
+ htmlSig := typeTag.ReplaceAllStringFunc(strings.Replace(dps.FuncSig, "<", `\<`, -1), func(typ string) string {
+ // todo: get type from global table to link to
+ // other pages (hilbish page can link to hilbish.jobs#Job)
+ typName := typ[1:]
+ linkedTyp := strings.ToLower(typName) // TODO: link
+ return fmt.Sprintf(`%s `, linkedTyp, typName)
+ })
+ f.WriteString(fmt.Sprintf("#### %s\n", htmlSig))
+ for _, doc := range dps.Doc {
+ if !strings.HasPrefix(doc, "---") {
+ f.WriteString(doc + "\n")
+ }
+ }
+ f.WriteString("\n")
}
}
- f.WriteString("\n")
}
}(mod, docPath, v)
diff --git a/docs/api/hilbish/_index.md b/docs/api/hilbish/_index.md
index 1773892..52bd404 100644
--- a/docs/api/hilbish/_index.md
+++ b/docs/api/hilbish/_index.md
@@ -35,7 +35,7 @@ replacing with the name of the command (for example `command.git`).
`cb` must be a function that returns a table of "completion groups."
Check `doc completions` for more information.
-### cwd()
+### cwd() -> string
Returns the current directory of the shell
### exec(cmd)
@@ -60,9 +60,9 @@ override this function with your custom handler.
### inputMode(mode)
Sets the input mode for Hilbish's line reader. Accepts either emacs or vim
-### interval(cb, time)
+### interval(cb, time) -> Timer
Runs the `cb` function every `time` milliseconds.
-Returns a `timer` object (see `doc timers`).
+This creates a timer that starts immediately.
### multiprompt(str)
Changes the continued line prompt to `str`
@@ -95,10 +95,11 @@ Accepted values for mode are hybrid (the default), hybridRev (sh first then Lua)
sh, and lua. It also accepts a function, to which if it is passed one
will call it to execute user input instead.
-### timeout(cb, time)
-Runs the `cb` function after `time` in milliseconds
-Returns a `timer` object (see `doc timers`).
+### timeout(cb, time) -> Timer
+Runs the `cb` function after `time` in milliseconds.
+This creates a timer that starts immediately.
-### which(name)
-Checks if `name` is a valid command
+### which(name) -> string
+Checks if `name` is a valid command.
+Will return the path of the binary, or a basename if it's a commander.
diff --git a/docs/api/hilbish/hilbish.aliases.md b/docs/api/hilbish/hilbish.aliases.md
index 34182ad..bae5bfc 100644
--- a/docs/api/hilbish/hilbish.aliases.md
+++ b/docs/api/hilbish/hilbish.aliases.md
@@ -17,7 +17,7 @@ This is an alias (ha) for the `hilbish.alias` function.
### delete(name)
Removes an alias.
-### list() -> table
+### list() -> table\
Get a table of all aliases, with string keys as the alias and the value as the command.
### resolve(alias) -> command (string)
diff --git a/docs/api/hilbish/hilbish.jobs.md b/docs/api/hilbish/hilbish.jobs.md
index d8ec989..b36b748 100644
--- a/docs/api/hilbish/hilbish.jobs.md
+++ b/docs/api/hilbish/hilbish.jobs.md
@@ -14,7 +14,29 @@ Manage interactive jobs in Hilbish via Lua.
Jobs are the name of background tasks/commands. A job can be started via
interactive usage or with the functions defined below for use in external runners.
-## Object properties
+## Functions
+### stop()
+Stops the job from running.
+
+### add(cmdstr, args, execPath)
+Adds a new job to the job table. Note that this does not immediately run it.
+
+### all() -> table\<Job >
+Returns a table of all job objects.
+
+### disown(id)
+Disowns a job. This deletes it from the job table.
+
+### get(id) -> Job
+Get a job object via its ID.
+
+### last() -> Job
+Returns the last added job from the table.
+
+## Types
+## Job
+The Job type describes a Hilbish job.
+### Properties
- `cmd`: The user entered command string for the job.
- `running`: Whether the job is running or not.
- `id`: The ID of the job in the job table
@@ -23,32 +45,14 @@ interactive usage or with the functions defined below for use in external runner
- `stdout`: The standard output of the job. This just means the normal logs of the process.
- `stderr`: The standard error stream of the process. This (usually) includes error messages of the job.
-## Functions
-### background()
+### Methods
+#### background()
Puts a job in the background. This acts the same as initially running a job.
-### foreground()
+#### foreground()
Puts a job in the foreground. This will cause it to run like it was
executed normally and wait for it to complete.
-### start()
+#### start()
Starts running the job.
-### stop()
-Stops the job from running.
-
-### add(cmdstr, args, execPath)
-Adds a new job to the job table. Note that this does not immediately run it.
-
-### all() -> jobs (table)
-Returns a table of all job objects.
-
-### disown(id)
-Disowns a job. This deletes it from the job table.
-
-### get(id) -> job (Job/Table)
-Get a job object via its ID.
-
-### last() -> job (Job/Table)
-Returns the last added job from the table.
-
diff --git a/docs/api/hilbish/hilbish.timers.md b/docs/api/hilbish/hilbish.timers.md
index 0173023..e899d1d 100644
--- a/docs/api/hilbish/hilbish.timers.md
+++ b/docs/api/hilbish/hilbish.timers.md
@@ -22,35 +22,38 @@ All functions documented with the `Timer` type refer to a Timer object.
An example of usage:
```
-local t = hilbish.timers.create(1, 5000, function()
+local t = hilbish.timers.create(hilbish.timers.TIMEOUT, 5000, function()
print 'hello!'
end)
-t:stop()
-print(t.running, t.duration, t.type)
t:start()
+print(t.running) // true
```
## Interface fields
- `INTERVAL`: Constant for an interval timer type
- `TIMEOUT`: Constant for a timeout timer type
-## Object properties
+## Functions
+### create(type, time, callback) -> Timer
+Creates a timer that runs based on the specified `time` in milliseconds.
+The `type` can either be `hilbish.timers.INTERVAL` or `hilbish.timers.TIMEOUT`
+
+### get(id) -> Timer
+Retrieves a timer via its ID.
+
+## Types
+## Timer
+The Job type describes a Hilbish timer.
+### Properties
- `type`: What type of timer it is
- `running`: If the timer is running
- `duration`: The duration in milliseconds that the timer will run
-## Functions
-### start()
+### Methods
+#### start()
Starts a timer.
-### stop()
+#### stop()
Stops a timer.
-### create(type, time, callback)
-Creates a timer that runs based on the specified `time` in milliseconds.
-The `type` can either be `hilbish.timers.INTERVAL` or `hilbish.timers.TIMEOUT`
-
-### get(id) -> timer (Timer/Table)
-Retrieves a timer via its ID.
-
diff --git a/emmyLuaDocs/hilbish.lua b/emmyLuaDocs/hilbish.lua
index da5bf1c..81a9e6d 100644
--- a/emmyLuaDocs/hilbish.lua
+++ b/emmyLuaDocs/hilbish.lua
@@ -63,6 +63,7 @@ function hilbish.appendPath(dir) end
function hilbish.complete(scope, cb) end
--- Returns the current directory of the shell
+--- @returns string
function hilbish.cwd() end
--- Replaces running hilbish with `cmd`
@@ -94,10 +95,10 @@ function hilbish.hinter(line, pos) end
function hilbish.inputMode(mode) end
--- Runs the `cb` function every `time` milliseconds.
---- Returns a `timer` object (see `doc timers`).
+--- This creates a timer that starts immediately.
--- @param cb function
--- @param time number
---- @return table
+--- @return Timer
function hilbish.interval(cb, time) end
--- Changes the continued line prompt to `str`
@@ -141,15 +142,17 @@ function hilbish.run(cmd, returnOut) end
--- @param mode string|function
function hilbish.runnerMode(mode) end
---- Runs the `cb` function after `time` in milliseconds
---- Returns a `timer` object (see `doc timers`).
+--- Runs the `cb` function after `time` in milliseconds.
+--- This creates a timer that starts immediately.
--- @param cb function
--- @param time number
---- @returns table
+--- @returns Timer
function hilbish.timeout(cb, time) end
---- Checks if `name` is a valid command
+--- Checks if `name` is a valid command.
+--- Will return the path of the binary, or a basename if it's a commander.
--- @param name string
+--- @returns string
function hilbish.which(name) end
--- Puts a job in the background. This acts the same as initially running a job.
diff --git a/job.go b/job.go
index 2b60a80..bdff770 100644
--- a/job.go
+++ b/job.go
@@ -18,6 +18,15 @@ import (
var jobs *jobHandler
var jobMetaKey = rt.StringValue("hshjob")
+// #interface jobs
+// #property cmd The user entered command string for the job.
+// #property running Whether the job is running or not.
+// #property id The ID of the job in the job table
+// #property pid The Process ID
+// #property exitCode The last exit code of the job.
+// #property stdout The standard output of the job. This just means the normal logs of the process.
+// #property stderr The standard error stream of the process. This (usually) includes error messages of the job.
+// The Job type describes a Hilbish job.
type job struct {
cmd string
running bool
@@ -293,13 +302,6 @@ func (j *jobHandler) stopAll() {
}
// #interface jobs
-// #property cmd The user entered command string for the job.
-// #property running Whether the job is running or not.
-// #property id The ID of the job in the job table
-// #property pid The Process ID
-// #property exitCode The last exit code of the job.
-// #property stdout The standard output of the job. This just means the normal logs of the process.
-// #property stderr The standard error stream of the process. This (usually) includes error messages of the job.
// background job management
/*
Manage interactive jobs in Hilbish via Lua.
@@ -384,7 +386,7 @@ func jobUserData(j *job) *rt.UserData {
}
// #interface jobs
-// get(id) -> job (Job/Table)
+// get(id) -> @Job
// Get a job object via its ID.
// --- @param id number
// --- @returns Job
@@ -444,7 +446,7 @@ func (j *jobHandler) luaAddJob(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
}
// #interface jobs
-// all() -> jobs (table)
+// all() -> table<@Job>
// Returns a table of all job objects.
// --- @returns table
func (j *jobHandler) luaAllJobs(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
@@ -481,7 +483,7 @@ func (j *jobHandler) luaDisownJob(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
}
// #interface jobs
-// last() -> job (Job/Table)
+// last() -> @Job
// Returns the last added job from the table.
// --- @returns Job
func (j *jobHandler) luaLastJob(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
diff --git a/nature/commands/doc.lua b/nature/commands/doc.lua
index 6f39306..f15ab8e 100644
--- a/nature/commands/doc.lua
+++ b/nature/commands/doc.lua
@@ -15,6 +15,16 @@ commander.register('doc', function(args)
]]
+ local modules = table.map(fs.readdir(moddocPath), function(f)
+ return lunacolors.underline(lunacolors.blue(string.gsub(f, '.md', '')))
+ end)
+ local doc = [[
+Welcome to Hilbish's documentation viewer! Here you can find
+documentation for builtin functions and other things related
+to Hilbish.
+
+Usage: doc [subdoc]
+Available sections: ]] .. table.concat(modules, ', ')
if #args > 0 then
local mod = args[1]
@@ -43,7 +53,7 @@ commander.register('doc', function(args)
end
end
funcdocs = f:read '*a':gsub('-([%d]+)', '%1')
- local moddocs = table.filter(fs.readdir(moddocPath), function(f) return f ~= '_index.md' end)
+ local moddocs = table.filter(fs.readdir(moddocPath), function(f) return f ~= '_index.md' or f ~= 'index.md' end)
local subdocs = table.map(moddocs, function(fname)
return lunacolors.underline(lunacolors.blue(string.gsub(fname, '.md', '')))
end)
@@ -71,35 +81,20 @@ commander.register('doc', function(args)
if mod == 'api' then
funcdocs = string.format(apidocHeader, vals.title, vals.description or 'no description.') .. funcdocs
end
- local backtickOccurence = 0
- local formattedFuncs = lunacolors.format(funcdocs:sub(1, #funcdocs - 1):gsub('`', function()
- backtickOccurence = backtickOccurence + 1
- if backtickOccurence % 2 == 0 then
- return '{reset}'
- else
- return '{underline}{green}'
- end
- end):gsub('#+.-\n', function(t)
- return '{bold}{magenta}' .. t .. '{reset}'
- end))
- print(formattedFuncs)
+ doc = funcdocs:sub(1, #funcdocs - 1)
f:close()
-
- return
end
- local modules = table.map(fs.readdir(moddocPath), function(f)
- return lunacolors.underline(lunacolors.blue(string.gsub(f, '.md', '')))
- end)
- io.write [[
-Welcome to Hilbish's doc tool! Here you can find documentation for builtin
-functions and other things.
-
-Usage: doc [subdoc]
-A section is a module or a literal section and a subdoc is a subsection for it.
-
-Available sections: ]]
- io.flush()
-
- print(table.concat(modules, ', '))
+ local backtickOccurence = 0
+ print(lunacolors.format(doc:gsub('`', function()
+ backtickOccurence = backtickOccurence + 1
+ if backtickOccurence % 2 == 0 then
+ return '{reset}'
+ else
+ return '{underline}{green}'
+ end
+ end):gsub('#+.-\n', function(t)
+ local signature = t:gsub('<.->(.-)', '{underline}%1'):gsub('\\', '<')
+ return '{bold}{yellow}' .. signature .. '{reset}'
+ end)))
end)
diff --git a/timer.go b/timer.go
index be8f270..d2568b1 100644
--- a/timer.go
+++ b/timer.go
@@ -15,6 +15,11 @@ const (
timerTimeout
)
+// #interface timers
+// #property type What type of timer it is
+// #property running If the timer is running
+// #property duration The duration in milliseconds that the timer will run
+// The Job type describes a Hilbish timer.
type timer struct{
id int
typ timerType
diff --git a/timerhandler.go b/timerhandler.go
index df33d36..0cb4197 100644
--- a/timerhandler.go
+++ b/timerhandler.go
@@ -62,7 +62,7 @@ func (th *timersModule) get(id int) *timer {
}
// #interface timers
-// create(type, time, callback)
+// create(type, time, callback) -> @Timer
// Creates a timer that runs based on the specified `time` in milliseconds.
// The `type` can either be `hilbish.timers.INTERVAL` or `hilbish.timers.TIMEOUT`
// --- @param type number
@@ -91,7 +91,7 @@ func (th *timersModule) luaCreate(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
}
// #interface timers
-// get(id) -> timer (Timer/Table)
+// get(id) -> @Timer
// Retrieves a timer via its ID.
// --- @param id number
// --- @returns Timer
@@ -115,9 +115,6 @@ func (th *timersModule) luaGet(thr *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
// #interface timers
// #field INTERVAL Constant for an interval timer type
// #field TIMEOUT Constant for a timeout timer type
-// #property type What type of timer it is
-// #property running If the timer is running
-// #property duration The duration in milliseconds that the timer will run
// timeout and interval API
/*
If you ever want to run a piece of code on a timed interval, or want to wait
@@ -134,13 +131,12 @@ All functions documented with the `Timer` type refer to a Timer object.
An example of usage:
```
-local t = hilbish.timers.create(1, 5000, function()
+local t = hilbish.timers.create(hilbish.timers.TIMEOUT, 5000, function()
print 'hello!'
end)
-t:stop()
-print(t.running, t.duration, t.type)
t:start()
+print(t.running) // true
```
*/
func (th *timersModule) loader(rtm *rt.Runtime) *rt.Table {
diff --git a/website/themes/hsh/layouts/_default/_markup/render-heading.html b/website/themes/hsh/layouts/_default/_markup/render-heading.html
index 6ea5346..da71fe1 100644
--- a/website/themes/hsh/layouts/_default/_markup/render-heading.html
+++ b/website/themes/hsh/layouts/_default/_markup/render-heading.html
@@ -1,6 +1,11 @@
-
+
+
{{ .Text | safeHTML }}
+
+
+
+
{{ if eq .Text ""}}
-
+
{{ end }}
diff --git a/website/themes/hsh/layouts/partials/head.html b/website/themes/hsh/layouts/partials/head.html
index 3556074..fca4558 100644
--- a/website/themes/hsh/layouts/partials/head.html
+++ b/website/themes/hsh/layouts/partials/head.html
@@ -1,7 +1,7 @@
{{ $title := print .Title " — " .Site.Title }}
- {{ if .IsHome }}{{ $title = .Site.Title }}{{ end }}
- {{ $title }}
+ {{ if .IsHome }}{{ $title = .Site.Title }}{{ end }}
+ {{ $title }}
@@ -23,4 +23,16 @@
+
+
From 71d23a4727c1c8619062c748932552576d0ef9d4 Mon Sep 17 00:00:00 2001
From: sammyette
Date: Wed, 18 Jan 2023 06:40:58 -0400
Subject: [PATCH 094/119] chore: remove hugo lock
---
.hugo_build.lock | 0
1 file changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 .hugo_build.lock
diff --git a/.hugo_build.lock b/.hugo_build.lock
deleted file mode 100644
index e69de29..0000000
From 8d20ad9eed72434da39b47c34e6e396c5137bb20 Mon Sep 17 00:00:00 2001
From: sammyette
Date: Wed, 18 Jan 2023 06:52:22 -0400
Subject: [PATCH 095/119] fix: make hilbish.which work properly with aliases
---
CHANGELOG.md | 3 +++
api.go | 5 ++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6645d80..2db665b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,9 @@
- Documented custom userdata types (Job and Timer Objects)
- Coming with fix is also adding the return types for some functions that were missing it
+### Fixed
+- `hilbish.which` not working correctly with aliases
+
## [2.0.1] - 2022-12-28
### Fixed
- Corrected documentation for hooks, removing outdated `command.no-perm`
diff --git a/api.go b/api.go
index d5a3fa4..3920e6f 100644
--- a/api.go
+++ b/api.go
@@ -551,7 +551,10 @@ func hlwhich(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
return nil, err
}
- cmd := aliases.Resolve(name)
+ // itll return either the original command or what was passed
+ // if name isnt empty its not an issue
+ alias := aliases.Resolve(name)
+ cmd := strings.Split(alias, " ")[0]
// check for commander
if commands[cmd] != nil {
From 5bb6ba4aee0704ea0b9ab2aaac7b799e6e5a9ff8 Mon Sep 17 00:00:00 2001
From: sammyette
Date: Wed, 18 Jan 2023 06:58:47 -0400
Subject: [PATCH 096/119] docs: mark job.stop function as member
---
job.go | 1 +
1 file changed, 1 insertion(+)
diff --git a/job.go b/job.go
index bdff770..a933016 100644
--- a/job.go
+++ b/job.go
@@ -144,6 +144,7 @@ func luaStartJob(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
}
// #interface jobs
+// #member
// stop()
// Stops the job from running.
func luaStopJob(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
From c87fbe2b99c2e7bc65fc09b99639e3558a9ce0a6 Mon Sep 17 00:00:00 2001
From: TorchedSammy
Date: Wed, 18 Jan 2023 10:59:10 +0000
Subject: [PATCH 097/119] docs: [ci] generate new docs
---
docs/api/hilbish/hilbish.jobs.md | 6 +++---
emmyLuaDocs/hilbish.lua | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/api/hilbish/hilbish.jobs.md b/docs/api/hilbish/hilbish.jobs.md
index b36b748..e41be2c 100644
--- a/docs/api/hilbish/hilbish.jobs.md
+++ b/docs/api/hilbish/hilbish.jobs.md
@@ -15,9 +15,6 @@ Jobs are the name of background tasks/commands. A job can be started via
interactive usage or with the functions defined below for use in external runners.
## Functions
-### stop()
-Stops the job from running.
-
### add(cmdstr, args, execPath)
Adds a new job to the job table. Note that this does not immediately run it.
@@ -56,3 +53,6 @@ executed normally and wait for it to complete.
#### start()
Starts running the job.
+#### stop()
+Stops the job from running.
+
diff --git a/emmyLuaDocs/hilbish.lua b/emmyLuaDocs/hilbish.lua
index 81a9e6d..24588bd 100644
--- a/emmyLuaDocs/hilbish.lua
+++ b/emmyLuaDocs/hilbish.lua
@@ -183,7 +183,7 @@ function hilbish.runner.lua(cmd) end
function hilbish.jobs:start() end
--- Stops the job from running.
-function hilbish.jobs.stop() end
+function hilbish.jobs:stop() end
--- Runs a command in Hilbish's shell script interpreter.
--- This is the equivalent of using `source`.
From 088e326bd17cc4c8365b88b3a5ad060161012ca2 Mon Sep 17 00:00:00 2001
From: sammyette
Date: Fri, 20 Jan 2023 18:43:46 -0400
Subject: [PATCH 098/119] fix(commands/doc): properly block out index doc
---
nature/commands/doc.lua | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/nature/commands/doc.lua b/nature/commands/doc.lua
index f15ab8e..379b364 100644
--- a/nature/commands/doc.lua
+++ b/nature/commands/doc.lua
@@ -53,11 +53,11 @@ Available sections: ]] .. table.concat(modules, ', ')
end
end
funcdocs = f:read '*a':gsub('-([%d]+)', '%1')
- local moddocs = table.filter(fs.readdir(moddocPath), function(f) return f ~= '_index.md' or f ~= 'index.md' end)
+ local moddocs = table.filter(fs.readdir(moddocPath), function(f) return f ~= '_index.md' and f ~= 'index.md' end)
local subdocs = table.map(moddocs, function(fname)
return lunacolors.underline(lunacolors.blue(string.gsub(fname, '.md', '')))
end)
- if subdocName == '_index' then
+ if #moddocs ~= 0 then
funcdocs = funcdocs .. '\nSubdocs: ' .. table.concat(subdocs, ', ')
end
From 2f6ab5fd92e77d46ec953bdcc39a7f7bd99536e0 Mon Sep 17 00:00:00 2001
From: sammyette
Date: Fri, 20 Jan 2023 19:07:42 -0400
Subject: [PATCH 099/119] feat: add sink for commanders to write output/read
input (#232)
to write output, you would usually just use the print builtin
since commanders are just lua custom commands but this does not
consider the fact of pipes or other shell operators being used
to redirect or whatever.
this adds readable/writable "sinks" which is a type for input
or output and is currently only used for commanders but can be
used for other hilbish things in the future
---
CHANGELOG.md | 2 +
cmd/docgen/docgen.go | 12 ++--
docs/api/commander.md | 34 ++++++++++
exec.go | 13 +++-
golibs/commander/commander.go | 37 ++++++++++-
lua.go | 1 +
nature/commands/bg.lua | 6 +-
nature/commands/cat.lua | 8 +--
nature/commands/cd.lua | 8 +--
nature/commands/cdr.lua | 12 ++--
nature/commands/disown.lua | 8 +--
nature/commands/doc.lua | 6 +-
nature/commands/fg.lua | 6 +-
sink.go | 121 ++++++++++++++++++++++++++++++++++
14 files changed, 240 insertions(+), 34 deletions(-)
create mode 100644 sink.go
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2db665b..4c02f04 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,9 +4,11 @@
### Added
- Documented custom userdata types (Job and Timer Objects)
- Coming with fix is also adding the return types for some functions that were missing it
+- Added a dedicated input and dedicated outputs for commanders.
### Fixed
- `hilbish.which` not working correctly with aliases
+- Commanders not being able to pipe with commands or any related operator.
## [2.0.1] - 2022-12-28
### Fixed
diff --git a/cmd/docgen/docgen.go b/cmd/docgen/docgen.go
index faa7845..c176676 100644
--- a/cmd/docgen/docgen.go
+++ b/cmd/docgen/docgen.go
@@ -414,7 +414,14 @@ func main() {
f, _ := os.Create(docPath)
f.WriteString(fmt.Sprintf(header, modOrIface, modname, modu.ShortDescription))
- f.WriteString(fmt.Sprintf("## Introduction\n%s\n\n", modu.Description))
+ typeTag, _ := regexp.Compile(`@\w+`)
+ modDescription := typeTag.ReplaceAllStringFunc(strings.Replace(modu.Description, "<", `\<`, -1), func(typ string) string {
+ typName := typ[1:]
+ typLookup := typeTable[strings.ToLower(typName)]
+ linkedTyp := fmt.Sprintf("/Hilbish/docs/api/%s/%s/#%s", typLookup[0], typLookup[0] + "." + typLookup[1], strings.ToLower(typName))
+ return fmt.Sprintf(`%s `, linkedTyp, typName)
+ })
+ f.WriteString(fmt.Sprintf("## Introduction\n%s\n\n", modDescription))
if len(modu.Fields) != 0 {
f.WriteString("## Interface fields\n")
for _, dps := range modu.Fields {
@@ -435,7 +442,6 @@ func main() {
}
if len(modu.Docs) != 0 {
- typeTag, _ := regexp.Compile(`@\w+`)
f.WriteString("## Functions\n")
for _, dps := range modu.Docs {
if dps.IsMember {
@@ -475,8 +481,6 @@ func main() {
}
}
f.WriteString("\n")
- typeTag, _ := regexp.Compile(`@\w+`)
-
f.WriteString("### Methods\n")
for _, dps := range modu.Docs {
if !dps.IsMember {
diff --git a/docs/api/commander.md b/docs/api/commander.md
index e3e5320..a23dcb1 100644
--- a/docs/api/commander.md
+++ b/docs/api/commander.md
@@ -8,7 +8,41 @@ menu:
---
## Introduction
+
Commander is a library for writing custom commands in Lua.
+In order to make it easier to write commands for Hilbish,
+not require separate scripts and to be able to use in a config,
+the Commander library exists. This is like a very simple wrapper
+that works with Hilbish for writing commands. Example:
+
+```lua
+local commander = require 'commander'
+
+commander.register('hello', function(args, sinks)
+ sinks.out:writeln 'Hello world!'
+end)
+```
+
+In this example, a command with the name of `hello` is created
+that will print `Hello world!` to output. One question you may
+have is: What is the `sinks` parameter?
+
+A sink is a writable/readable pipe, or you can imagine a Lua
+file. It's used in this case to write to the proper output,
+incase a user either pipes to another command or redirects somewhere else.
+
+So, the `sinks` parameter is a table containing 3 sinks:
+`in`, `out`, and `err`.
+- `in` is the standard input. You can read from this sink
+to get user input. (**This is currently unimplemented.**)
+- `out` is standard output. This is usually where text meant for
+output should go.
+- `err` is standard error. This sink is for writing errors, as the
+name would suggest.
+
+A sink has 2 methods:
+- `write(str)` will write to the sink.
+- `writeln(str)` will write to the sink with a newline at the end.
## Functions
### deregister(name)
diff --git a/exec.go b/exec.go
index e18cdd6..726a986 100644
--- a/exec.go
+++ b/exec.go
@@ -323,8 +323,18 @@ func execHandle(bg bool) interp.ExecHandlerFunc {
luacmdArgs.Set(rt.IntValue(int64(i + 1)), rt.StringValue(str))
}
+ hc := interp.HandlerCtx(ctx)
if commands[args[0]] != nil {
- luaexitcode, err := rt.Call1(l.MainThread(), rt.FunctionValue(commands[args[0]]), rt.TableValue(luacmdArgs))
+ stdin := newSinkInput(hc.Stdin)
+ stdout := newSinkOutput(hc.Stdout)
+ stderr := newSinkOutput(hc.Stderr)
+
+ sinks := rt.NewTable()
+ sinks.Set(rt.StringValue("in"), rt.UserDataValue(stdin.ud))
+ sinks.Set(rt.StringValue("out"), rt.UserDataValue(stdout.ud))
+ sinks.Set(rt.StringValue("err"), rt.UserDataValue(stderr.ud))
+
+ luaexitcode, err := rt.Call1(l.MainThread(), rt.FunctionValue(commands[args[0]]), rt.TableValue(luacmdArgs), rt.TableValue(sinks))
if err != nil {
fmt.Fprintln(os.Stderr, "Error in command:\n" + err.Error())
return interp.NewExitStatus(1)
@@ -364,7 +374,6 @@ func execHandle(bg bool) interp.ExecHandlerFunc {
killTimeout := 2 * time.Second
// from here is basically copy-paste of the default exec handler from
// sh/interp but with our job handling
- hc := interp.HandlerCtx(ctx)
path, err := interp.LookPathDir(hc.Dir, hc.Env, args[0])
if err != nil {
fmt.Fprintln(hc.Stderr, err)
diff --git a/golibs/commander/commander.go b/golibs/commander/commander.go
index e1e8a95..f67e9b8 100644
--- a/golibs/commander/commander.go
+++ b/golibs/commander/commander.go
@@ -1,5 +1,40 @@
// library for custom commands
-// Commander is a library for writing custom commands in Lua.
+/*
+Commander is a library for writing custom commands in Lua.
+In order to make it easier to write commands for Hilbish,
+not require separate scripts and to be able to use in a config,
+the Commander library exists. This is like a very simple wrapper
+that works with Hilbish for writing commands. Example:
+
+```lua
+local commander = require 'commander'
+
+commander.register('hello', function(args, sinks)
+ sinks.out:writeln 'Hello world!'
+end)
+```
+
+In this example, a command with the name of `hello` is created
+that will print `Hello world!` to output. One question you may
+have is: What is the `sinks` parameter?
+
+A sink is a writable/readable pipe, or you can imagine a Lua
+file. It's used in this case to write to the proper output,
+incase a user either pipes to another command or redirects somewhere else.
+
+So, the `sinks` parameter is a table containing 3 sinks:
+`in`, `out`, and `err`.
+- `in` is the standard input. You can read from this sink
+to get user input. (**This is currently unimplemented.**)
+- `out` is standard output. This is usually where text meant for
+output should go.
+- `err` is standard error. This sink is for writing errors, as the
+name would suggest.
+
+A sink has 2 methods:
+- `write(str)` will write to the sink.
+- `writeln(str)` will write to the sink with a newline at the end.
+*/
package commander
import (
diff --git a/lua.go b/lua.go
index 79eb1f7..0a7c115 100644
--- a/lua.go
+++ b/lua.go
@@ -23,6 +23,7 @@ func luaInit() {
MessageHandler: debuglib.Traceback,
})
lib.LoadAll(l)
+ setupSinkType(l)
lib.LoadLibs(l, hilbishLoader)
// yes this is stupid, i know
diff --git a/nature/commands/bg.lua b/nature/commands/bg.lua
index f0aa462..a7f486a 100644
--- a/nature/commands/bg.lua
+++ b/nature/commands/bg.lua
@@ -1,15 +1,15 @@
local commander = require 'commander'
-commander.register('bg', function()
+commander.register('bg', function(_, sinks)
local job = hilbish.jobs.last()
if not job then
- print 'bg: no last job'
+ sinks.out:writeln 'bg: no last job'
return 1
end
local err = job.background()
if err then
- print('bg: ' .. err)
+ sinks.out:writeln('bg: ' .. err)
return 2
end
end)
diff --git a/nature/commands/cat.lua b/nature/commands/cat.lua
index 132db5f..06df507 100644
--- a/nature/commands/cat.lua
+++ b/nature/commands/cat.lua
@@ -1,11 +1,11 @@
local commander = require 'commander'
local fs = require 'fs'
-commander.register('cat', function(args)
+commander.register('cat', function(args, sinks)
local exit = 0
if #args == 0 then
- print [[
+ sinks.out:writeln [[
usage: cat [file]...]]
end
@@ -13,11 +13,11 @@ usage: cat [file]...]]
local f = io.open(fName)
if f == nil then
exit = 1
- print(string.format('cat: %s: no such file or directory', fName))
+ sinks.out:writeln(string.format('cat: %s: no such file or directory', fName))
goto continue
end
- io.write(f:read '*a')
+ sinks.out:writeln(f:read '*a')
::continue::
end
io.flush()
diff --git a/nature/commands/cd.lua b/nature/commands/cd.lua
index 8c8dbc8..7cfe4a2 100644
--- a/nature/commands/cd.lua
+++ b/nature/commands/cd.lua
@@ -4,16 +4,16 @@ local fs = require 'fs'
local dirs = require 'nature.dirs'
dirs.old = hilbish.cwd()
-commander.register('cd', function (args)
+commander.register('cd', function (args, sinks)
if #args > 1 then
- print("cd: too many arguments")
+ sinks.out:writeln("cd: too many arguments")
return 1
end
local path = args[1] and args[1] or hilbish.home
if path == '-' then
path = dirs.old
- print(path)
+ sinks.out:writeln(path)
end
dirs.setOld(hilbish.cwd())
@@ -21,7 +21,7 @@ commander.register('cd', function (args)
local ok, err = pcall(function() fs.cd(path) end)
if not ok then
- print(err)
+ sinks.out:writeln(err)
return 1
end
bait.throw('cd', path)
diff --git a/nature/commands/cdr.lua b/nature/commands/cdr.lua
index 0438e6f..288ae22 100644
--- a/nature/commands/cdr.lua
+++ b/nature/commands/cdr.lua
@@ -3,9 +3,9 @@ local fs = require 'fs'
local lunacolors = require 'lunacolors'
local dirs = require 'nature.dirs'
-commander.register('cdr', function(args)
+commander.register('cdr', function(args, sinks)
if not args[1] then
- print(lunacolors.format [[
+ sinks.out:writeln(lunacolors.format [[
cdr: change directory to one which has been recently visied
usage: cdr
@@ -17,21 +17,21 @@ to get a list of recent directories, use {green}{underline}cdr list{reset}]])
if args[1] == 'list' then
local recentDirs = dirs.recentDirs
if #recentDirs == 0 then
- print 'No directories have been visited.'
+ sinks.out:writeln 'No directories have been visited.'
return 1
end
- print(table.concat(recentDirs, '\n'))
+ sinks.out:writeln(table.concat(recentDirs, '\n'))
return
end
local index = tonumber(args[1])
if not index then
- print(string.format('Received %s as index, which isn\'t a number.', index))
+ sinks.out:writeln(string.format('Received %s as index, which isn\'t a number.', index))
return 1
end
if not dirs.recent(index) then
- print(string.format('No recent directory found at index %s.', index))
+ sinks.out:writeln(string.format('No recent directory found at index %s.', index))
return 1
end
diff --git a/nature/commands/disown.lua b/nature/commands/disown.lua
index f8f144f..6645a0f 100644
--- a/nature/commands/disown.lua
+++ b/nature/commands/disown.lua
@@ -1,8 +1,8 @@
local commander = require 'commander'
-commander.register('disown', function(args)
+commander.register('disown', function(args, sinks)
if #hilbish.jobs.all() == 0 then
- print 'disown: no current job'
+ sinks.out:writeln 'disown: no current job'
return 1
end
@@ -10,7 +10,7 @@ commander.register('disown', function(args)
if #args < 0 then
id = tonumber(args[1])
if not id then
- print 'disown: invalid id for job'
+ sinks.out:writeln 'disown: invalid id for job'
return 1
end
else
@@ -19,7 +19,7 @@ commander.register('disown', function(args)
local ok = pcall(hilbish.jobs.disown, id)
if not ok then
- print 'disown: job does not exist'
+ sinks.out:writeln 'disown: job does not exist'
return 2
end
end)
diff --git a/nature/commands/doc.lua b/nature/commands/doc.lua
index 379b364..5d03823 100644
--- a/nature/commands/doc.lua
+++ b/nature/commands/doc.lua
@@ -2,7 +2,7 @@ local commander = require 'commander'
local fs = require 'fs'
local lunacolors = require 'lunacolors'
-commander.register('doc', function(args)
+commander.register('doc', function(args, sinks)
local moddocPath = hilbish.dataDir .. '/docs/'
local stat = fs.stat '.git/refs/heads/extended-job-api'
if stat then
@@ -48,7 +48,7 @@ Available sections: ]] .. table.concat(modules, ', ')
f = io.open(moddocPath .. subdocName .. '.md', 'rb')
end
if not f then
- print('No documentation found for ' .. mod .. '.')
+ sinks.out:writeln('No documentation found for ' .. mod .. '.')
return 1
end
end
@@ -86,7 +86,7 @@ Available sections: ]] .. table.concat(modules, ', ')
end
local backtickOccurence = 0
- print(lunacolors.format(doc:gsub('`', function()
+ sinks.out:writeln(lunacolors.format(doc:gsub('`', function()
backtickOccurence = backtickOccurence + 1
if backtickOccurence % 2 == 0 then
return '{reset}'
diff --git a/nature/commands/fg.lua b/nature/commands/fg.lua
index a3f1451..64b145f 100644
--- a/nature/commands/fg.lua
+++ b/nature/commands/fg.lua
@@ -1,15 +1,15 @@
local commander = require 'commander'
-commander.register('fg', function()
+commander.register('fg', function(_, sinks)
local job = hilbish.jobs.last()
if not job then
- print 'fg: no last job'
+ sinks.out:writeln 'fg: no last job'
return 1
end
local err = job.foreground() -- waits for job; blocks
if err then
- print('fg: ' .. err)
+ sinks.out:writeln('fg: ' .. err)
return 2
end
end)
diff --git a/sink.go b/sink.go
new file mode 100644
index 0000000..54f5014
--- /dev/null
+++ b/sink.go
@@ -0,0 +1,121 @@
+package main
+
+import (
+ "fmt"
+ "io"
+
+ "hilbish/util"
+
+ rt "github.com/arnodel/golua/runtime"
+)
+
+var sinkMetaKey = rt.StringValue("hshsink")
+
+// a sink is a structure that has input and/or output
+// it is like a lua file when used in popen, but specific to hilbish
+type sink struct{
+ writer io.Writer
+ reader io.Reader
+ ud *rt.UserData
+}
+
+func setupSinkType(rtm *rt.Runtime) {
+ sinkMeta := rt.NewTable()
+
+ sinkMethods := rt.NewTable()
+ sinkFuncs := map[string]util.LuaExport{
+ "write": {luaSinkWrite, 2, false},
+ "writeln": {luaSinkWriteln, 2, false},
+ }
+ util.SetExports(l, sinkMethods, sinkFuncs)
+
+ sinkIndex := func(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
+ arg := c.Arg(1)
+ val := sinkMethods.Get(arg)
+
+ return c.PushingNext1(t.Runtime, val), nil
+ }
+
+ sinkMeta.Set(rt.StringValue("__index"), rt.FunctionValue(rt.NewGoFunction(sinkIndex, "__index", 2, false)))
+ l.SetRegistry(sinkMetaKey, rt.TableValue(sinkMeta))
+}
+
+func luaSinkWrite(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
+ if err := c.CheckNArgs(2); err != nil {
+ return nil, err
+ }
+
+ s, err := sinkArg(c, 0)
+ if err != nil {
+ return nil, err
+ }
+ data, err := c.StringArg(1)
+ if err != nil {
+ return nil, err
+ }
+
+ s.writer.Write([]byte(data))
+
+ return c.Next(), nil
+}
+
+func luaSinkWriteln(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
+ if err := c.CheckNArgs(2); err != nil {
+ return nil, err
+ }
+
+ s, err := sinkArg(c, 0)
+ if err != nil {
+ return nil, err
+ }
+ data, err := c.StringArg(1)
+ if err != nil {
+ return nil, err
+ }
+
+ s.writer.Write([]byte(data + "\n"))
+
+ return c.Next(), nil
+}
+
+func newSinkInput(r io.Reader) *sink {
+ s := &sink{
+ reader: r,
+ }
+ s.ud = sinkUserData(s)
+
+ return s
+}
+
+func newSinkOutput(w io.Writer) *sink {
+ s := &sink{
+ writer: w,
+ }
+ s.ud = sinkUserData(s)
+
+ return s
+}
+
+func sinkArg(c *rt.GoCont, arg int) (*sink, error) {
+ s, ok := valueToSink(c.Arg(arg))
+ if !ok {
+ return nil, fmt.Errorf("#%d must be a sink", arg + 1)
+ }
+
+ return s, nil
+}
+
+func valueToSink(val rt.Value) (*sink, bool) {
+ u, ok := val.TryUserData()
+ if !ok {
+ return nil, false
+ }
+
+ s, ok := u.Value().(*sink)
+ return s, ok
+}
+
+func sinkUserData(s *sink) *rt.UserData {
+ sinkMeta := l.Registry(sinkMetaKey)
+ return rt.NewUserData(s, sinkMeta.AsTable())
+}
From f97a04179de41bdaa7586178f1ebae5bf10959c9 Mon Sep 17 00:00:00 2001
From: sammyette
Date: Fri, 20 Jan 2023 19:35:33 -0400
Subject: [PATCH 100/119] chore: update license
---
LICENSE | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/LICENSE b/LICENSE
index da3c8c1..3d8f013 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2022 Rosettea
+Copyright (c) 2021-2023 Rosettea
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
From e2cf41714468731382e8ac0b5e272babd3e69924 Mon Sep 17 00:00:00 2001
From: sammyette
Date: Wed, 1 Feb 2023 19:56:27 -0400
Subject: [PATCH 101/119] fix: initialize lua api before handling signals
(fixes #236)
---
main.go | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/main.go b/main.go
index 1b5e6b8..4fa321c 100644
--- a/main.go
+++ b/main.go
@@ -115,9 +115,11 @@ func main() {
os.Setenv("SHELL", os.Args[0])
}
- go handleSignals()
lr = newLineReader("", false)
luaInit()
+
+ go handleSignals()
+
// If user's config doesn't exixt,
if _, err := os.Stat(defaultConfPath); os.IsNotExist(err) && *configflag == defaultConfPath {
// Read default from current directory
From cdd07a498195f7eb40148e7da455a4fbc1dd8ea1 Mon Sep 17 00:00:00 2001
From: sammyette