[ot-ctl] support no separator -- (#6606)

With this change, both the following command should work:

ot-ctl -I wpan0 pskc -p 123456
ot-ctl -I wpan0 -- pskc -p 123456
This commit is contained in:
Yakun Xu
2021-05-11 12:14:05 +08:00
committed by GitHub
parent 5078dfcc64
commit 0f65243d63
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -124,6 +124,9 @@ do_check()
OT_CTL="$PWD/build/posix/src/posix/ot-ctl"
sudo "${OT_CTL}" -I "${NETIF_NAME}" panid 0xface | grep 'Done' || die 'failed to set panid with ot-ctl'
# verify supports options in OpenThread commands without separator --
sudo "${OT_CTL}" -I "${NETIF_NAME}" pskc -p 123456 | grep 'Done' || die 'unable to set pskc'
# verify this reset and factoryreset end immediately
sudo "${OT_CTL}" -I "${NETIF_NAME}" reset
# sleep a while for daemon ready
+1 -1
View File
@@ -208,7 +208,7 @@ Config ParseArg(int &aArgCount, char **&aArgVector)
optind = 1;
for (int index, option; (option = getopt_long(aArgCount, aArgVector, "I:h", kOptions, &index)) != -1;)
for (int index, option; (option = getopt_long(aArgCount, aArgVector, "+I:h", kOptions, &index)) != -1;)
{
switch (option)
{