How can I use names that start with "-" with the CLI?

asked 2015-02-25 19:22:07 -0600

melwitt gravatar image

Example: trying to create a security group named "-securitygroup" the following error is raised:

nova secgroup-create -securitygroup "a description"

usage: nova secgroup-create <name> <description>
error: too few arguments
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-02-25 19:27:21 -0600

melwitt gravatar image

updated 2015-05-15 16:52:14 -0600

This is an issue with the shell interpreting -securitygroup as an option rather than a name.

The solution here is to use "--" to signify the end of command options to the shell and have "-securitygroup" interpreted as a positional argument.

nova secgroup-create -- -securitygroup "a description"

Other examples:

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-02-25 19:21:42 -0600

Seen: 105 times

Last updated: May 15 '15