trsh-rs

Crates.iotrsh-rs
lib.rstrsh-rs
version0.0.2
created_at2025-03-29 14:17:51.022554+00
updated_at2025-04-02 01:41:15.54185+00
descriptionAttempt to create a posix shell in rust
homepagehttps://github.com/chazfg/trsh
repositoryhttps://github.com/chazfg/trsh
max_upload_size
id1611340
size65,564
(chazfg)

documentation

README

Trsh

its uh.. its a rust shell

todo: aliases variable expansion .trshrc redirection pipelines

trsh Development Roadmap

For most of these, take them as a very loose interpretation of "Complete". Until I start digging into phase 5 I don't think I'll worry much about complete end to end testing. So it's mostly just "This works for a few of the commands I tried with it"

Phase 1: Core (done or nearly done)

  • REPL w/ prompt
  • Command parsing
  • Builtin detection
  • Builtins: cd, pwd, alias, unalias, export, unset, exit
  • SIMPLE .trshrc support
  • -c [script_file]

Phase 2: (Simple) Execution Semantics + (Simple) Control Flow

  • Append (Redirection): >>
  • Truncate (Redirection): >
  • HereDoc (Redirection): <<
  • Input (Redirection): <
  • Pipes
  • Command Sequencing
  • Conditionals (if, then, else, fi)
  • Conditionals (with test/ [)
  • Logic: Ands (&&), ors (||)

Phase 3: Shell Language Features

  • Variable Expansion $VAR
  • loops (while, for)
  • Command Sub $(...)
  • Comprehensive Quote Handling

Phase 4: POSIX Compatibility & Testability

  • arithmetic sub $((...))
  • Incorporate POSIX compat testing
  • Start polish/comprehensive testing
  • Ensure correctness of exit codes
  • Script-local scoping
  • History and Job Control

Phase 5: Stretch

  • functions
  • grouping
  • $1 things for function args
  • subshells
  • i/o redir w/ FD
  • !, history, things like that
  • plugins?
Commit count: 15

cargo fmt