aligungr/UERANSIM

nri-cli --exec sub commands with argument(s) parse error

thatsdone opened this issue · 1 comments

Hi,

I think nr-cli command implements execution of several sub commands, for example info, status, ps-list and ps-release etc.
(In this sense, there is not enough documentation of nr-cli as mentioned in #664)

I got errors for sub commands with arguments, for example, 'ps-release' like below.

At first, get node name list.

$ ./nr-cli --dump
imsi-208930000000008

'ps-list' works fine like below.

$ ./nr-cli imsi-208930000000008 --exec ps-list
PDU Session1:
 state: PS-ACTIVE
 session-type: IPv4
 apn: internet
 s-nssai:
  sst: 0x01
  sd: 0x010203
 emergency: false
 address: 10.241.0.3
 ambr: up[200Mb/s] down[100Mb/s]
 data-pending: false

nr-cli can issue PDU Session release using 'ps-relase', and the subcommand takes argument to specify PDU session ID.

$ ./nr-cli imsi-208930000000008 --exec ps-release
Trigger a PDU session release procedure
Usage:
  ps-release <pdu-session-id>...

But 'nr-cli' complains like below.

$ ./nr-cli imsi-208930000000008 --exec ps-release  1
ERROR: Only one node name is expected
$

In the above example, 'imsi-208930000000008' is the node name which nr-cli requires.
As you can see, the next token (in the above example '1') of 'ps-release' is handled as the second positional parameter, and
we got an error like above. I got the same error whatever I used for the token(s).

I think ReadOptions() has some problems.

Hi,
Sorry, I noticed that I have to double quote --exec parameters like:

$ ./nr-cli imsi-208930000000008 --exec "ps-release  1"

Actually, there are some examples in wiki (https://github.com/aligungr/UERANSIM/wiki/Usage).

I'm closing this issue, but still I'm feeling it's better to have copies of Wiki contents in the source tree.