Zxc
zxc allows you to quickly perform a few common opperations on STDIN, for example:
echo $PATH | zxc split : split / present print
The command chain above will
- get the list of directories in your
$PATH
, - split it into a list, using ":" as a delimiter,
- split each element of said list into a sublist, using "/" as a delimiter,
- remove empty elements,
- print every element of every sublist.
This works by generating a tree, where each node contains text, and exposing "steps" to the user, which are procedures over said tree, In the example above, "split", "present" and "print" are steps, the first one taking arguments.
Use zxc -H
to read a manual listing available steps.
Installation
Install the gem and add to the application's Gemfile by executing:
bundle add zxc
If bundler is not being used to manage dependencies, install the gem by executing:
gem install zxc
Usage
zxc [OPTIONS] [STEP [ARG]...]...
zxc reads text from STDIN, converts it into the root node of a tree, and applies operations (steps) onto said tree.
Options
- -h , --help: Displays a short help message and exits
- -H ", --Help: Displays this page and exits
License
The gem is available as open source under the terms of the MIT License.