Skip to content

shared/shell: Add proper support for non-interactive mode

Luiz Augusto von Dentz linux-bluetooth 1 version Applied

Status from this message: Applied.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 of 14 patches 1 replyApplied

13 of 14 patches are in this archive. The cover letter announces 14.

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/14shared/shell: Add bt_shell_{noninteractive_}quitsrc/shared/shell.c src/shared/shell.h+19 -00 replies
2/14shared/shell: Fix not reseting optindsrc/shared/shell.c+1 -00 replies
3/14shared/shell: Fix timeout parametersrc/shared/shell.c+3 -30 replies
4/14shared/shell: Do not quit immediatelly on noninteractive modesrc/shared/shell.c+1 -40 replies
5/14shared/shell: Fix not handling sort optionssrc/shared/shell.c+8 -10 replies
6/14shared/shell: Disable bt_shell_prompt_input in noninteractive modesrc/shared/shell.c+3 -00 replies
7/14shared/shell: Disable readline while in noninteractive modesrc/shared/shell.c+21 -40 replies
8/14sharead/mainloop-glib: Fix mainloop_exit*src/shared/mainloop-glib.c+2 -00 replies
9/14shared/mainloop-glib: Fix calling g_main_loop_quit with NULLsrc/shared/mainloop-glib.c+3 -00 replies
10/14shared/shell: Allow executing submenu commandssrc/shared/shell.c+32 -20 replies
11/14client: Call bt_shell_noninteractive_quit when done with commandclient/advertising.c client/gatt.c client/main.c+235 -1150 replies
12/14shared/shell: Add bt_shell_usagesrc/shared/shell.c src/shared/shell.h+15 -00 replies
13/14shared/shell: Fix parsing of mandatory argumentssrc/shared/shell.c+14 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH BlueZ 00/14] shared/shell: Add proper support for non-interactive mode

From: Luiz Augusto von Dentz <[email protected]>

This adds functionally to bt_shell to properly handle non-interactive mode making all command line tools handle commands given as argument:

Quoted 1 line

./bluetoothctl power on

[CHG] Controller B8:8A:60:D8:17:D7 Class: 0x002c010c Changing power on succeded

While on non-interactive mode readline will not be used and only the command line arguments will be processed, in addition to that there is now bt_shell_noninteractive_quit which shall be used by the command handler to quit when it is done with the command execution.

Luiz Augusto von Dentz (14):
shared/shell: Add bt_shell_{noninteractive_}quit shared/shell: Fix not reseting optind
shared/shell: Fix timeout parameter
shared/shell: Do not quit immediatelly on noninteractive mode shared/shell: Fix not handling sort options shared/shell: Disable bt_shell_prompt_input in noninteractive mode shared/shell: Disable readline while in noninteractive mode sharead/mainloop-glib: Fix mainloop_exit* shared/mainloop-glib: Fix calling g_main_loop_quit with NULL shared/shell: Allow executing submenu commands
client: Call bt_shell_noninteractive_quit when done with command shared/shell: Add bt_shell_usage
shared/shell: Fix parsing of mandatory arguments tools/btmgmt: Port to use bt_shell

 client/advertising.c       |   84 ++-
 client/gatt.c              |  113 ++--
 client/main.c              |  153 +++--
 src/shared/mainloop-glib.c |    5 +
 src/shared/shell.c         |  130 +++-
 src/shared/shell.h         |    4 +
 tools/btmgmt.c             | 1560 ++++++++++++++++----------------------------
 7 files changed, 905 insertions(+), 1144 deletions(-)
Signature · 1 line
2.14.3