Coder Social home page Coder Social logo

zig-embshell's Introduction

zig-embshell

Toby Jaffey https://mastodon.me.uk/@tobyjaffey

A small interactive command line for Zig programs.

Every microcontroller project I do ends up with a command shell on the UART. This is an implementation of a similar system in zig.

Note: zig-embshell is my first ever program in zig. For me, it's a learning exercise.

Running

Developed with zig 0.11.0-dev.1457+cb9d00e1a

zig build run

Adding commands

Edit src/cmds.zig

Each handler is registered in cmdTable which is const and constructed at comptime. Every handler is passed argc (the number of arguments) and an argv array. argv[0] is the command name, the arguments follow.

Features

  • Basic tab completion (command names only)
  • Backspace for basic line editing

Aims

  • Learn some zig
  • Be reasonably readable
  • Target a tiny system with no heap
  • Keep term.zig small and portable

Non-Aims

  • Don't be readline/linenoise (no history, nothing fancy)
  • No live adding of new commands, everything compiled in

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.