Skip to content

Commit dc38b6d

Browse files
author
replicadse
committed
removed stdin pipe support - bash process substitution is preferred
1 parent fe905ab commit dc38b6d

4 files changed

Lines changed: 6 additions & 27 deletions

File tree

docs/wiki/src/SUMMARY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@
1111
- [3-versioning](./adrs/3-versioning.md)
1212
- [4-experimental-flag](./adrs/4-experimental-flag.md)
1313
- [5-usage-of-feature-flags](./adrs/5-usage-of-feature-flags.md)
14-
- [6-render-command-supporting-stdin-pipe](./adrs/6-render-command-supporting-stdin-pipe.md)
1514
- [7-usage-of-shell-scripts-instead-of-makefiles](./adrs/7-usage-of-shell-scripts-instead-of-makefiles.md)
1615
- [RFCs](./rfcs/root.md)

docs/wiki/src/adrs/6-render-command-supporting-stdin-pipe.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/args/mod.rs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::io::{stdin, Read, Result};
1+
use std::io::Result;
22

33
pub struct CallArgs {
44
pub privileges: Privilege,
@@ -142,23 +142,7 @@ impl ClapArgumentLoader {
142142
Some(x) => {
143143
let config = if x.is_present("config") {
144144
let config_param = x.value_of("config").unwrap();
145-
if config_param == "-" {
146-
match privileges {
147-
Privilege::Normal => {
148-
return Err(std::io::Error::new(
149-
std::io::ErrorKind::Other,
150-
"can not use pipe argument without experimental features being activated",
151-
));
152-
}
153-
Privilege::Experimental => {}
154-
}
155-
let mut buffer = String::new();
156-
let stdin = stdin();
157-
stdin.lock().read_to_string(&mut buffer)?;
158-
buffer
159-
} else {
160-
std::fs::read_to_string(config_param.to_owned())?
161-
}
145+
std::fs::read_to_string(config_param.to_owned())?
162146
} else {
163147
return Err(std::io::Error::new(
164148
std::io::ErrorKind::Other,

test/test-cli.sh

100644100755
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
ev() {
44
if [ $2 -eq $1 ]
@@ -13,12 +13,14 @@ echo "Testing with no shell trust"
1313
cmd="../target/debug/complate -e render -c=./config.yml -t=test"
1414
$cmd
1515
ev 1 $?
16+
echo "success"
1617

1718
echo "Testing with ultimate shell-trust"
1819
cmd="../target/debug/complate -e render -c=./config.yml -t=test --shell-trust=ultimate"
1920
$cmd
2021
ev 0 $?
21-
echo ""
22+
echo
23+
echo "success"
2224

2325
echo ""
2426
echo "All tests succeeded."

0 commit comments

Comments
 (0)