I'm trying to build a Haskell CLI that can either read in strings from stdin or from arguments like so:
cat colors-multi-line | colorshift -d 10
colorshift -d 10 "#FFFFFF"
How would I accomplish this?
I'm trying to build a Haskell CLI that can either read in strings from stdin or from arguments like so:
cat colors-multi-line | colorshift -d 10
colorshift -d 10 "#FFFFFF"
How would I accomplish this?
There are several libraries to handle CLI argument parsing. optparse-applicative
is the one with which I'm most familiar. getLine
and getContents
in Prelude
read from STDIN
.