Clarify why *input* is for one-liners only

Open
#14 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
50/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
clojure
Domain
documentation

Research direction

Start at the Babashka book's Scripts section linked in the issue and read the guidance around user/input. Clarify why its shape depends on the command-line flags, including -i versus -I, and distinguish it from in. Done means the section includes this explanatory note without changing the code examples.

Written by the indexing model from the issue text.

Description

9:21 AM
jumar In https://book.babashka.org/#_scripts there's this:
When writing scripts instead of one-liners on the command line, it is not recommended to use input
May ask about more details why this isn't recommended?
E.g. Nate uses user/input in his scripts: https://github.com/justone/bb-scripts/blob/master/src/comb.clj#L31
src/comb.clj:31
(->> (map (partial process options) user/input)
https://github.com/justone/bb-scripts|justone/bb-scriptsjustone/bb-scripts | Added by GitHub
9:23 AM
borkdude @jumar I prefer not to since it's not obvious from the script what the corresponding i/o flags on the command line should be
New
9:24 AM
jumar Ah, so the shape of input will vary depending on -i vs -I but in stays the same, right?
It would be great to add a little note to the babashka book's section referenced above
9:25 AM
borkdude ok, will do

Dominant language
Clojure
Stars
67
Forks
37
Avg merge
1m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from babashka/book

All issues in babashka/book

Similar issues

More Clojure issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.