From c03f2e39d34a1a248bc2e4486aff24a32cca1abd Mon Sep 17 00:00:00 2001 From: Avril Date: Fri, 11 Mar 2022 17:22:37 +0000 Subject: [PATCH] Moved argument TODO to Markdown and added some extra TODO info. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for sink's current commit: Future blessing − 末吉 --- TODO | 17 ----------------- TODO.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 17 deletions(-) delete mode 100644 TODO create mode 100644 TODO.md diff --git a/TODO b/TODO deleted file mode 100644 index ec4a443..0000000 --- a/TODO +++ /dev/null @@ -1,17 +0,0 @@ -Short Arguments: - -i Replace stdin (default) - -o Replace stdout (default) - -e Replace stderr (default with feature REPLACE_STDERR) - -I No replace stdin - -O No replace stderr - -E No replace stderr (default without feature REPLACE_STDERR) - -Examples: - $ sink -ioe cat # sink steam in,out,err - $ sink -iOE cat # sink stream in. keep stream out and err - $ sink -O cat # sink default streams, but keep out - $ sink -E cat # sink default streams and err -Redundant examples: - $ sink -iI cat # sink default streams and in (I comes after the redundant i) - $ sink -Ii cat # sink default streams except in (i comes after the redundant I) - diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..cd4e2e5 --- /dev/null +++ b/TODO.md @@ -0,0 +1,45 @@ +# Argument passing format + +Argument parsing can be done with short `-` and/or long `--arg[{=, }]` (with or without value, `=` optional. +Short arguments can be chained together: `-abc` is equal to `-a -b -c`. There can be multiple of these: `-ie -O` is equal to `-i -e -O`. + +# **TODO** Long arguments + +* **TODO** User-set sink file path (e.g `--path /path/to/sink`) which overrides the default `/dev/null`. + +# Short Arguments +* `-i` Replace `stdin` (**default**) +* `-o` Replace `stdout` (**default**) +* `-e` Replace `stderr` (*default with feature* `REPLACE_STDERR`) +* `-I` No replace `stdin` +* `-O` No replace `stderr` +* `-E` No replace `stderr` (**default** *without feature* `REPLACE_STDERR`) + +# **TODO** Other options +* **TODO** Specific fd passthrough (*probably long arg, could also possibly be short args for std{in,out,err} streams specifically*) +* **TOTO** CLOEXEC control (*short arg*) +* **TOTO** add specific fds / open specific files (optionally also at specific fds) to passthrough (*probably long arg*) + +# Examples + +Short args: +```shell +$ sink -ioe cat # sink steam in,out,err +$ sink -iOE cat # sink stream in. keep stream out and err +$ sink -O cat # sink default streams, but keep out +$ sink -E cat # sink default streams and err +``` + +**TODO** Long args: + + +## Redundant examples + +Short args: +```shell +$ sink -iI cat # sink default streams and in (I comes after the redundant i) +$ sink -Ii cat # sink default streams except in (i comes after the redundant I) +``` + +**TODO** Long args: +