From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106596 invoked by alias); 27 Sep 2019 21:25:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 106345 invoked by uid 89); 27 Sep 2019 21:25:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.40) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Sep 2019 21:25:26 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 08DF5520E4C for ; Fri, 27 Sep 2019 16:25:25 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id DxjwiLBeMYqVzDxjwiIFYl; Fri, 27 Sep 2019 16:25:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=tO6NEK5/ODAbq84SPMhLlEoFsg8R/gkFTb7Z++PUGDM=; b=NLU6YSgE2TLCsR0y25TA6H0K0/ JLVQaELVy5YBlnxVF8/9wv3VXYtcxQpwGIHceqJKRoP3bzXoRBN+2JN68MgwKfdofLqvQpDe+rhWM 8OFbZ2qKpcMH+X1umxrP4FNsf; Received: from 71-218-73-27.hlrn.qwest.net ([71.218.73.27]:34758 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iDxjw-002PvY-OI; Fri, 27 Sep 2019 16:25:24 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 5/8] Style "pwd" output Date: Fri, 27 Sep 2019 21:25:00 -0000 Message-Id: <20190927212520.20073-6-tom@tromey.com> In-Reply-To: <20190927212520.20073-1-tom@tromey.com> References: <20190927212520.20073-1-tom@tromey.com> X-SW-Source: 2019-09/txt/msg00567.txt.bz2 This changes the "pwd" command to style its output. gdb/ChangeLog 2019-09-27 Tom Tromey * cli/cli-cmds.c (pwd_command): Style output. gdb/testsuite/ChangeLog 2019-09-27 Tom Tromey * gdb.base/style.exp: Test "pwd". --- gdb/ChangeLog | 4 ++++ gdb/cli/cli-cmds.c | 11 ++++++++--- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/style.exp | 2 ++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 59c71f67561..9f7b052d8e0 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -49,6 +49,7 @@ #include "cli/cli-script.h" #include "cli/cli-setshow.h" #include "cli/cli-cmds.h" +#include "cli/cli-style.h" #include "cli/cli-utils.h" #include "extension.h" @@ -451,10 +452,14 @@ pwd_command (const char *args, int from_tty) safe_strerror (errno)); if (strcmp (cwd.get (), current_directory) != 0) - printf_unfiltered (_("Working directory %s\n (canonically %s).\n"), - current_directory, cwd.get ()); + printf_unfiltered (_("Working directory %ps\n (canonically %ps).\n"), + styled_string (file_name_style.style (), + current_directory), + styled_string (file_name_style.style (), cwd.get ())); else - printf_unfiltered (_("Working directory %s.\n"), current_directory); + printf_unfiltered (_("Working directory %ps.\n"), + styled_string (file_name_style.style (), + current_directory)); } void diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp index d2c3105bb9f..fb0dfed0061 100644 --- a/gdb/testsuite/gdb.base/style.exp +++ b/gdb/testsuite/gdb.base/style.exp @@ -131,4 +131,6 @@ save_vars { env(TERM) } { gdb_test "file $binfile" \ "Reading symbols from [style $quoted file]..." \ "filename is styled when loading symbol file" + + gdb_test "pwd" "Working directory [style .*? file].*" } -- 2.17.2