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?
Copyright © 2021 Jogjafile Inc.
There are several libraries to handle CLI argument parsing.
optparse-applicativeis the one with which I'm most familiar.getLineandgetContentsinPreluderead fromSTDIN.