Open andrew-lei opened 6 years ago
This is a great idea.
If you (or anyone else) wanted to send a PR adding a command-line flag, please go ahead.
Using a library like optparse-applicative
would be a good idea, since it is relatively well-known.
Sounds good. What to use for the compiler flag? The CPP language extension?
Or perhaps a config file instead? Could use that to e.g. set indentation as well.
Ideally, options for the CLI pretty-simple
could be provided the following ways:
I guess we could also be able to set defaults with compiler flags, but that is somewhat unusual for Haskell programs, especially when the ability to set the options in a config file, etc is available.
However, I don't know if there are many people using the CLI pretty-simple
other than you and me. So for now I think it is probably good enough to be able to specify the options on the command line. If you want to make sure that light colors are always used, you could create an alias in your ~/.bashrc
file:
alias pretty-simple='pretty-simple --color light-bg'
However, if you also wanted to be able to specify options in a config files or environment variables, then please feel free to send PRs for that!
Note that pretty-simple
has become a lot more configurable than when this issue was posted. Ideally, we want to be able to completely specify an OutputOptions
from the CLI.
I use a light background for my terminal, so using pStringLightBg would be more useful in my case. I was thinking an executable flag, but maybe a better option would be a compiler flag? Of course no reason not to have both.