Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 9ab54c1

Browse files
author
Eyal
authored
Added file/folder I/O CLI specs (#135)
* added CLI form spec * I/O CLI processing, force flag * BF CLI Hackathon Flyer * review comments * Remove from PR
1 parent add7c62 commit 9ab54c1

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

CONTRIBUTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
* [--help|-h|-?] : displays help, usage information
5959
* [--log|-l] [quite|normal|verbose]: Control STDOUT log level.
6060
* Default: normal. Plugin owner must respect quite mode; but verbose implementation is optional
61+
* \[--force|-f\]: Force action without prompting e.g. Overwrite (particularly in I/O operations)
6162
* Short form:
6263
* Mandatory for common options: -i, -o, -r, -v, -h
6364
* Suggested for frequent operations
@@ -71,6 +72,36 @@
7172

7273
- Always, if possible, detect input format from content
7374
- Detect --in / --out file or folder based on specified value. If need to disambiguate introduce param (only if no way to infer).
75+
- Use the input/output stream tables below to guide command line I/O processing
76+
77+
78+
79+
#### Input Stream
80+
81+
| Specified | Expected | Exist | File Action | Folder Action |
82+
| --------- | -------- | ------ | ----------- | ------------- |
83+
| Yes | Yes | Yes | OK | OK |
84+
| Yes | Yes | No | Fail | Fail |
85+
| No | Yes | Yes/No | STDIN | Fail |
86+
| Yes | No | Yes/No | Fail | Fail |
87+
| No | No | Yes/No | OK | OK |
88+
89+
90+
91+
#### Output Stream
92+
93+
| Specified | Expected | Exist | File Action | Folder Action |
94+
| --------- | -------- | ------ | ------------------------------------------------------ | ------------------------------ |
95+
| Yes | Yes | Yes | if [--force] --> OK (overwrite); otherwise prompt user | Same logic for files in folder |
96+
| Yes | Yes | No | OK (create) | Fail |
97+
| No | Yes | Yes/No | STDOUT | Fail |
98+
| Yes | No | Yes/No | Fail | Fail |
99+
| No | No | Yes/No | OK | OK |
100+
101+
102+
103+
104+
74105

75106
### Standard Command Types
76107

0 commit comments

Comments
 (0)