Skip to content

Commit 0738e1f

Browse files
Jakub Rzeszutkocarlescufi
authored andcommitted
shell: remove unused function shell_command_add
This function is not used at all. Signed-off-by: Jakub Rzeszutko <[email protected]>
1 parent 0eea85b commit 0738e1f

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

subsys/shell/shell_utils.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -357,35 +357,8 @@ int shell_set_root_cmd(const char *cmd)
357357
return 0;
358358
}
359359

360-
int shell_command_add(char *buff, uint16_t *buff_len,
361-
const char *new_cmd, const char *pattern)
362-
{
363-
uint16_t cmd_len = shell_strlen(new_cmd);
364-
char *cmd_source_addr;
365-
uint16_t shift;
366-
367-
/* +1 for space */
368-
if ((*buff_len + cmd_len + 1) > CONFIG_SHELL_CMD_BUFF_SIZE) {
369-
return -ENOMEM;
370-
}
371-
372-
cmd_source_addr = strstr(buff, pattern);
373-
374-
if (!cmd_source_addr) {
375-
return -EINVAL;
376-
}
377-
378-
shift = shell_strlen(cmd_source_addr);
379360

380-
/* make place for new command: + 1 for space + 1 for EOS */
381-
memmove(cmd_source_addr + cmd_len + 1, cmd_source_addr, shift + 1);
382-
memcpy(cmd_source_addr, new_cmd, cmd_len);
383-
cmd_source_addr[cmd_len] = ' ';
384361

385-
*buff_len += cmd_len + 1; /* + 1 for space */
386-
387-
return 0;
388-
}
389362

390363
void shell_spaces_trim(char *str)
391364
{

subsys/shell/shell_utils.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ const struct shell_static_entry *shell_get_last_command(
7777
struct shell_static_entry *dloc,
7878
bool only_static);
7979

80-
int shell_command_add(char *buff, uint16_t *buff_len,
81-
const char *new_cmd, const char *pattern);
82-
8380
const struct shell_static_entry *shell_root_cmd_find(const char *syntax);
8481

8582
void shell_spaces_trim(char *str);

0 commit comments

Comments
 (0)