Compare commits

...

3 Commits

Author SHA1 Message Date
TorchedSammy 6ffcc498ac
docs: update changelog for rc 2022-10-14 19:25:18 -04:00
TorchedSammy fe47c6c7a1
chore: change version to rc1 2022-10-14 19:16:24 -04:00
sammy 0d32a10ca3
feat: add builtins clear, exec and cat (#208)
* feat: add clear and exec command

* docs: add builtins to changelog

* feat: add cat command
2022-10-14 19:15:40 -04:00
5 changed files with 46 additions and 1 deletions

View File

@ -75,6 +75,7 @@ disables commands being added to history.
- A new and "safer" event emitter has been added. This causes a performance deficit, but avoids a lot of - A new and "safer" event emitter has been added. This causes a performance deficit, but avoids a lot of
random errors introduced with the new Lua runtime (see [#197]) random errors introduced with the new Lua runtime (see [#197])
- `bait.release(name, catcher)` removes `handler` for the named `event` - `bait.release(name, catcher)` removes `handler` for the named `event`
- `exec`, `clear` and `cat` builtin commands
[#197]: https://github.com/Rosettea/Hilbish/issues/197 [#197]: https://github.com/Rosettea/Hilbish/issues/197
@ -151,6 +152,11 @@ an error of missing format variable
- Prompt now works with east asian characters (CJK) - Prompt now works with east asian characters (CJK)
- Set back the prompt to normal after exiting the continue prompt with ctrl-d - Set back the prompt to normal after exiting the continue prompt with ctrl-d
## [2.0.0-rc1] - 2022-09-14
This is a pre-release version of Hilbish for testing. To see the changelog,
refer to the `Unreleased` section of the [full changelog](CHANGELOG.md)
(version 2.0.0 for future reference).
## [1.2.0] - 2022-03-17 ## [1.2.0] - 2022-03-17
### Added ### Added
- Job Management additions - Job Management additions
@ -574,6 +580,8 @@ This input for example will prompt for more input to complete:
First "stable" release of Hilbish. First "stable" release of Hilbish.
[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
[1.1.0]: https://github.com/Rosettea/Hilbish/compare/v1.0.4...v1.1.0 [1.1.0]: https://github.com/Rosettea/Hilbish/compare/v1.0.4...v1.1.0
[1.0.4]: https://github.com/Rosettea/Hilbish/compare/v1.0.3...v1.0.4 [1.0.4]: https://github.com/Rosettea/Hilbish/compare/v1.0.3...v1.0.4
[1.0.3]: https://github.com/Rosettea/Hilbish/compare/v1.0.2...v1.0.3 [1.0.3]: https://github.com/Rosettea/Hilbish/compare/v1.0.2...v1.0.3

View File

@ -0,0 +1,25 @@
local commander = require 'commander'
local fs = require 'fs'
commander.register('cat', function(args)
local exit = 0
if #args == 0 then
print [[
usage: cat [file]...]]
end
for _, fName in ipairs(args) do
local f = io.open(fName)
if f == nil then
exit = 1
print(string.format('cat: %s: no such file or directory', fName))
goto continue
end
io.write(f:read '*a')
::continue::
end
io.flush()
return exit
end)

View File

@ -0,0 +1,7 @@
local ansikit = require 'ansikit'
local commander = require 'commander'
commander.register('clear', function()
ansikit.clear(true)
ansikit.cursorTo(0, 0)
end)

View File

@ -0,0 +1,5 @@
local commander = require 'commander'
commander.register('exec', function(args)
hilbish.exec(args[1])
end)

View File

@ -11,7 +11,7 @@ var (
// Version info // Version info
var ( var (
ver = "v2.0.0" ver = "v2.0.0-rc1"
releaseName = "Hibiscus" releaseName = "Hibiscus"
gitCommit string gitCommit string
gitBranch string gitBranch string