diff mbox series

[BlueZ,v1,1/2] shared/shell: Add support for comments on scripts

Message ID 20240807212818.193908-1-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Commit 66044ecd8dd95f684a8759358312f9f985fb8893
Headers show
Series [BlueZ,v1,1/2] shared/shell: Add support for comments on scripts | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch warning CheckSparse WARNING src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Luiz Augusto von Dentz Aug. 7, 2024, 9:28 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This adds support for entering comments onscripts by starting the line
'#'.
---
 src/shared/shell.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com Aug. 7, 2024, 11:24 p.m. UTC | #1
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=877581

---Test result---

Test Summary:
CheckPatch                    PASS      0.96 seconds
GitLint                       FAIL      0.81 seconds
BuildEll                      PASS      24.48 seconds
BluezMake                     PASS      1618.00 seconds
MakeCheck                     PASS      12.90 seconds
MakeDistcheck                 PASS      175.25 seconds
CheckValgrind                 PASS      249.80 seconds
CheckSmatch                   WARNING   351.45 seconds
bluezmakeextell               PASS      118.40 seconds
IncrementalBuild              PASS      2856.06 seconds
ScanBuild                     PASS      985.78 seconds

Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[BlueZ,v1,2/2] shared/shell: Add support for running script command as part of script

WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
1: T1 Title exceeds max length (85>80): "[BlueZ,v1,2/2] shared/shell: Add support for running script command as part of script"
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):


---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org Aug. 9, 2024, 2:20 p.m. UTC | #2
Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed,  7 Aug 2024 17:28:17 -0400 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> This adds support for entering comments onscripts by starting the line
> '#'.
> ---
>  src/shared/shell.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Here is the summary with links:
  - [BlueZ,v1,1/2] shared/shell: Add support for comments on scripts
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=66044ecd8dd9
  - [BlueZ,v1,2/2] shared/shell: Add support for running script command as part of script
    (no matching commit)

You are awesome, thank you!
diff mbox series

Patch

diff --git a/src/shared/shell.c b/src/shared/shell.c
index 88ecaa076adc..932dd7dd4a52 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -262,6 +262,10 @@  static int bt_shell_queue_exec(char *line)
 {
 	int err;
 
+	/* Ignore comments */
+	if (line[0] == '#')
+		return 0;
+
 	/* Queue if already executing */
 	if (data.line) {
 		/* Check if prompt is being held then release using the line */
@@ -876,7 +880,8 @@  static void rl_handler(char *input)
 		return;
 	}
 
-	if (!strlen(input))
+	/* Ignore empty/comment lines */
+	if (!strlen(input) || input[0] == '#')
 		goto done;
 
 	if (!bt_shell_release_prompt(input))