fwcd / fwcd/d2

Add support for true multi-parameter commands

Open
#72 0 comments 0 reactions 0 assignees View on GitHub
enhancement refactoring
Dominant language
Swift
Stars
17
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Currently, commands can be chained using pipe syntax:

```
command1 | command2 | ...
```

It would, however, be nice to have support for true multi-parameter commands (analogous to functions) that support...

* partial application,
* automated argument parsing,
* automated help generation (there is some experimental support for this in the `Arg`-API),
* a proper error model such that command implementations can throw their own exceptions,
* async/await?? (hopefully, with Swift 6),
* strong typing of command inputs (through associated types? generics?)
* explicit application syntax, for example supporting

```
command2(command1(x))
```

as alternative to

```
command1 x | command2
```

This would also provide a natural syntax for _combining_ command outputs (which was not possible before). For example, consider the following (hypothetical) two-argument `concat` command:

```
concat(reverse(abc), reverse(def))
```

Of course, the new syntax should be backwards-compatible where possible and the existing syntax should still be considered "sugar" for the new, explicit syntax.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.