rust_cmd_lib

Common rust command-line macros and utilities, to write shell-script like tasks in a clean, natural and rusty way

APACHE-2.0 License

Downloads
917.3K
Stars
1K
Committers
6

Bot releases are visible (Hide)

rust_cmd_lib - v1.0.10 Latest Release

Published by tao-guo over 3 years ago

Major Changes

  • update CmdStdio APIs, use stdin(), stdout(), stderr() to get Reader/Writer for builtin/custom commands
  • process internal: move most of the runtime information from Cmds to Cmd.
  • freeze APIs and update docs for 1.0 release
  • enable logging support
  • log error messages when running command fails
  • capture all messages on stderr into logs
  • fix builtin command stderr redirection
  • report cd command error
  • try to capture all stdout/stderr messages if they are redirected to file
  • support "|&"
  • removed "log" crate dependency for end users
  • add checks for multiple redirections for the same input/output #21
  • spawn a separate thread for builtin/custom pipe-out threads to solve the pipe-full issue #22
rust_cmd_lib - v0.14.6

Published by tao-guo over 3 years ago

Major changes

  • Use cmd_die!() to replace die!() macro, which is more consistent for string interpolation within this library
  • Add cmd_info!() macro to print messages conveniently
  • Add basic redirection support for builtin/custom commands
  • Update command registration API
  • Change buf from String to Vec in CmdStdio struct
  • Fix parsing escape characters
  • Refactor lexer code to move iteration related information into a separate TokenStreamPeekable struct
  • Support io input for builtin/custom commands, and add builtin cat as an example
  • Support null command, like: run_cmd!(>/tmp/output)
  • Print number literals without converting to actual value: run_cmd!(echo 0xff) will print "0xff" instead of "255".
  • Make sure the children processes always being waited, even when the last command fails
  • Don't panic process when there is any IO errors
rust_cmd_lib - v0.12.6

Published by tao-guo over 3 years ago

Changes

  • Refactored lexer code, to do forward scanning if possible
  • Fixed run_fun! bug to make sure redirection always work
  • Added cmd_info!() macro to print messages conveniently
  • Make unit tests cases more robust
rust_cmd_lib - v0.12.5

Published by tao-guo over 3 years ago

Changes

  • fixed command redirections, support &>> format and fail a bunch of invalid formats
rust_cmd_lib - v0.12.4

Published by tao-guo over 3 years ago

Changes

  • Better debugging support
  • Show more details about running commands
rust_cmd_lib - v0.12.3

Published by tao-guo over 3 years ago

Changes

  • Fixed cd bugs to make sure later commands always use the previous settings in the same command group
  • Update dd_test example to use structopt and rayon crates to simply the code
  • Clean up ownership in process APIs, and try not to take any ownership
  • Change CMD_MAP back to lazy_static! to make sure it works in multi-thread environment
  • Add github ci workflow
rust_cmd_lib - v0.12.0

Published by rust-shell-script over 3 years ago

Major Changes

  • No more runtime lexing and arguments parsing, do lexing and parsing completely at compile time
  • No more runtime package dependency except std
  • No more unsafe function calls
  • Removed APIs which could lead to exploitable code

API Changes

Tests and Examples

Misc

  • A bunch of code clean up, including eliminating duplicated code and unnecessary APIs
Package Rankings
Top 4.35% on Crates.io
Badges
Extracted from project README
Build status Crates.io