-
Notifications
You must be signed in to change notification settings - Fork 673
Conversation
So no |
The mflag library will in general treat |
Yes, but the script doesn't. |
Oh I see. Are you saying it did before and it doesn't now? |
No, it didn't, but it seems odd for the exe to support it (if it did so previously then that was by accident) but not the script. Same goes for any short options. |
The script doesn't in general support it because no-one thought to implement it (probably because it's a bit of a pain, unless you happen to be messing around with the arguments anyway, as in the case of The exes do support that style because the mflag package happens to support that. As does the flag package. In other words, nothing has changed on that front. |
I actually didn't know it worked.
Only very slightly. I see no reason why the |
OK, I agree that would be nice, but I'm not trying to address that here, only to rename the options in a backwards-compatible way. |
@paulbellamy would you mind reviewing this? |
Is this also supposed to close #1035? |
That was the thing I actually wanted to fix, yes good point. |
echo "weave launch [--password <password>] [--nickname <nickname>] [--no-discovery]" | ||
echo " [--ipalloc-range <cidr> [--ipalloc-default-subnet <cidr>]]" | ||
echo " [--init-peer-count <count>] <peer> ..." | ||
echo "weave launch-router [--password <password>] [--nickname <nickname>]" |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
27e7b43
to
af6f421
Compare
@@ -15,6 +15,23 @@ var ( | |||
defaultListenAddrs = []string{"tcp://0.0.0.0:12375", "unix:///var/run/weave.sock"} | |||
) | |||
|
|||
type listOpts struct { | |||
values *[]string |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
af6f421
to
c9145e8
Compare
shift | ||
done | ||
} | ||
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
There are remaining references to single-hyphen flags in: |
Nice spotting, thank you :) |
c9145e8
to
2b2c892
Compare
Hyphenate words, and always expect double dashes for long options. A small number of options have entirely new names. In general I have added aliases for the unhyphenated and single-dashed varieties, and used mflag's deprecation syntax to make it print a warning when it sees them. I left some abbreviated options unhyphenated (e.g., `bufsz`), and the TLS options as-is since they correspond with Docker options. NB the deprecation wanrings will mostly get printed to container logs, since mostly the executables are run in containers. The next step is to emit warnings from the script for the options mentioned in the script usage message.
2b2c892
to
4ede334
Compare
The usage is rearranged slightly to avoid wrapping at 80 characters. This will tend to overestimate warnings, since it doesn't try very hard to ignore values that are not intended to be options; in particular, arguments that are intended for `docker run`. (Using `--` to delimit these arguments would make this easier!) It does ignore values that follow known options though, for instance in weave -nickname "-password" (-nickname results in a deprecation warning, -password does not) and weave --password "-iprange" (no deprecation warning, since -iprange is ignored)
Namely:
--password
; and,--no-discovery
; and,dns
prepended, e.g.,--dns-port
.There are exceptions; "ipalloc" is treated as one word for hyphenation; the
--tls*
options are left as-is since they correspond to Docker options; some niche options don't get hyphenated e.g.,--bufsz
; some options that are likely to disappear are left alone.In all cases, the old version of an option will work, while outputting a deprecation warning. Mostly these will end up in container logs. Renamed options that are mentioned in the script usage, or otherwise specially-treated in the script, have a deprecation notice output to the console.
Closes #602 and closes #1035.