Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set output options from CLI #34

Open
andrew-lei opened this issue Jul 9, 2018 · 5 comments
Open

Set output options from CLI #34

andrew-lei opened this issue Jul 9, 2018 · 5 comments

Comments

@andrew-lei
Copy link
Collaborator

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.

@cdepillabout
Copy link
Owner

cdepillabout commented Jul 9, 2018

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.

@andrew-lei
Copy link
Collaborator Author

Sounds good. What to use for the compiler flag? The CPP language extension?

@andrew-lei
Copy link
Collaborator Author

Or perhaps a config file instead? Could use that to e.g. set indentation as well.

@cdepillabout
Copy link
Owner

Ideally, options for the CLI pretty-simple could be provided the following ways:

  • environment variables
  • settings in a configuration file
  • directly on the command line

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!

@georgefst
Copy link
Collaborator

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.

@georgefst georgefst changed the title LightBg mode for CLI Set output options from CLI Sep 14, 2020
juhp added a commit to juhp/pretty-simple that referenced this issue Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants