Re: [PATCH v2 4/4] shared/shell: Print usage when no argument generator is set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Luiz,

Thank you for dealing with my request.

On 11/28/2017 01:17 AM, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
> 
> This prints the command and arguments if the command don't provide
> a generator so one don't have to always resort to help for checking it.
> ---
>  src/shared/shell.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/src/shared/shell.c b/src/shared/shell.c
> index 73aedaf79..bd5cf18fc 100644
> --- a/src/shared/shell.c
> +++ b/src/shared/shell.c
> @@ -527,8 +527,12 @@ static char **menu_completion(const struct bt_shell_menu_entry *entry,
>  		if (strcmp(entry->cmd, input_cmd))
>  			continue;
>  
> -		if (!entry->gen)
> -			continue;
> +		if (!entry->gen) {
> +			if (text[0] == '\0')
> +				bt_shell_printf("Usage: %s %s\n", entry->cmd,
> +								entry->arg);

If entry->arg is NULL, it prints out "(null)" on my box.


Regards,
Eramoto

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux