-
Notifications
You must be signed in to change notification settings - Fork 141
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
generate: make AddBindMount() options a slice #265
Conversation
Through 878097f looks good to me. On Sun, Nov 06, 2016 at 04:58:24AM -0800, Aleksa Sarai wrote:
+1. |
@@ -17,7 +17,7 @@ var generateFlags = []cli.Flag{ | |||
cli.StringFlag{Name: "apparmor", Usage: "specifies the the apparmor profile for the container"}, | |||
cli.StringFlag{Name: "arch", Value: runtime.GOARCH, Usage: "architecture the container is created for"}, | |||
cli.StringSliceFlag{Name: "args", Usage: "command to run in the container"}, | |||
cli.StringSliceFlag{Name: "bind", Usage: "bind mount directories src:dest:(rw,ro)"}, | |||
cli.StringSliceFlag{Name: "bind", Usage: "bind mount directories src:dest[:option1:option2:...]"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about change it to [:options]
?
[***]
just means this can be set multiple times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my experience with Unix commands, [something]
means that its optional. [something...]
means it can be set more than once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @cyphar, and there are docs for this in http://man7.org/linux/man-pages/man7/man-pages.7.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I didn't find any rules about multiple options format in man7.
But from most of pages in man-pages, [:options]
or [:options...]
or [:options]...
are all acceptable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From man-pages(7):
Brackets (
[]
) surround optional arguments, vertical bars (|
) separate choices, and ellipses (...
) can be repeated.
default: | ||
return source, dest, options, fmt.Errorf("--bind should have format src:dest:[options]") | ||
return source, dest, options, fmt.Errorf("--bind should have format src:dest[:option1:option2:...]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment as above
@@ -29,15 +29,15 @@ read the configuration from `config.json`. | |||
|
|||
--args "/usr/bin/httpd" --args "-D" --args "FOREGROUND" | |||
|
|||
**--bind**=*[[HOST-DIR:CONTAINER-DIR][:OPTIONS]]* | |||
**--bind**=*[[HOST-DIR:CONTAINER-DIR][:OPTIONS:...]]* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is no need to add ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think most commands have the ...
suffix if you can specify multiple of a type. But I'll change it.
This allows for the set of options to be more useful than just "rw" or "ro". It also makes it match the AddTmpfsMount far more. Signed-off-by: Aleksa Sarai <asarai@suse.com>
878097f
to
038b0c9
Compare
@Mashimiao I changed to |
On 11/07/2016 12:36 PM, W. Trevor King wrote:
Oh, it really is, thanks for your information. |
This allows for the set of options to be more useful than just "rw" or
"ro". It also makes it match the AddTmpfsMount far more.
We should also probably implement
AddMount
which just simplyadds a mount.
Signed-off-by: Aleksa Sarai asarai@suse.com