All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] shared/shell: Print help info for individual commands
@ 2021-05-13  0:39 Inga Stotland
  2021-05-13  1:43 ` [BlueZ] " bluez.test.bot
  0 siblings, 1 reply; 3+ messages in thread
From: Inga Stotland @ 2021-05-13  0:39 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Inga Stotland

For menus with long list of entries, it is useful to be able invoke
help message for an individual entry to look up command description and
synopsis.
Can be invoked by entering "<command> help" or "<command> --help".
---
 src/shared/shell.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/shared/shell.c b/src/shared/shell.c
index c0de1640d..07eaa1702 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -352,6 +352,16 @@ static int cmd_exec(const struct bt_shell_menu_entry *entry,
 	int flags = WRDE_NOCMD;
 	bool optargs = false;
 
+	if (argc == 2 && (!memcmp(argv[1], "help", 4) ||
+				!memcmp(argv[1], "--help", 6))) {
+		printf("%s\n", entry->desc);
+		printf(COLOR_HIGHLIGHT "Usage:" COLOR_OFF "\n");
+		printf("\t %s %-*s\n", entry->cmd,
+				(int)(CMD_LENGTH - strlen(entry->cmd)),
+					!entry->arg ? "" : entry->arg);
+		return 0;
+	}
+
 	if (!entry->arg || entry->arg[0] == '\0') {
 		if (argc > 1) {
 			print_text(COLOR_HIGHLIGHT, "Too many arguments");
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [BlueZ] shared/shell: Print help info for individual commands
  2021-05-13  0:39 [PATCH BlueZ] shared/shell: Print help info for individual commands Inga Stotland
@ 2021-05-13  1:43 ` bluez.test.bot
  2021-05-13 21:10   ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 3+ messages in thread
From: bluez.test.bot @ 2021-05-13  1:43 UTC (permalink / raw)
  To: linux-bluetooth, inga.stotland

[-- Attachment #1: Type: text/plain, Size: 1953 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=481581

---Test result---

Test Summary:
CheckPatch                    PASS      0.53 seconds
GitLint                       PASS      0.14 seconds
Prep - Setup ELL              PASS      40.14 seconds
Build - Prep                  PASS      0.10 seconds
Build - Configure             PASS      7.03 seconds
Build - Make                  PASS      167.38 seconds
Make Check                    PASS      8.21 seconds
Make Distcheck                PASS      190.10 seconds
Build w/ext ELL - Configure   PASS      6.57 seconds
Build w/ext ELL - Make        PASS      148.17 seconds

Details
##############################
Test: CheckPatch - PASS
Desc: Run checkpatch.pl script with rule in .checkpatch.conf

##############################
Test: GitLint - PASS
Desc: Run gitlint with rule in .gitlint

##############################
Test: Prep - Setup ELL - PASS
Desc: Clone, build, and install ELL

##############################
Test: Build - Prep - PASS
Desc: Prepare environment for build

##############################
Test: Build - Configure - PASS
Desc: Configure the BlueZ source tree

##############################
Test: Build - Make - PASS
Desc: Build the BlueZ source tree

##############################
Test: Make Check - PASS
Desc: Run 'make check'

##############################
Test: Make Distcheck - PASS
Desc: Run distcheck to check the distribution

##############################
Test: Build w/ext ELL - Configure - PASS
Desc: Configure BlueZ source with '--enable-external-ell' configuration

##############################
Test: Build w/ext ELL - Make - PASS
Desc: Build BlueZ source with '--enable-external-ell' configuration



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BlueZ] shared/shell: Print help info for individual commands
  2021-05-13  1:43 ` [BlueZ] " bluez.test.bot
@ 2021-05-13 21:10   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2021-05-13 21:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Stotland, Inga

Hi Inga,

On Wed, May 12, 2021 at 6:45 PM <bluez.test.bot@gmail.com> wrote:
>
> This is automated email and please do not reply to this email!
>
> Dear submitter,
>
> Thank you for submitting the patches to the linux bluetooth mailing list.
> This is a CI test results with your patch series:
> PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=481581
>
> ---Test result---
>
> Test Summary:
> CheckPatch                    PASS      0.53 seconds
> GitLint                       PASS      0.14 seconds
> Prep - Setup ELL              PASS      40.14 seconds
> Build - Prep                  PASS      0.10 seconds
> Build - Configure             PASS      7.03 seconds
> Build - Make                  PASS      167.38 seconds
> Make Check                    PASS      8.21 seconds
> Make Distcheck                PASS      190.10 seconds
> Build w/ext ELL - Configure   PASS      6.57 seconds
> Build w/ext ELL - Make        PASS      148.17 seconds
>
> Details
> ##############################
> Test: CheckPatch - PASS
> Desc: Run checkpatch.pl script with rule in .checkpatch.conf
>
> ##############################
> Test: GitLint - PASS
> Desc: Run gitlint with rule in .gitlint
>
> ##############################
> Test: Prep - Setup ELL - PASS
> Desc: Clone, build, and install ELL
>
> ##############################
> Test: Build - Prep - PASS
> Desc: Prepare environment for build
>
> ##############################
> Test: Build - Configure - PASS
> Desc: Configure the BlueZ source tree
>
> ##############################
> Test: Build - Make - PASS
> Desc: Build the BlueZ source tree
>
> ##############################
> Test: Make Check - PASS
> Desc: Run 'make check'
>
> ##############################
> Test: Make Distcheck - PASS
> Desc: Run distcheck to check the distribution
>
> ##############################
> Test: Build w/ext ELL - Configure - PASS
> Desc: Configure BlueZ source with '--enable-external-ell' configuration
>
> ##############################
> Test: Build w/ext ELL - Make - PASS
> Desc: Build BlueZ source with '--enable-external-ell' configuration
>
>
>
> ---
> Regards,
> Linux Bluetooth

Applied, thanks.

-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-13 21:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13  0:39 [PATCH BlueZ] shared/shell: Print help info for individual commands Inga Stotland
2021-05-13  1:43 ` [BlueZ] " bluez.test.bot
2021-05-13 21:10   ` Luiz Augusto von Dentz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.