-
Notifications
You must be signed in to change notification settings - Fork 670
Inconsistent use of -
vs --
for long options in weave script
#602
Comments
Docker is making this transition:
|
Another worthwhile convention is separating arguments to a wrapped command with
|
Do we need to maintain backward compatibilty while deprecating (ala docker)? Or are we comfortable with dropping the old syntax? |
#307 might present an opportunity for a clean break... |
@awh, agreed, that seems like a good time to fix it. |
I'm not totally sure how to do backwards compatibility, at least with go's built-in flag parser. We can add parallel vars:
But this will mean usage output gets cluttered, unless we can filter it somehow. (It also occurs to me that if we cannot have complete backwards compatibility, and we aspire to adhere to SemVer, we will probably need to bump the major version.) |
I wouldn't mind switching to getopt, which is what the proxy uses. |
Does that have special support for backward-compatibility? (largely a case of conveniently being able to support the old version of an option, while keeping it out of usage) |
No idea. But it seems closer, in terms of how options are parsed, to generally accepted usage. E.g. it has sensible semantics for specifying an option more than once (vs. "first one wins). |
Argh, OK maybe I should revise my idea of what deprecation should do. New rule: deprecated options get output in the usage message, just with "deprecated, please use ....". By the way, I don't think I can use getopt without breaking backward compatibility, since it won't parse the old, single hyphen versions of the options. Piiiiiike! |
I'd be ok with a non-backward-compatible change. |
We could add some code in the |
Easier said than done, now that I think about it. For one thing, the options are potentially context-sensitive -- it's possible (maybe?) that option-looking things appear as values. |
Oh and the other thing -- it couples the script to all executable options, even the ones it would splat through without looking at them. Mainly for that reason, I'm now looking at doing the deprecation in the exes themselves instead. |
I am now thinking I should anticipate the merge of weaveDNS and weaver by prefixing weaveDNS options with |
Most of the DNS options will go away. It's up to #826 to deal with the options. |
Sure; but I presume some will still remain (like (Not that I expect many of them would be in use, to be honest) |
will be the same as the weave http port. There are currently exactly three options pertaining to DNS in the gossip-based implementation, and one of those ( |
What about
which are still arguably relevant? |
Well, that's really up to Tom. I suggest you don't try to second-guess what gossipDNS will end up looking like. |
You mean phonetreeDNS |
Of course, by doing it in the exes, the deprecation notices go to the logs, meaning almost no-one will see them. So perhaps I'll put deprecation notices in for the arguments that are explicitly mentioned in the script usage. |
From #1035 (comment)
Looking at the complications we are running into, and the time it's taken so far, I suggest we skip the deprecation. |
Since 1.12.0, `docker inspect -f "{{ .NetworkSettings.Networks.<network>.Aliases }}"` also returns the container's short ID. See also: https://github.com/docker/docker/blob/master/CHANGELOG.md > 1.12.0 (2016-07-28) > Networking > Add container's short-id as default network alias #21901 Upgrading `docker/docker-py` to 1.9.0-rc2 effectively relaxes test assertions for: - `tests/integration/network_test.py#test_connect_with_aliases` - `tests/integration/network_test.py#test_create_with_aliases` which do something equivalent to: ``` $ docker network create net1 $ docker run --name c1 -d busybox top $ docker network connect --alias foo --alias bar net1 c1 $ docker inspect -f "{{ .NetworkSettings.Networks.net1.Aliases }}" c1 [foo bar e52bf50e5ee7] ``` allowing us to be consistent with the above change. In 1.8.1, the below fails as the container's short ID would be present: ``` self.assertEqual( container_data['NetworkSettings']['Networks'][net_name]['Aliases'], ['foo', 'bar']) ``` In 1.9.0-rc2, the below passes as the container's short ID is ignored: ``` aliases = ( container_data['NetworkSettings']['Networks'][net_name]['Aliases'] ) assert 'foo' in aliases assert 'bar' in aliases ```
Since 1.12.0, `docker inspect -f "{{ .NetworkSettings.Networks.<network>.Aliases }}"` also returns the container's short ID. See also: https://github.com/docker/docker/blob/master/CHANGELOG.md > 1.12.0 (2016-07-28) > Networking > Add container's short-id as default network alias #21901 Upgrading `docker/docker-py` to 1.9.0-rc2 effectively relaxes test assertions for: - `tests/integration/network_test.py#test_connect_with_aliases` - `tests/integration/network_test.py#test_create_with_aliases` which do something equivalent to: ``` $ docker network create net1 $ docker run --name c1 -d busybox top $ docker network connect --alias foo --alias bar net1 c1 $ docker inspect -f "{{ .NetworkSettings.Networks.net1.Aliases }}" c1 [foo bar e52bf50e5ee7] ``` allowing us to be consistent with the above change. In 1.8.1, the below fails as the container's short ID would be present: ``` self.assertEqual( container_data['NetworkSettings']['Networks'][net_name]['Aliases'], ['foo', 'bar']) ``` In 1.9.0-rc2, the below passes as the container's short ID is ignored: ``` aliases = ( container_data['NetworkSettings']['Networks'][net_name]['Aliases'] ) assert 'foo' in aliases assert 'bar' in aliases ```
Since 1.12.0, `docker inspect -f "{{ .NetworkSettings.Networks.<network>.Aliases }}"` also returns the container's short ID. See also: https://github.com/docker/docker/blob/master/CHANGELOG.md > 1.12.0 (2016-07-28) > Networking > Add container's short-id as default network alias #21901 Upgrading `docker/docker-py` to 1.9.0-rc2 effectively relaxes test assertions for: - `tests/integration/network_test.py#test_connect_with_aliases` - `tests/integration/network_test.py#test_create_with_aliases` which do something equivalent to: ``` $ docker network create net1 $ docker run --name c1 -d busybox top $ docker network connect --alias foo --alias bar net1 c1 $ docker inspect -f "{{ .NetworkSettings.Networks.net1.Aliases }}" c1 [foo bar e52bf50e5ee7] ``` allowing us to be consistent with the above change. In 1.8.1, the below fails as the container's short ID would be present: ``` self.assertEqual( container_data['NetworkSettings']['Networks'][net_name]['Aliases'], ['foo', 'bar']) ``` In 1.9.0-rc2, the below passes as the container's short ID is ignored: ``` aliases = ( container_data['NetworkSettings']['Networks'][net_name]['Aliases'] ) assert 'foo' in aliases assert 'bar' in aliases ```
Since 1.12.0, `docker inspect -f "{{ .NetworkSettings.Networks.<network>.Aliases }}"` also returns the container's short ID. See also: https://github.com/docker/docker/blob/master/CHANGELOG.md > 1.12.0 (2016-07-28) > Networking > Add container's short-id as default network alias #21901 Upgrading `docker/docker-py` to 1.9.0-rc2 effectively relaxes test assertions for: - `tests/integration/network_test.py#test_connect_with_aliases` - `tests/integration/network_test.py#test_create_with_aliases` which do something equivalent to: ``` $ docker network create net1 $ docker run --name c1 -d busybox top $ docker network connect --alias foo --alias bar net1 c1 $ docker inspect -f "{{ .NetworkSettings.Networks.net1.Aliases }}" c1 [foo bar e52bf50e5ee7] ``` allowing us to be consistent with the above change. In 1.8.1, the below fails as the container's short ID would be present: ``` self.assertEqual( container_data['NetworkSettings']['Networks'][net_name]['Aliases'], ['foo', 'bar']) ``` In 1.9.0-rc2, the below passes as the container's short ID is ignored: ``` aliases = ( container_data['NetworkSettings']['Networks'][net_name]['Aliases'] ) assert 'foo' in aliases assert 'bar' in aliases ```
Since 1.12.0, `docker inspect -f "{{ .NetworkSettings.Networks.<network>.Aliases }}"` also returns the container's short ID. See also: https://github.com/docker/docker/blob/master/CHANGELOG.md > 1.12.0 (2016-07-28) > Networking > Add container's short-id as default network alias #21901 Upgrading `docker/docker-py` to 1.9.0-rc2 effectively relaxes test assertions for: - `tests/integration/network_test.py#test_connect_with_aliases` - `tests/integration/network_test.py#test_create_with_aliases` which do something equivalent to: ``` $ docker network create net1 $ docker run --name c1 -d busybox top $ docker network connect --alias foo --alias bar net1 c1 $ docker inspect -f "{{ .NetworkSettings.Networks.net1.Aliases }}" c1 [foo bar e52bf50e5ee7] ``` allowing us to be consistent with the above change. In 1.8.1, the below fails as the container's short ID would be present: ``` self.assertEqual( container_data['NetworkSettings']['Networks'][net_name]['Aliases'], ['foo', 'bar']) ``` In 1.9.0-rc2, the below passes as the container's short ID is ignored: ``` aliases = ( container_data['NetworkSettings']['Networks'][net_name]['Aliases'] ) assert 'foo' in aliases assert 'bar' in aliases ```
Since 1.12.0, `docker inspect -f "{{ .NetworkSettings.Networks.<network>.Aliases }}"` also returns the container's short ID. See also: https://github.com/docker/docker/blob/master/CHANGELOG.md > 1.12.0 (2016-07-28) > Networking > Add container's short-id as default network alias #21901 Upgrading `docker/docker-py` to 1.9.0-rc2 effectively relaxes test assertions for: - `tests/integration/network_test.py#test_connect_with_aliases` - `tests/integration/network_test.py#test_create_with_aliases` which do something equivalent to: ``` $ docker network create net1 $ docker run --name c1 -d busybox top $ docker network connect --alias foo --alias bar net1 c1 $ docker inspect -f "{{ .NetworkSettings.Networks.net1.Aliases }}" c1 [foo bar e52bf50e5ee7] ``` allowing us to be consistent with the above change. In 1.8.1, the below fails as the container's short ID would be present: ``` self.assertEqual( container_data['NetworkSettings']['Networks'][net_name]['Aliases'], ['foo', 'bar']) ``` In 1.9.0-rc2, the below passes as the container's short ID is ignored: ``` aliases = ( container_data['NetworkSettings']['Networks'][net_name]['Aliases'] ) assert 'foo' in aliases assert 'bar' in aliases ```
Since 1.12.0, `docker inspect -f "{{ .NetworkSettings.Networks.<network>.Aliases }}"` also returns the container's short ID. See also: https://github.com/docker/docker/blob/master/CHANGELOG.md > 1.12.0 (2016-07-28) > Networking > Add container's short-id as default network alias #21901 Upgrading `docker/docker-py` to 1.9.0-rc2 effectively relaxes test assertions for: - `tests/integration/network_test.py#test_connect_with_aliases` - `tests/integration/network_test.py#test_create_with_aliases` which do something equivalent to: ``` $ docker network create net1 $ docker run --name c1 -d busybox top $ docker network connect --alias foo --alias bar net1 c1 $ docker inspect -f "{{ .NetworkSettings.Networks.net1.Aliases }}" c1 [foo bar e52bf50e5ee7] ``` allowing us to be consistent with the above change. In 1.8.1, the below fails as the container's short ID would be present: ``` self.assertEqual( container_data['NetworkSettings']['Networks'][net_name]['Aliases'], ['foo', 'bar']) ``` In 1.9.0-rc2, the below passes as the container's short ID is ignored: ``` aliases = ( container_data['NetworkSettings']['Networks'][net_name]['Aliases'] ) assert 'foo' in aliases assert 'bar' in aliases ```
Since 1.12.0, `docker inspect -f "{{ .NetworkSettings.Networks.<network>.Aliases }}"` also returns the container's short ID. See also: https://github.com/docker/docker/blob/master/CHANGELOG.md > 1.12.0 (2016-07-28) > Networking > Add container's short-id as default network alias #21901 Upgrading `docker/docker-py` to 1.9.0-rc2 effectively relaxes test assertions for: - `tests/integration/network_test.py#test_connect_with_aliases` - `tests/integration/network_test.py#test_create_with_aliases` which do something equivalent to: ``` $ docker network create net1 $ docker run --name c1 -d busybox top $ docker network connect --alias foo --alias bar net1 c1 $ docker inspect -f "{{ .NetworkSettings.Networks.net1.Aliases }}" c1 [foo bar e52bf50e5ee7] ``` allowing us to be consistent with the above change. In 1.8.1, the below fails as the container's short ID would be present: ``` self.assertEqual( container_data['NetworkSettings']['Networks'][net_name]['Aliases'], ['foo', 'bar']) ``` In 1.9.0-rc2, the below passes as the container's short ID is ignored: ``` aliases = ( container_data['NetworkSettings']['Networks'][net_name]['Aliases'] ) assert 'foo' in aliases assert 'bar' in aliases ```
Since 1.12.0, `docker inspect -f "{{ .NetworkSettings.Networks.<network>.Aliases }}"` also returns the container's short ID. See also: https://github.com/docker/docker/blob/master/CHANGELOG.md > 1.12.0 (2016-07-28) > Networking > Add container's short-id as default network alias #21901 Upgrading `docker/docker-py` to 1.9.0-rc2 effectively relaxes test assertions for: - `tests/integration/network_test.py#test_connect_with_aliases` - `tests/integration/network_test.py#test_create_with_aliases` which do something equivalent to: ``` $ docker network create net1 $ docker run --name c1 -d busybox top $ docker network connect --alias foo --alias bar net1 c1 $ docker inspect -f "{{ .NetworkSettings.Networks.net1.Aliases }}" c1 [foo bar e52bf50e5ee7] ``` allowing us to be consistent with the above change. In 1.8.1, the below fails as the container's short ID would be present: ``` self.assertEqual( container_data['NetworkSettings']['Networks'][net_name]['Aliases'], ['foo', 'bar']) ``` In 1.9.0-rc2, the below passes as the container's short ID is ignored: ``` aliases = ( container_data['NetworkSettings']['Networks'][net_name]['Aliases'] ) assert 'foo' in aliases assert 'bar' in aliases ```
Since 1.12.0, `docker inspect -f "{{ .NetworkSettings.Networks.<network>.Aliases }}"` also returns the container's short ID. See also: https://github.com/docker/docker/blob/master/CHANGELOG.md > 1.12.0 (2016-07-28) > Networking > Add container's short-id as default network alias #21901 Upgrading `docker/docker-py` to 1.9.0-rc2 effectively relaxes test assertions for: - `tests/integration/network_test.py#test_connect_with_aliases` - `tests/integration/network_test.py#test_create_with_aliases` which do something equivalent to: ``` $ docker network create net1 $ docker run --name c1 -d busybox top $ docker network connect --alias foo --alias bar net1 c1 $ docker inspect -f "{{ .NetworkSettings.Networks.net1.Aliases }}" c1 [foo bar e52bf50e5ee7] ``` allowing us to be consistent with the above change. In 1.8.1, the below fails as the container's short ID would be present: ``` self.assertEqual( container_data['NetworkSettings']['Networks'][net_name]['Aliases'], ['foo', 'bar']) ``` In 1.9.0-rc2, the below passes as the container's short ID is ignored: ``` aliases = ( container_data['NetworkSettings']['Networks'][net_name]['Aliases'] ) assert 'foo' in aliases assert 'bar' in aliases ```
Since 1.12.0, `docker inspect -f "{{ .NetworkSettings.Networks.<network>.Aliases }}"` also returns the container's short ID. See also: https://github.com/docker/docker/blob/master/CHANGELOG.md > 1.12.0 (2016-07-28) > Networking > Add container's short-id as default network alias #21901 Upgrading `docker/docker-py` to 1.9.0-rc2 effectively relaxes test assertions for: - `tests/integration/network_test.py#test_connect_with_aliases` - `tests/integration/network_test.py#test_create_with_aliases` which do something equivalent to: ``` $ docker network create net1 $ docker run --name c1 -d busybox top $ docker network connect --alias foo --alias bar net1 c1 $ docker inspect -f "{{ .NetworkSettings.Networks.net1.Aliases }}" c1 [foo bar e52bf50e5ee7] ``` allowing us to be consistent with the above change. In 1.8.1, the below fails as the container's short ID would be present: ``` self.assertEqual( container_data['NetworkSettings']['Networks'][net_name]['Aliases'], ['foo', 'bar']) ``` In 1.9.0-rc2, the below passes as the container's short ID is ignored: ``` aliases = ( container_data['NetworkSettings']['Networks'][net_name]['Aliases'] ) assert 'foo' in aliases assert 'bar' in aliases ```
Since 1.12.0, `docker inspect -f "{{ .NetworkSettings.Networks.<network>.Aliases }}"` also returns the container's short ID. See also: https://github.com/docker/docker/blob/master/CHANGELOG.md > 1.12.0 (2016-07-28) > Networking > Add container's short-id as default network alias #21901 Upgrading `docker/docker-py` to 1.9.0-rc2 effectively relaxes test assertions for: - `tests/integration/network_test.py#test_connect_with_aliases` - `tests/integration/network_test.py#test_create_with_aliases` which do something equivalent to: ``` $ docker network create net1 $ docker run --name c1 -d busybox top $ docker network connect --alias foo --alias bar net1 c1 $ docker inspect -f "{{ .NetworkSettings.Networks.net1.Aliases }}" c1 [foo bar e52bf50e5ee7] ``` allowing us to be consistent with the above change. In 1.8.1, the below fails as the container's short ID would be present: ``` self.assertEqual( container_data['NetworkSettings']['Networks'][net_name]['Aliases'], ['foo', 'bar']) ``` In 1.9.0-rc2, the below passes as the container's short ID is ignored: ``` aliases = ( container_data['NetworkSettings']['Networks'][net_name]['Aliases'] ) assert 'foo' in aliases assert 'bar' in aliases ```
For example
-password
vs--with-dns
.--
is the convention for long options on GNU/Linux, we should support it and deprecate the other forms.The text was updated successfully, but these errors were encountered: