Argument execute is xargs alternative that focus on arguments processing and ordering.
This tool is still under heavy development
Table of Contents
Features
Placing arguments in defined order
|
output: baz bar foo
Processing input as data series
|
output:
a b c
d e f
Explanation: Each new line is treated as a data entry. Echo command will be run for each line. This is equal to calling
Arguments splitting for individual arguments
|
output: this is file name 'lord_of_the_rings' and this is file extension 'txt'
Arguments splitting for array arguments
|
output: a c e
Installation
Archives of precompiled binaries for axe are available for Linux and macOS.
With dra
With eget
If you're a Rust programmer, axe can be installed with cargo.
How does axe work?
Entries and command execution
Lets consider the following example stdin input:
a b c
d e f
h i j
If we pass it to axe echo {} axe will call echo 3 times for each line.
On each line space will be treated as an arguments separator.
As result axe will resolve and call echo like this:
echo a b c
echo d e f
echo h i j
Arguments resolution
Each entry line will be split by arguments separator that can be chosen by the user (by default space). You may then refer to each argument by its index. For example:
|
There is only one entry with 3 arguments.
Echo will print first argument which is a.
Arguments splitting
Each argument can be splitted into multiple arguments. For example:
|
Axe will read this as follows:
- {1.1} split second argument ('c.d') by '.' and choose second part (
d) - {0.0} split first argument ('a.b') by '.' and choose first part (
a) - {2_0} split third argument ('e.d_f.g') by '_' and choose first part (
e.d)
Arguments resolving into arrays
Arguments can be resolved into arrays. For example:
|
Axe will read this as follows:
{.0} split all arguments by '.' and for each item choose first part (f1, f2, f3)
You may split each argument into multiple items
|
Axe will read this as follows:
{0.} split first argument by '.' and choose all parts (f1, txt)
{1} take second argument(f2.txt)
Output f1 txt f2.txt
Motivation
Every time I was using xargs command I was frustrated that I cannot tell where I want to place arguments. This missing feature made me decide to create my own tool.
Development
Setup
Building