FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 08-05-2012, 09:46 AM
Daniel Wallace
 
Default load color into config

Tell pacman to print with colors

Signed-off-by: Daniel Wallace <daniel.wallace@gatech.edu>
---
src/pacman/conf.c | 3 +++
src/pacman/conf.h | 5 ++++-
src/pacman/pacman.c | 5 +++++
3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index f47b92d..3b3d3df 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -404,6 +404,9 @@ static int _parse_options(const char *key, char *value,
pm_printf(ALPM_LOG_DEBUG, "config: totaldownload
");
} else if(strcmp(key, "CheckSpace") == 0) {
config->checkspace = 1;
+ } else if (strcmp(key, "Color") == 0) {
+ config->color = 1;
+ pm_printf(ALPM_LOG_DEBUG, "config: color
");
} else {
pm_printf(ALPM_LOG_WARNING,
_("config file %s, line %d: directive '%s' in section '%s' not recognized.
"),
diff --git a/src/pacman/conf.h b/src/pacman/conf.h
index 69c955e..3e17155 100644
--- a/src/pacman/conf.h
+++ b/src/pacman/conf.h
@@ -76,6 +76,8 @@ typedef struct __config_t {
/* conf file options */
/* I Love Candy! */
unsigned short chomp;
+ /* Add color */
+ unsigned short color;
/* format target pkg lists as table */
unsigned short verbosepkglists;
/* When downloading, display the amount downloaded, rate, ETA, and percent
@@ -127,7 +129,8 @@ enum {
OP_PRINTFORMAT,
OP_GPGDIR,
OP_DBONLY,
- OP_FORCE
+ OP_FORCE,
+ OP_COLOR
};

/* clean method */
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 73d5be9..732d7f3 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -196,6 +196,7 @@ static void usage(int op, const char * const myname)
addlist(_(" -v, --verbose be verbose
"));
addlist(_(" --arch <arch> set an alternate architecture
"));
addlist(_(" --cachedir <dir> set an alternate package cache location
"));
+ addlist(_(" --color add color to output
"));
addlist(_(" --config <path> set an alternate configuration file
"));
addlist(_(" --debug display debug messages
"));
addlist(_(" --gpgdir <path> set an alternate home directory for GnuPG
"));
@@ -392,6 +393,9 @@ static int parsearg_global(int opt)
check_optarg();
config->cachedirs = alpm_list_add(config->cachedirs, strdup(optarg));
break;
+ case OP_COLOR:
+ config->color = 1;
+ break;
case OP_CONFIG:
check_optarg();
if(config->configfile) {
@@ -628,6 +632,7 @@ static int parseargs(int argc, char *argv[])
{"print-format", required_argument, 0, OP_PRINTFORMAT},
{"gpgdir", required_argument, 0, OP_GPGDIR},
{"dbonly", no_argument, 0, OP_DBONLY},
+ {"color", no_argument, 0, OP_COLOR},
{0, 0, 0, 0}
};

--
1.7.11.4
 

Thread Tools




All times are GMT. The time now is 01:21 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org