Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp253795ybl; Fri, 16 Aug 2019 23:39:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpHQ1sWhrOAXtxL6lj9+1jCJFBBrT7Qq2o5f49oUrw8Tm6+J4ofczH9inboe4no36ilby2 X-Received: by 2002:a17:90a:aa98:: with SMTP id l24mr10605338pjq.64.1566023960862; Fri, 16 Aug 2019 23:39:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566023960; cv=none; d=google.com; s=arc-20160816; b=YWcarp1Wq/CXsipQz5nV2eNa28yQWcNH/w8G6A92KMOEKx0HaLk3EeWeEAmYLcc/Ek lyuRavxLF4DLv0Kk2NfPBGwyq41xMIzshdttGeUEYPbxuldfQQYpNHIQxD8nqUaEEa1e fmshrFDx63rlVjHAge9KY5AIsbl+/ID+kExiJRPuupqQsGiFAruPiHVrZsof6FZ4jW3d UEEWEQAfegCkqposBG2PWYyHHXPwBho8Xh9y2CLiiC7mu6XZyTsWSJjRy9R9BkvMR3O8 ZHkVQCGwhiMYFZC+4CZ2RoRhyV9R2xPiDJ8TktS1c/5k8x4FIM5FwKuvZiorWVGZAT2O DFTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=r+OKXG43+4EYqqwMzIQOfZVDCpcITGkNlaS2JYyQo/g=; b=UKJw7GC2FoGyhWFCM9dV+az3ONNTzGIrcy3bJqkuG31+l94lo/1jwemei1yh7XtklY I7Ddvc0KzChLEFrNWi/KV0bVQmWV0Re3G0i67b5dfPI472vwZkF1GrcZ4uO7mlEo8GAF od61FybL0bms/KPk23Roppq4ycibTcgEgR43FQ0bRo8FmqYanI82zbxCFuzXi7kMzclq QcVX0XkAtYCpEX77dZF5p8lJ/WfUfjc22cXdkRzaZrvDIJdx3HF5Xobt4l+XGiDRhczL LeJjdOuEb7bMhF34d81WL+xfwViw1DKnkxK+q+YdFUwMD7OKnnl1fcLIpNCIrUB1AEsP +8jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KhVazj9w; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j187si5208909pge.591.2019.08.16.23.38.48; Fri, 16 Aug 2019 23:39:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KhVazj9w; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726202AbfHQGg0 (ORCPT + 99 others); Sat, 17 Aug 2019 02:36:26 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:33444 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726128AbfHQGg0 (ORCPT ); Sat, 17 Aug 2019 02:36:26 -0400 Received: by mail-pl1-f193.google.com with SMTP id go14so3030181plb.0 for ; Fri, 16 Aug 2019 23:36:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r+OKXG43+4EYqqwMzIQOfZVDCpcITGkNlaS2JYyQo/g=; b=KhVazj9wxEnQiMxa+Gaok/52q4rAvt38veRzAFNmgbrv4yTgS391GM/Pq9AvLXMh02 hxHwso2Z4oKNacSRABoNo03YbI2/oeKY4XXkoe1ow8Xe/wZJHOiQE9INH9adsZIoQo4f I+aF6NjI8ngSgQ7Y/EUhxc7jSGjWzkE6ttjjwqkJUHc+8H8FvZTT6N09vl25YpuB7wnH e8q0innHsiWSLTnBm1Q0AJJUxZqypDFh1FBAnJLt51RrIiZg5dLoY7P5Qe8h8e0PPVMv v1SpmmFvaQCFVkmSOKBFwU4QkAFvt9bt8TX9i0pHOZHw2wFq3UzyJLQ2WaLuPmGTh4pu bVpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r+OKXG43+4EYqqwMzIQOfZVDCpcITGkNlaS2JYyQo/g=; b=apXCP5yh01K2DOuYHbodC/EfOJRYQkNaApJZRMDRFGY2kCZBLNbYrlIvc1Oo1vf51Q evWzH5BEgi5/c2TkDGpkxJSYCcYZ+7QiVManBtlIop8Ek8/9KMdhLPO2J3VSRNJ0mud7 EHBIXbQYiIpVextP/X82SLrkf5QKvkqUQarRylciMvmyPRiHJ2OBdgKvz9R8jBuKy4vM VzpLTeSHwrfa0T+L2d+KDmuHmY6Snq8/cTOXzApxz5e1sUGanF7wL+8OpZD+NL3Mzyl/ Yda/huQKV40Nw1SsWgo1kgECsGNrrBqc1+kXYSzrGiedVkdRRPJXmmJAaiMPZ9VPGBsC ZN5A== X-Gm-Message-State: APjAAAVAVmbTk8I7g+SJzWmsfdPIy1iGVHMAHfmrRJgLWK3mr1V2eqk2 NEFcahpMRDbGgAtPPvFo4t/dvws= X-Received: by 2002:a17:902:b418:: with SMTP id x24mr12554326plr.219.1566023785310; Fri, 16 Aug 2019 23:36:25 -0700 (PDT) Received: from rxps.home ([2600:8800:1e00:242:3550:edee:2708:4ad0]) by smtp.gmail.com with ESMTPSA id y128sm6684095pgy.41.2019.08.16.23.36.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2019 23:36:24 -0700 (PDT) From: Ronan Pigott X-Google-Original-From: Ronan Pigott To: linux-bluetooth@vger.kernel.org Cc: Ronan Pigott Subject: [PATCH BlueZ v2 1/4] client/main: add help option for available args Date: Fri, 16 Aug 2019 23:34:49 -0700 Message-Id: <20190817063452.23273-2-rpigott@berkeley.edu> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20190817063452.23273-1-rpigott@berkeley.edu> References: <20190817063452.23273-1-rpigott@berkeley.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Ronan Pigott This option exists to facilitate external completion of commands that have specially defined arguments. It effectively adds two new commands to bluetoothctl with the following output: $ bluetoothctl agent help on off DisplayOnly DisplayYesNo KeyboardDisplay KeyboardOnly NoInputNoOutput $ bluetoothctl advertise help on off peripheral broadcast Shell completion scripts can then parse this output to provide completions for those commands. --- client/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/main.c b/client/main.c index 578b3c7c3..0f810901a 100644 --- a/client/main.c +++ b/client/main.c @@ -800,6 +800,14 @@ static gboolean parse_argument(int argc, char *argv[], const char **arg_table, { const char **opt; + if (!strcmp(argv[1], "help")) { + for (opt = arg_table; opt && *opt; opt++) { + bt_shell_printf("%s\n", *opt); + } + bt_shell_noninteractive_quit(EXIT_SUCCESS); + return FALSE; + } + if (!strcmp(argv[1], "on") || !strcmp(argv[1], "yes")) { *value = TRUE; if (option) -- 2.22.1