Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canonical syntax of vnctl command line options #522

Open
miz-axsh opened this issue Feb 15, 2017 · 0 comments
Open

Canonical syntax of vnctl command line options #522

miz-axsh opened this issue Feb 15, 2017 · 0 comments

Comments

@miz-axsh
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant