-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Options: Add an option to force non-colored output #34
base: main
Are you sure you want to change the base?
Conversation
If the output is to be consumed by an application which does not handle formatted output, the script can be invoked with `--no-color` or `-p` to omit the formatting.
Cool. Out of curiosity, what is this application you're trying to pipe the output to? |
Also, how does your usage of |
I am running a fun little java program on a machine at work that plays sound clips, and does some text-to-speech from user input. We were also using the spotify app on it, and I wanted put the control in there. The way that I invoke the command in java is (for example):
Then I would read the result from the subprocess, and report back.
The intent of this patch is that you can only use the I felt that this was the least intrusive way to add the flag. If you intend to add other arguments in the future, then perhaps a better approach would be to create a command array, then scan ARGV to populate the command array (status, play, etc). This would allow you to differentiate the flags from the commands. |
Cool, thank you for the explanation. I have not forgotten about this pull request (or the others), just mulling over how best to incorporate it. |
Still not forgotten! I finally changed the syntax on the help in general to use |
@hnarayanan Any chance of getting this merged soon? Since it'd be the first flag that the script supports, I don't see a problem doing it this way. A more robust way to do this would be with bash's built-in getopts functionality. Edit: Also, since it seems you're busy with other projects, have you considered giving other users collaborator access to help you manage the project? |
I’m sorry, I don’t know how quick I can act on this (or anything else). I will get to it when I can. |
And I am sorry I was curt earlier. I am dealing with a lot of other stresses in life, and I reacted when even this project (which is supposed to be fun for me) became a place where I was expected to quickly act on something. I really will get to it as soon as I can make the time to focus on this project again. |
And I only now saw your edit to the original comment. I will consider giving other people commit access, yes. |
I ran into the same coolers issue when using the script in a pipe. Here's what I did to test if the script is running in a terminal or not:
|
If the output is to be consumed by an application which does not handle
formatted output, the script can be invoked with
--no-color
or-p
toomit the formatting.