From 61a301078201352264c2d33cd661ccf76beecb16 Mon Sep 17 00:00:00 2001 From: Noah Graff Date: Wed, 16 Oct 2019 06:33:17 -0400 Subject: [PATCH] initial commit --- .gitignore | 8 ++++++++ LICENSE | 20 ++++++++++++++++++++ README.md | 38 ++++++++++++++++++++++++++++++++++++++ build.zig | 14 ++++++++++++++ src/main.zig | 8 ++++++++ 5 files changed, 88 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 build.zig create mode 100644 src/main.zig diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..37e1f38 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +* +!.gitignore +!README.md +!LICENSE +!*/ +!*.zig +!src/* + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..40f29e3 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +Copyright © 2019 ntgg + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/README.md b/README.md new file mode 100644 index 0000000..aabf820 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# zosh + +zosh is a minimal +[POSIX](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html) +shell. It's goals are to be exactly POSIX compliant, simple, and readable. + +This a work in progress. + +## Build + +The only dependency is [Zig](https://ziglang.org/). The Zig compiler version +last tested is: 0.5.0+8b4592166 + +Build: + +``` +zig build +``` + +Build and run: + +``` +zig build run +``` + +## Contributing + +You can submit bugs and TODO here: [~ntgg/zosh](https://todo.sr.ht/~ntgg/zosh). + +Please send patches to +[~ntgg/zosh-dev@lists.sr.ht](https://lists.sr.ht/~ntgg/zosh-dev). + +For help with sending patches over email, see +[here](https://git-send-email.io/). + +## License + +MIT diff --git a/build.zig b/build.zig new file mode 100644 index 0000000..444c4cf --- /dev/null +++ b/build.zig @@ -0,0 +1,14 @@ +const Builder = @import("std").build.Builder; + +pub fn build(b: *Builder) void { + const mode = b.standardReleaseOptions(); + const exe = b.addExecutable("zosh", "src/main.zig"); + exe.setBuildMode(mode); + exe.install(); + + const run_cmd = exe.run(); + run_cmd.step.dependOn(b.getInstallStep()); + + const run_step = b.step("run", "Run the app"); + run_step.dependOn(&run_cmd.step); +} diff --git a/src/main.zig b/src/main.zig new file mode 100644 index 0000000..da8bbf7 --- /dev/null +++ b/src/main.zig @@ -0,0 +1,8 @@ +const std = @import("std"); +const Token = @import("token.zig").Token; +const tokenize = @import("token.zig").tokenize; + +pub fn main() void { + std.debug.warn("All your base are belong to us.\n"); +} + -- 2.45.2