From b928b717563319c16a551e08e4c2edc12769e8f6 Mon Sep 17 00:00:00 2001 From: Jakub Rzeszutko Date: Wed, 5 Dec 2018 11:45:06 +0100 Subject: [PATCH] shell: rename shell_help_print function Function printing help has been renamed to shell_help. Signed-off-by: Jakub Rzeszutko --- include/shell/shell.h | 2 +- samples/drivers/flash_shell/src/main.c | 2 +- samples/net/zperf/src/zperf_shell.c | 20 ++++++++++---------- subsys/bluetooth/host/mesh/shell.c | 2 +- subsys/bluetooth/shell/bredr.c | 10 +++++----- subsys/bluetooth/shell/bt.c | 18 +++++++++--------- subsys/bluetooth/shell/gatt.c | 4 ++-- subsys/bluetooth/shell/l2cap.c | 4 ++-- subsys/bluetooth/shell/rfcomm.c | 2 +- subsys/bluetooth/shell/ticker.c | 2 +- subsys/net/l2/bluetooth/bluetooth_shell.c | 6 +++--- subsys/net/l2/ieee802154/ieee802154_shell.c | 14 +++++++------- subsys/net/l2/wifi/wifi_shell.c | 6 +++--- subsys/shell/shell.c | 8 ++++---- tests/bluetooth/shell/src/main.c | 2 +- 15 files changed, 51 insertions(+), 51 deletions(-) diff --git a/include/shell/shell.h b/include/shell/shell.h index aab4c31950a..3e905ca1e30 100644 --- a/include/shell/shell.h +++ b/include/shell/shell.h @@ -640,7 +640,7 @@ int shell_prompt_change(const struct shell *shell, char *prompt); * * @param[in] shell Pointer to the shell instance. */ -void shell_help_print(const struct shell *shell); +void shell_help(const struct shell *shell); /** @brief Execute command. * diff --git a/samples/drivers/flash_shell/src/main.c b/samples/drivers/flash_shell/src/main.c index eb3857d0a9a..08d5620034c 100644 --- a/samples/drivers/flash_shell/src/main.c +++ b/samples/drivers/flash_shell/src/main.c @@ -232,7 +232,7 @@ static int cmd_flash(const struct shell *shell, size_t argc, char **argv) ARG_UNUSED(argc); ARG_UNUSED(argv); - shell_help_print(shell); + shell_help(shell); return 0; } diff --git a/samples/net/zperf/src/zperf_shell.c b/samples/net/zperf/src/zperf_shell.c index 8c7477c2c72..2e2bdeef503 100644 --- a/samples/net/zperf/src/zperf_shell.c +++ b/samples/net/zperf/src/zperf_shell.c @@ -226,7 +226,7 @@ static int cmd_setip(const struct shell *shell, size_t argc, char *argv[]) if (IS_ENABLED(CONFIG_NET_IPV6) && !IS_ENABLED(CONFIG_NET_IPV4)) { if (argc != 3) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } @@ -244,7 +244,7 @@ static int cmd_setip(const struct shell *shell, size_t argc, char *argv[]) if (IS_ENABLED(CONFIG_NET_IPV4) && !IS_ENABLED(CONFIG_NET_IPV6)) { if (argc != 2) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } @@ -262,7 +262,7 @@ static int cmd_setip(const struct shell *shell, size_t argc, char *argv[]) if (IS_ENABLED(CONFIG_NET_IPV6) && IS_ENABLED(CONFIG_NET_IPV4)) { if (net_addr_pton(AF_INET6, argv[start + 1], &ipv6) < 0) { if (argc != 2) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } @@ -278,7 +278,7 @@ static int cmd_setip(const struct shell *shell, size_t argc, char *argv[]) net_sprint_ipv4_addr(&ipv4)); } else { if (argc != 3) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } @@ -688,12 +688,12 @@ static int shell_cmd_upload(const struct shell *shell, size_t argc, if (is_udp) { if (IS_ENABLED(CONFIG_NET_UDP)) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } } else { if (IS_ENABLED(CONFIG_NET_TCP)) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } } @@ -828,12 +828,12 @@ static int shell_cmd_upload2(const struct shell *shell, size_t argc, if (is_udp) { if (IS_ENABLED(CONFIG_NET_UDP)) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } } else { if (IS_ENABLED(CONFIG_NET_TCP)) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } } @@ -936,7 +936,7 @@ static int cmd_tcp(const struct shell *shell, size_t argc, char *argv[]) if (IS_ENABLED(CONFIG_NET_TCP)) { do_init(shell); - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } @@ -951,7 +951,7 @@ static int cmd_udp(const struct shell *shell, size_t argc, char *argv[]) if (IS_ENABLED(CONFIG_NET_UDP)) { do_init(shell); - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } diff --git a/subsys/bluetooth/host/mesh/shell.c b/subsys/bluetooth/host/mesh/shell.c index 71153549ed5..70eb4f13d6e 100644 --- a/subsys/bluetooth/host/mesh/shell.c +++ b/subsys/bluetooth/host/mesh/shell.c @@ -2031,7 +2031,7 @@ SHELL_CREATE_STATIC_SUBCMD_SET(mesh_cmds) { static int cmd_mesh(const struct shell *shell, size_t argc, char **argv) { if (argc == 1) { - shell_help_print(shell); + shell_help(shell); /* shell returns 1 when help is printed */ return 1; } diff --git a/subsys/bluetooth/shell/bredr.c b/subsys/bluetooth/shell/bredr.c index aa62a71d196..9ff01c2ed9f 100644 --- a/subsys/bluetooth/shell/bredr.c +++ b/subsys/bluetooth/shell/bredr.c @@ -200,7 +200,7 @@ static int cmd_discovery(const struct shell *shell, size_t argc, char *argv[]) shell_print(shell, "Discovery stopped"); } else { - shell_help_print(shell); + shell_help(shell); } return 0; @@ -296,7 +296,7 @@ static int cmd_discoverable(const struct shell *shell, } else if (!strcmp(action, "off")) { err = bt_br_set_discoverable(false); } else { - shell_help_print(shell); + shell_help(shell); return 0; } @@ -324,7 +324,7 @@ static int cmd_connectable(const struct shell *shell, } else if (!strcmp(action, "off")) { err = bt_br_set_connectable(false); } else { - shell_help_print(shell); + shell_help(shell); return 0; } @@ -514,7 +514,7 @@ static int cmd_sdp_find_record(const struct shell *shell, } else if (!strcmp(action, "A2SRC")) { discov = discov_a2src; } else { - shell_help_print(shell); + shell_help(shell); return 0; } @@ -551,7 +551,7 @@ SHELL_CREATE_STATIC_SUBCMD_SET(br_cmds) { static int cmd_br(const struct shell *shell, size_t argc, char **argv) { if (argc == 1) { - shell_help_print(shell); + shell_help(shell); /* shell returns 1 when help is printed */ return 1; } diff --git a/subsys/bluetooth/shell/bt.c b/subsys/bluetooth/shell/bt.c index fc669f1cdd9..791348de6b7 100644 --- a/subsys/bluetooth/shell/bt.c +++ b/subsys/bluetooth/shell/bt.c @@ -613,7 +613,7 @@ static int cmd_scan(const struct shell *shell, size_t argc, char *argv[]) } else if (!strcmp(dup_filter, "nodups")) { dups = BT_HCI_LE_SCAN_FILTER_DUP_ENABLE; } else { - shell_help_print(shell); + shell_help(shell); /* shell returns 1 when help is printed */ return 1; } @@ -627,7 +627,7 @@ static int cmd_scan(const struct shell *shell, size_t argc, char *argv[]) } else if (!strcmp(action, "passive")) { return cmd_passive_scan_on(shell, dups); } else { - shell_help_print(shell); + shell_help(shell); /* shell returns 1 when help is printed */ return 1; } @@ -702,7 +702,7 @@ static int cmd_advertise(const struct shell *shell, size_t argc, char *argv[]) return 0; fail: - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } @@ -746,7 +746,7 @@ static int cmd_disconnect(const struct shell *shell, size_t argc, char *argv[]) bt_addr_le_t addr; if (argc < 3) { - shell_help_print(shell); + shell_help(shell); /* shell returns 1 when help is printed */ return 1; } @@ -795,7 +795,7 @@ static int cmd_auto_conn(const struct shell *shell, size_t argc, char *argv[]) } else if (!strcmp(argv[3], "off")) { return bt_le_set_auto_conn(&addr, NULL); } else { - shell_help_print(shell); + shell_help(shell); /* shell returns 1 when help is printed */ return 1; } @@ -822,7 +822,7 @@ static int cmd_directed_adv(const struct shell *shell, } if (strcmp(argv[3], "low")) { - shell_help_print(shell); + shell_help(shell); /* shell returns 1 when help is printed */ return 1; } @@ -1014,7 +1014,7 @@ static int cmd_bondable(const struct shell *shell, size_t argc, char *argv[]) } else if (!strcmp(bondable, "off")) { bt_set_bondable(false); } else { - shell_help_print(shell); + shell_help(shell); /* shell returns 1 when help is printed */ return 1; } @@ -1208,7 +1208,7 @@ static int cmd_auth(const struct shell *shell, size_t argc, char *argv[]) } else if (!strcmp(argv[1], "none")) { bt_conn_auth_cb_register(NULL); } else { - shell_help_print(shell); + shell_help(shell); /* shell returns 1 when help is printed */ return 1; } @@ -1389,7 +1389,7 @@ SHELL_CREATE_STATIC_SUBCMD_SET(bt_cmds) { static int cmd_bt(const struct shell *shell, size_t argc, char **argv) { if (argc == 1) { - shell_help_print(shell); + shell_help(shell); /* shell returns 1 when help is printed */ return 1; } diff --git a/subsys/bluetooth/shell/gatt.c b/subsys/bluetooth/shell/gatt.c index 7cb4a66afc7..917438cd564 100644 --- a/subsys/bluetooth/shell/gatt.c +++ b/subsys/bluetooth/shell/gatt.c @@ -740,7 +740,7 @@ static int cmd_metrics(const struct shell *shell, size_t argc, char *argv[]) err = bt_gatt_service_unregister(&met_svc); } else { shell_error(shell, "Incorrect value: %s", argv[1]); - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } @@ -796,7 +796,7 @@ SHELL_CREATE_STATIC_SUBCMD_SET(gatt_cmds) { static int cmd_gatt(const struct shell *shell, size_t argc, char **argv) { if (argc == 1) { - shell_help_print(shell); + shell_help(shell); /* shell returns 1 when help is printed */ return 1; } diff --git a/subsys/bluetooth/shell/l2cap.c b/subsys/bluetooth/shell/l2cap.c index ed44862de6b..4f5bdc18032 100644 --- a/subsys/bluetooth/shell/l2cap.c +++ b/subsys/bluetooth/shell/l2cap.c @@ -354,7 +354,7 @@ static int cmd_metrics(const struct shell *shell, size_t argc, char *argv[]) } else if (!strcmp(action, "off")) { l2cap_ops.recv = l2cap_recv; } else { - shell_help_print(shell); + shell_help(shell); return 0; } @@ -416,7 +416,7 @@ SHELL_CREATE_STATIC_SUBCMD_SET(l2cap_cmds) { static int cmd_l2cap(const struct shell *shell, size_t argc, char **argv) { if (argc == 1) { - shell_help_print(shell); + shell_help(shell); /* shell returns 1 when help is printed */ return 1; } diff --git a/subsys/bluetooth/shell/rfcomm.c b/subsys/bluetooth/shell/rfcomm.c index a1ddeb3c9fe..3f20cd8d79e 100644 --- a/subsys/bluetooth/shell/rfcomm.c +++ b/subsys/bluetooth/shell/rfcomm.c @@ -244,7 +244,7 @@ SHELL_CREATE_STATIC_SUBCMD_SET(rfcomm_cmds) { static int cmd_rfcomm(const struct shell *shell, size_t argc, char **argv) { if (argc == 1) { - shell_help_print(shell); + shell_help(shell); /* shell returns 1 when help is printed */ return 1; } diff --git a/subsys/bluetooth/shell/ticker.c b/subsys/bluetooth/shell/ticker.c index cd72b41370a..811b3868dcb 100644 --- a/subsys/bluetooth/shell/ticker.c +++ b/subsys/bluetooth/shell/ticker.c @@ -135,7 +135,7 @@ SHELL_CREATE_STATIC_SUBCMD_SET(ticker_cmds) { static int cmd_ticker(const struct shell *shell, size_t argc, char **argv) { if (argc == 1) { - shell_help_print(shell); + shell_help(shell); /* shell returns 1 when help is printed */ return 1; } diff --git a/subsys/net/l2/bluetooth/bluetooth_shell.c b/subsys/net/l2/bluetooth/bluetooth_shell.c index b0a1751ded7..ac5ddd408ff 100644 --- a/subsys/net/l2/bluetooth/bluetooth_shell.c +++ b/subsys/net/l2/bluetooth/bluetooth_shell.c @@ -85,7 +85,7 @@ static int shell_cmd_connect(const struct shell *shell, struct net_if *iface = net_if_get_default(); if (argc < 3) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } @@ -113,7 +113,7 @@ static int shell_cmd_scan(const struct shell *shell, struct net_if *iface = net_if_get_default(); if (argc < 2) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } @@ -150,7 +150,7 @@ static int shell_cmd_advertise(const struct shell *shell, struct net_if *iface = net_if_get_default(); if (argc < 2) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } diff --git a/subsys/net/l2/ieee802154/ieee802154_shell.c b/subsys/net/l2/ieee802154/ieee802154_shell.c index cb7f2279617..a9abaf17966 100644 --- a/subsys/net/l2/ieee802154/ieee802154_shell.c +++ b/subsys/net/l2/ieee802154/ieee802154_shell.c @@ -73,7 +73,7 @@ static int cmd_ieee802154_associate(const struct shell *shell, char ext_addr[MAX_EXT_ADDR_STR_LEN]; if (argc < 3) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } @@ -208,7 +208,7 @@ static int cmd_ieee802154_scan(const struct shell *shell, int ret; if (argc < 3) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } @@ -279,7 +279,7 @@ static int cmd_ieee802154_set_chan(const struct shell *shell, u16_t channel; if (argc < 2) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } @@ -343,7 +343,7 @@ static int cmd_ieee802154_set_pan_id(const struct shell *shell, ARG_UNUSED(argc); if (argc < 2) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } @@ -405,7 +405,7 @@ static int cmd_ieee802154_set_ext_addr(const struct shell *shell, u8_t addr[IEEE802154_EXT_ADDR_LENGTH]; if (argc < 2) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } @@ -480,7 +480,7 @@ static int cmd_ieee802154_set_short_addr(const struct shell *shell, u16_t short_addr; if (argc < 2) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } @@ -539,7 +539,7 @@ static int cmd_ieee802154_set_tx_power(const struct shell *shell, s16_t tx_power; if (argc < 2) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 2ca1dd52528..05f55177aa8 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -152,13 +152,13 @@ static int cmd_wifi_connect(const struct shell *shell, size_t argc, int idx = 3; if (argc < 3) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } cnx_params.ssid_length = strtol(argv[2], &endptr, 10); if (*endptr != '\0' || cnx_params.ssid_length <= 2) { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } @@ -167,7 +167,7 @@ static int cmd_wifi_connect(const struct shell *shell, size_t argc, if ((idx < argc) && (strlen(argv[idx]) <= 2)) { cnx_params.channel = strtol(argv[idx], &endptr, 10); if (*endptr != '\0') { - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; } diff --git a/subsys/shell/shell.c b/subsys/shell/shell.c index 6a4221490bc..b123a07cb83 100644 --- a/subsys/shell/shell.c +++ b/subsys/shell/shell.c @@ -89,7 +89,7 @@ static int shell_cmd_precheck(const struct shell *shell, shell->ctx->active_cmd.syntax); if (IS_ENABLED(CONFIG_SHELL_HELP_ON_WRONG_ARGUMENT_COUNT)) { - shell_help_print(shell); + shell_help(shell); } return -EINVAL; @@ -882,7 +882,7 @@ static int exec_cmd(const struct shell *shell, size_t argc, char **argv, if (help_entry.help != shell->ctx->active_cmd.help) { shell->ctx->active_cmd = help_entry; } - shell_help_print(shell); + shell_help(shell); /* 1 is return value when shell prints help */ ret_val = 1; } else { @@ -1001,7 +1001,7 @@ static int shell_execute(const struct shell *shell) */ if (help_entry.help) { shell->ctx->active_cmd = help_entry; - shell_help_print(shell); + shell_help(shell); return 1; } @@ -1434,7 +1434,7 @@ int shell_prompt_change(const struct shell *shell, char *prompt) return -1; } -void shell_help_print(const struct shell *shell) +void shell_help(const struct shell *shell) { __ASSERT_NO_MSG(shell); diff --git a/tests/bluetooth/shell/src/main.c b/tests/bluetooth/shell/src/main.c index 35823bbdd9c..6f290f5eddf 100644 --- a/tests/bluetooth/shell/src/main.c +++ b/tests/bluetooth/shell/src/main.c @@ -49,7 +49,7 @@ static int cmd_hrs_simulate(const struct shell *shell, hrs_simulate = false; } else { shell_print(shell, "Incorrect value: %s", argv[1]); - shell_help_print(shell); + shell_help(shell); return -ENOEXEC; }