Return-Path: X-Original-To: apmail-celix-commits-archive@www.apache.org Delivered-To: apmail-celix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6D38E183EA for ; Tue, 3 Nov 2015 15:09:33 +0000 (UTC) Received: (qmail 30324 invoked by uid 500); 3 Nov 2015 15:09:28 -0000 Delivered-To: apmail-celix-commits-archive@celix.apache.org Received: (qmail 30204 invoked by uid 500); 3 Nov 2015 15:09:28 -0000 Mailing-List: contact commits-help@celix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@celix.apache.org Delivered-To: mailing list commits@celix.apache.org Received: (qmail 29961 invoked by uid 99); 3 Nov 2015 15:09:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Nov 2015 15:09:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 01054E1072; Tue, 3 Nov 2015 15:09:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: pnoltes@apache.org To: commits@celix.apache.org Date: Tue, 03 Nov 2015 15:09:37 -0000 Message-Id: <2b3d27343bb247c59d85be57223b39cf@git.apache.org> In-Reply-To: <1112eec2abbb4c4fa0d84c6d16881b78@git.apache.org> References: <1112eec2abbb4c4fa0d84c6d16881b78@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [11/50] [abbrv] celix git commit: CELIX-210: Added yellow color text instead of red for not available optional dependencies CELIX-210: Added yellow color text instead of red for not available optional dependencies Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/f48fee19 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/f48fee19 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/f48fee19 Branch: refs/heads/master Commit: f48fee19af8a0e06c5d74b5ceae0c74f783c5dd0 Parents: 2de2554 Author: Pepijn Noltes Authored: Thu Oct 22 21:37:03 2015 +0200 Committer: Pepijn Noltes Committed: Thu Oct 22 21:37:03 2015 +0200 ---------------------------------------------------------------------- .../private/src/dm_shell_list_command.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/celix/blob/f48fee19/dependency_manager/private/src/dm_shell_list_command.c ---------------------------------------------------------------------- diff --git a/dependency_manager/private/src/dm_shell_list_command.c b/dependency_manager/private/src/dm_shell_list_command.c index 1e70513..030d909 100644 --- a/dependency_manager/private/src/dm_shell_list_command.c +++ b/dependency_manager/private/src/dm_shell_list_command.c @@ -35,6 +35,11 @@ #include "shell.h" +static const char * const OK_COLOR = "\033[92m"; +static const char * const WARNING_COLOR = "\033[93m"; +static const char * const NOK_COLOR = "\033[91m"; +static const char * const END_COLOR = "\033[m"; + char * dmListCommand_getName(command_pt command) { return "dm"; } @@ -73,8 +78,8 @@ void dmListCommand_execute(command_pt command, char * line, void (*out)(char *), char *startColors = ""; char *endColors = ""; if (colors) { - startColors = compInfo->active ? "\033[92m" : "\033[91m"; - endColors = "\033[m"; + startColors = compInfo->active ? OK_COLOR : NOK_COLOR; + endColors = END_COLOR; } sprintf(outString, "Component: ID=%s, %sActive=%s%s, State=%s\n", compInfo->id, startColors, compInfo->active ? "true " : "false", endColors, compInfo->state); out(outString); @@ -98,8 +103,13 @@ void dmListCommand_execute(command_pt command, char * line, void (*out)(char *), char *startColors = ""; char *endColors = ""; if (colors) { - startColors = dependency->available ? "\033[92m" : "\033[91m"; - endColors = "\033[m"; + if (dependency->required) { + startColors = dependency->available ? OK_COLOR : NOK_COLOR; + } else { + startColors = dependency->available ? OK_COLOR : WARNING_COLOR; + } + + endColors = END_COLOR; } sprintf(outString, " |- Dependency: %sAvailable = %s%s, Required = %s, Filter = %s\n", startColors,