axsh/openvnet

Canonical syntax of vnctl command line options

Opened this issue · 0 comments

I think unified syntax should be used for vnctl command line options. Currently, two types of syntax are used for GNU-style long options, with and without = (equal sign).

In the web documentation, options and arguments are separated by spaces:

vnctl datapaths add --uuid dp-test1 --display-name test1 --dpid 0x0000aaaaaaaaaaaa --node-id vna

On the other hand, vnctl help uses equal sign style:

% vnctl datapaths help add
Usage:
  vnctl datapaths add [OPTIONS] --display-name=DISPLAY_NAME --dpid=DPID --node-id=NODE_ID

This confuses novice users, but it's not the only reason why we should unify the syntax. The most important thing is to improve ci testing. There is a possibility that other programs or scripts invoke vnctl. Which syntax is tested in such cases?
In C, getopt_long(3) requires equal signs only for optional arguments, unlike for mandatory arguments. Thus, they may yield different results.
http://stackoverflow.com/questions/1052746/getopt-does-not-parse-optional-arguments-to-parameters

I prefer and recommend the syntax with equal sign, the same style as ovs-vsctl.