Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 7be6e34e0293b7d619c2678403ebcdaae901bb1b Mon Sep 17 00:00:00 2001
- Message-Id: <7be6e34e0293b7d619c2678403ebcdaae901bb1b.1288195960.git.quigybo@hotmail.com>
- From: Chris van Dijk <quigybo@hotmail.com>
- Date: Thu, 28 Oct 2010 01:31:00 +1030
- Subject: [PATCH] Add `never' option to --color=[WHEN]
- ---
- README.pod | 4 ++--
- cower.c | 4 +++-
- 2 files changed, 5 insertions(+), 3 deletions(-)
- diff --git a/README.pod b/README.pod
- index 28fa353..1cdd8f6 100644
- --- a/README.pod
- +++ b/README.pod
- @@ -42,8 +42,8 @@ if any, at the same time.
- =item B<-c, --color[=WHEN]>
- -Use colored output. WHEN is `always' or `auto'. Color will be disabled in a pipe unless WHEN
- -is set to always.
- +Use colored output. WHEN is `never', `always' or `auto'. Color will be disabled in a pipe
- +unless WHEN is set to always.
- =item B<-f, --force>
- diff --git a/cower.c b/cower.c
- index 152db61..e313741 100644
- --- a/cower.c
- +++ b/cower.c
- @@ -104,7 +104,7 @@ Usage: cower [options] <operation> PACKAGE [PACKAGE2..]\n\
- --download flag is passed as well,\n\
- fetch each available update.\n\n", VERSION);
- printf(" General options:\n\
- - -c, --color[=WHEN] Use colored output. WHEN is `always' or `auto'.\n\
- + -c, --color[=WHEN] Use colored output. WHEN is `never', `always' or `auto'.\n\
- -f, --force Overwrite existing files when downloading.\n\
- --ignore <pkg> Ignore a package upgrade (can be used more than once)\n\
- -h, --help Display this help and exit\n\
- @@ -169,6 +169,8 @@ static int parseargs(int argc, char **argv) {
- config->color = 0;
- } else if (STREQ(optarg, "always"))
- config->color = 1;
- + else if (STREQ(optarg, "never"))
- + config->color = 0;
- break;
- case 'f':
- config->force = 1;
- --
- 1.7.3.1
Add Comment
Please, Sign In to add comment