jdx / jdx/usage

`usage bash`: add support for reading script from a pipe

Open
#157 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1k
Forks
59
Avg merge
5h 58m
Merged PRs (30d)
362

Description

I've tried to quickly test usage with `usage bash <(printf '#!/bin/bash\n#USAGE bin "pipe"\necho ok\n')` and noticed it does not work (maybe because input file type is a pipe).

```
$ bash <(printf '#!/bin/bash\n#USAGE bin "pipe"\necho ok\n')
ok
$ usage bash <(printf '#!/bin/bash\n#USAGE bin "pipe"\necho ok\n')
$ echo $?
0
$ ls -l <(printf '#!/bin/bash\n#USAGE bin "pipe"\necho ok\n')
lr-x------ 1 powerman powerman 64 ноя 5 09:08 /proc/self/fd/12 -> 'pipe:[29095089]'
$ cat <(printf '#!/bin/bash\n#USAGE bin "pipe"\necho ok\n')
#!/bin/bash
#USAGE bin "pipe"
echo ok
$
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.