Skip to content

Commit

Permalink
net: shell: vlan: Enforce arg count via shell macro
Browse files Browse the repository at this point in the history
Use the SHELL_CMD_ARG() to enforce the minimum parameter
count in vlan command.

Signed-off-by: Jukka Rissanen <[email protected]>
  • Loading branch information
jukkar authored and carlescufi committed Oct 23, 2023
1 parent 4265fe7 commit 046f002
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions subsys/net/lib/shell/vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ static int cmd_net_vlan_del(const struct shell *sh, size_t argc, char *argv[])
}

SHELL_STATIC_SUBCMD_SET_CREATE(net_cmd_vlan,
SHELL_CMD(add, NULL,
"'net vlan add <tag> <index>' adds VLAN tag to the "
"network interface.",
cmd_net_vlan_add),
SHELL_CMD(del, NULL,
"'net vlan del <tag>' deletes VLAN tag from the network "
"interface.",
cmd_net_vlan_del),
SHELL_CMD_ARG(add, NULL,
"'net vlan add <tag> <index>' adds VLAN tag to the "
"network interface.",
cmd_net_vlan_add, 3, 0),
SHELL_CMD_ARG(del, NULL,
"'net vlan del <tag>' deletes VLAN tag from the network "
"interface.",
cmd_net_vlan_del, 2, 0),
SHELL_SUBCMD_SET_END
);

Expand Down

0 comments on commit 046f002

Please sign in to comment.