diff options
| author | Damian Johnson <atagar@torproject.org> | 2018-12-30 11:17:22 -0800 |
|---|---|---|
| committer | Damian Johnson <atagar@torproject.org> | 2018-12-30 11:23:01 -0800 |
| commit | 54532316fd15f0bb95b2f883873d432beee68e91 (patch) | |
| tree | b3fff98439937eb697bb8a273d6373da67ea5348 | |
| parent | 65e2f7e1934a74e5e64bff7f90e73f2bb30511cb (diff) | |
Accept extra ':' in --interface argument
traumschule made the interesting point that it would be nice if 'nyx -i :9051'
worked. We actually *do* make the address optional, but not if the user
provides a collon (ie, 'nyx -i 9051').
Accepting this as well.
| -rw-r--r-- | nyx/arguments.py | 8 | ||||
| -rw-r--r-- | web/changelog/index.html | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/nyx/arguments.py b/nyx/arguments.py index 76c7a99..e348a9b 100644 --- a/nyx/arguments.py +++ b/nyx/arguments.py @@ -82,14 +82,18 @@ def parse(argv): for opt, arg in recognized_args: if opt in ('-i', '--interface'): + address = None + if ':' in arg: address, port = arg.split(':', 1) else: - address, port = args['control_port'][0], arg + port = arg - if address is not None: + if address: if not stem.util.connection.is_valid_ipv4_address(address): raise ValueError("'%s' isn't a valid IPv4 address" % address) + else: + address = args['control_port'][0] if not stem.util.connection.is_valid_port(port): raise ValueError("'%s' isn't a valid port number" % port) diff --git a/web/changelog/index.html b/web/changelog/index.html index 1b96d9e..0bbc01a 100644 --- a/web/changelog/index.html +++ b/web/changelog/index.html @@ -76,6 +76,7 @@ <li>Process renaming could potentially crash (<a href="https://trac.torproject.org/projects/tor/ticket/27556">ticket</a>)</li> <li>Blank debug path caused us to crash (<a href="https://trac.torproject.org/projects/tor/ticket/27350">ticket</a>)</li> <li>Nyxrc <i>password</i> option for the controller credential (<a href="https://trac.torproject.org/projects/tor/ticket/28295">ticket</a>)</li> + <li>Accept shorthand '--interface' arugments with a colon but no address (<a href="https://trac.torproject.org/projects/tor/ticket/28965">ticket</a>)</li> </ul> </li> |
