We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Update socks mode access commandline + documentation (v3.0.2)
##### Steps to reproduce the problem:
1. mitmproxy --socks
"--socks is deprecated 
Please use '--set socks=value' instead"
2. Check online documentation at:
https://mitmproxy.org/docs/latest/concepts-modes/#socks-proxy
3. Check mitmproxy --help

##### Any other comments? What have you tried so far?
1. The advice given here doesn't appear to work (no combinations I tried were accepted).
2. The online documentation stops at Socks Proxy (no content)
3. The --help text shows the correct method (--mode socks5)

##### System information
Mitmproxy: 3.0.2
Python:    3.5.5rc1
OpenSSL:   OpenSSL 1.0.1f 6 Jan 2014
Platform:  Linux-2.6.39.4-kat124-ga627d40-armv7l-with-debian-jessie-sid

(Android: KatKiss Marshmallow hosting Linux Deploy: Ubuntu Trusty [armhf] using pyenv)

<!-- Please use the mitmproxy forums (https://discourse.mitmproxy.org/) for support/how-to questions. Thanks! :) -->


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mitmproxy/utils/arg_check.py`
Content:
```
1 import sys
2 
3 DEPRECATED = """
4 --cadir
5 -Z
6 --body-size-limit
7 --stream
8 --palette
9 --palette-transparent
10 --follow
11 --order
12 --no-mouse
13 --reverse
14 --socks
15 --http2-priority
16 --no-http2-priority
17 --no-websocket
18 --websocket
19 --spoof-source-address
20 --upstream-bind-address
21 --ciphers-client
22 --ciphers-server
23 --client-certs
24 --no-upstream-cert
25 --add-upstream-certs-to-client-chain
26 --upstream-trusted-cadir
27 --upstream-trusted-ca
28 --ssl-version-client
29 --ssl-version-server
30 --no-onboarding
31 --onboarding-host
32 --onboarding-port
33 --server-replay-use-header
34 --no-pop
35 --replay-ignore-content
36 --replay-ignore-payload-param
37 --replay-ignore-param
38 --replay-ignore-host
39 --replace-from-file
40 """
41 
42 REPLACED = """
43 -t
44 -u
45 --wfile
46 -a
47 --afile
48 -z
49 -b
50 --bind-address
51 --port
52 -I
53 --ignore
54 --tcp
55 --cert
56 --insecure
57 -c
58 --replace
59 -i
60 -f
61 --filter
62 """
63 
64 REPLACEMENTS = {
65     "--stream": "stream_large_bodies",
66     "--palette": "console_palette",
67     "--palette-transparent": "console_palette_transparent:",
68     "--follow": "console_focus_follow",
69     "--order": "view_order",
70     "--no-mouse": "console_mouse",
71     "--reverse": "view_order_reversed",
72     "--no-http2-priority": "http2_priority",
73     "--no-websocket": "websocket",
74     "--no-upstream-cert": "upstream_cert",
75     "--upstream-trusted-cadir": "ssl_verify_upstream_trusted_cadir",
76     "--upstream-trusted-ca": "ssl_verify_upstream_trusted_ca",
77     "--no-onboarding": "onboarding",
78     "--no-pop": "server_replay_nopop",
79     "--replay-ignore-content": "server_replay_ignore_content",
80     "--replay-ignore-payload-param": "server_replay_ignore_payload_params",
81     "--replay-ignore-param": "server_replay_ignore_params",
82     "--replay-ignore-host": "server_replay_ignore_host",
83     "--replace-from-file": "replacements (use @ to specify path)",
84     "-t": "--stickycookie",
85     "-u": "--stickyauth",
86     "--wfile": "--save-stream-file",
87     "-a": "-w  Prefix path with + to append.",
88     "--afile": "-w  Prefix path with + to append.",
89     "-z": "--anticomp",
90     "-b": "--listen-host",
91     "--bind-address": "--listen-host",
92     "--port": "--listen-port",
93     "-I": "--ignore-hosts",
94     "--ignore": "--ignore-hosts",
95     "--tcp": "--tcp-hosts",
96     "--cert": "--certs",
97     "--insecure": "--ssl-insecure",
98     "-c": "-C",
99     "--replace": "--replacements",
100     "-i": "--intercept",
101     "-f": "--view-filter",
102     "--filter": "--view-filter"
103 }
104 
105 
106 def check():
107     args = sys.argv[1:]
108     print()
109     if "-U" in args:
110         print("-U is deprecated, please use --mode upstream:SPEC instead")
111 
112     if "-T" in args:
113         print("-T is deprecated, please use --mode transparent instead")
114 
115     for option in ("-e", "--eventlog", "--norefresh"):
116         if option in args:
117             print("{} has been removed.".format(option))
118 
119     for option in ("--nonanonymous", "--singleuser", "--htpasswd"):
120         if option in args:
121             print(
122                 '{} is deprecated.\n'
123                 'Please use `--proxyauth SPEC` instead.\n'
124                 'SPEC Format: "username:pass", "any" to accept any user/pass combination,\n'
125                 '"@path" to use an Apache htpasswd file, or\n'
126                 '"ldap[s]:url_server_ldap:dn_auth:password:dn_subtree" '
127                 'for LDAP authentication.'.format(option))
128 
129     for option in REPLACED.splitlines():
130         if option in args:
131             print(
132                 "{} is deprecated.\n"
133                 "Please use `{}` instead.".format(
134                     option,
135                     REPLACEMENTS.get(option)
136                 )
137             )
138 
139     for option in DEPRECATED.splitlines():
140         if option in args:
141             print(
142                 "{} is deprecated.\n"
143                 "Please use `--set {}=value` instead.\n"
144                 "To show all options and their default values use --options".format(
145                     option,
146                     REPLACEMENTS.get(option, None) or option.lstrip("-").replace("-", "_")
147                 )
148             )
149
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/mitmproxy/utils/arg_check.py b/mitmproxy/utils/arg_check.py
--- a/mitmproxy/utils/arg_check.py
+++ b/mitmproxy/utils/arg_check.py
@@ -11,7 +11,6 @@
 --order
 --no-mouse
 --reverse
---socks
 --http2-priority
 --no-http2-priority
 --no-websocket
@@ -59,6 +58,7 @@
 -i
 -f
 --filter
+--socks
 """
 
 REPLACEMENTS = {
@@ -99,7 +99,8 @@
     "--replace": "--replacements",
     "-i": "--intercept",
     "-f": "--view-filter",
-    "--filter": "--view-filter"
+    "--filter": "--view-filter",
+    "--socks": "--mode socks5"
 }

{"golden_diff": "diff --git a/mitmproxy/utils/arg_check.py b/mitmproxy/utils/arg_check.py\n--- a/mitmproxy/utils/arg_check.py\n+++ b/mitmproxy/utils/arg_check.py\n@@ -11,7 +11,6 @@\n --order\n --no-mouse\n --reverse\n---socks\n --http2-priority\n --no-http2-priority\n --no-websocket\n@@ -59,6 +58,7 @@\n -i\n -f\n --filter\n+--socks\n \"\"\"\n \n REPLACEMENTS = {\n@@ -99,7 +99,8 @@\n     \"--replace\": \"--replacements\",\n     \"-i\": \"--intercept\",\n     \"-f\": \"--view-filter\",\n-    \"--filter\": \"--view-filter\"\n+    \"--filter\": \"--view-filter\",\n+    \"--socks\": \"--mode socks5\"\n }\n", "issue": "Update socks mode access commandline + documentation (v3.0.2)\n##### Steps to reproduce the problem:\r\n1. mitmproxy --socks\r\n\"--socks is deprecated \r\nPlease use '--set socks=value' instead\"\r\n2. Check online documentation at:\r\nhttps://mitmproxy.org/docs/latest/concepts-modes/#socks-proxy\r\n3. Check mitmproxy --help\r\n\r\n##### Any other comments? What have you tried so far?\r\n1. The advice given here doesn't appear to work (no combinations I tried were accepted).\r\n2. The online documentation stops at Socks Proxy (no content)\r\n3. The --help text shows the correct method (--mode socks5)\r\n\r\n##### System information\r\nMitmproxy: 3.0.2\r\nPython:    3.5.5rc1\r\nOpenSSL:   OpenSSL 1.0.1f 6 Jan 2014\r\nPlatform:  Linux-2.6.39.4-kat124-ga627d40-armv7l-with-debian-jessie-sid\r\n\r\n(Android: KatKiss Marshmallow hosting Linux Deploy: Ubuntu Trusty [armhf] using pyenv)\r\n\r\n<!-- Please use the mitmproxy forums (https://discourse.mitmproxy.org/) for support/how-to questions. Thanks! :) -->\r\n\n", "before_files": [{"content": "import sys\n\nDEPRECATED = \"\"\"\n--cadir\n-Z\n--body-size-limit\n--stream\n--palette\n--palette-transparent\n--follow\n--order\n--no-mouse\n--reverse\n--socks\n--http2-priority\n--no-http2-priority\n--no-websocket\n--websocket\n--spoof-source-address\n--upstream-bind-address\n--ciphers-client\n--ciphers-server\n--client-certs\n--no-upstream-cert\n--add-upstream-certs-to-client-chain\n--upstream-trusted-cadir\n--upstream-trusted-ca\n--ssl-version-client\n--ssl-version-server\n--no-onboarding\n--onboarding-host\n--onboarding-port\n--server-replay-use-header\n--no-pop\n--replay-ignore-content\n--replay-ignore-payload-param\n--replay-ignore-param\n--replay-ignore-host\n--replace-from-file\n\"\"\"\n\nREPLACED = \"\"\"\n-t\n-u\n--wfile\n-a\n--afile\n-z\n-b\n--bind-address\n--port\n-I\n--ignore\n--tcp\n--cert\n--insecure\n-c\n--replace\n-i\n-f\n--filter\n\"\"\"\n\nREPLACEMENTS = {\n    \"--stream\": \"stream_large_bodies\",\n    \"--palette\": \"console_palette\",\n    \"--palette-transparent\": \"console_palette_transparent:\",\n    \"--follow\": \"console_focus_follow\",\n    \"--order\": \"view_order\",\n    \"--no-mouse\": \"console_mouse\",\n    \"--reverse\": \"view_order_reversed\",\n    \"--no-http2-priority\": \"http2_priority\",\n    \"--no-websocket\": \"websocket\",\n    \"--no-upstream-cert\": \"upstream_cert\",\n    \"--upstream-trusted-cadir\": \"ssl_verify_upstream_trusted_cadir\",\n    \"--upstream-trusted-ca\": \"ssl_verify_upstream_trusted_ca\",\n    \"--no-onboarding\": \"onboarding\",\n    \"--no-pop\": \"server_replay_nopop\",\n    \"--replay-ignore-content\": \"server_replay_ignore_content\",\n    \"--replay-ignore-payload-param\": \"server_replay_ignore_payload_params\",\n    \"--replay-ignore-param\": \"server_replay_ignore_params\",\n    \"--replay-ignore-host\": \"server_replay_ignore_host\",\n    \"--replace-from-file\": \"replacements (use @ to specify path)\",\n    \"-t\": \"--stickycookie\",\n    \"-u\": \"--stickyauth\",\n    \"--wfile\": \"--save-stream-file\",\n    \"-a\": \"-w  Prefix path with + to append.\",\n    \"--afile\": \"-w  Prefix path with + to append.\",\n    \"-z\": \"--anticomp\",\n    \"-b\": \"--listen-host\",\n    \"--bind-address\": \"--listen-host\",\n    \"--port\": \"--listen-port\",\n    \"-I\": \"--ignore-hosts\",\n    \"--ignore\": \"--ignore-hosts\",\n    \"--tcp\": \"--tcp-hosts\",\n    \"--cert\": \"--certs\",\n    \"--insecure\": \"--ssl-insecure\",\n    \"-c\": \"-C\",\n    \"--replace\": \"--replacements\",\n    \"-i\": \"--intercept\",\n    \"-f\": \"--view-filter\",\n    \"--filter\": \"--view-filter\"\n}\n\n\ndef check():\n    args = sys.argv[1:]\n    print()\n    if \"-U\" in args:\n        print(\"-U is deprecated, please use --mode upstream:SPEC instead\")\n\n    if \"-T\" in args:\n        print(\"-T is deprecated, please use --mode transparent instead\")\n\n    for option in (\"-e\", \"--eventlog\", \"--norefresh\"):\n        if option in args:\n            print(\"{} has been removed.\".format(option))\n\n    for option in (\"--nonanonymous\", \"--singleuser\", \"--htpasswd\"):\n        if option in args:\n            print(\n                '{} is deprecated.\\n'\n                'Please use `--proxyauth SPEC` instead.\\n'\n                'SPEC Format: \"username:pass\", \"any\" to accept any user/pass combination,\\n'\n                '\"@path\" to use an Apache htpasswd file, or\\n'\n                '\"ldap[s]:url_server_ldap:dn_auth:password:dn_subtree\" '\n                'for LDAP authentication.'.format(option))\n\n    for option in REPLACED.splitlines():\n        if option in args:\n            print(\n                \"{} is deprecated.\\n\"\n                \"Please use `{}` instead.\".format(\n                    option,\n                    REPLACEMENTS.get(option)\n                )\n            )\n\n    for option in DEPRECATED.splitlines():\n        if option in args:\n            print(\n                \"{} is deprecated.\\n\"\n                \"Please use `--set {}=value` instead.\\n\"\n                \"To show all options and their default values use --options\".format(\n                    option,\n                    REPLACEMENTS.get(option, None) or option.lstrip(\"-\").replace(\"-\", \"_\")\n                )\n            )\n", "path": "mitmproxy/utils/arg_check.py"}], "after_files": [{"content": "import sys\n\nDEPRECATED = \"\"\"\n--cadir\n-Z\n--body-size-limit\n--stream\n--palette\n--palette-transparent\n--follow\n--order\n--no-mouse\n--reverse\n--http2-priority\n--no-http2-priority\n--no-websocket\n--websocket\n--spoof-source-address\n--upstream-bind-address\n--ciphers-client\n--ciphers-server\n--client-certs\n--no-upstream-cert\n--add-upstream-certs-to-client-chain\n--upstream-trusted-cadir\n--upstream-trusted-ca\n--ssl-version-client\n--ssl-version-server\n--no-onboarding\n--onboarding-host\n--onboarding-port\n--server-replay-use-header\n--no-pop\n--replay-ignore-content\n--replay-ignore-payload-param\n--replay-ignore-param\n--replay-ignore-host\n--replace-from-file\n\"\"\"\n\nREPLACED = \"\"\"\n-t\n-u\n--wfile\n-a\n--afile\n-z\n-b\n--bind-address\n--port\n-I\n--ignore\n--tcp\n--cert\n--insecure\n-c\n--replace\n-i\n-f\n--filter\n--socks\n\"\"\"\n\nREPLACEMENTS = {\n    \"--stream\": \"stream_large_bodies\",\n    \"--palette\": \"console_palette\",\n    \"--palette-transparent\": \"console_palette_transparent:\",\n    \"--follow\": \"console_focus_follow\",\n    \"--order\": \"view_order\",\n    \"--no-mouse\": \"console_mouse\",\n    \"--reverse\": \"view_order_reversed\",\n    \"--no-http2-priority\": \"http2_priority\",\n    \"--no-websocket\": \"websocket\",\n    \"--no-upstream-cert\": \"upstream_cert\",\n    \"--upstream-trusted-cadir\": \"ssl_verify_upstream_trusted_cadir\",\n    \"--upstream-trusted-ca\": \"ssl_verify_upstream_trusted_ca\",\n    \"--no-onboarding\": \"onboarding\",\n    \"--no-pop\": \"server_replay_nopop\",\n    \"--replay-ignore-content\": \"server_replay_ignore_content\",\n    \"--replay-ignore-payload-param\": \"server_replay_ignore_payload_params\",\n    \"--replay-ignore-param\": \"server_replay_ignore_params\",\n    \"--replay-ignore-host\": \"server_replay_ignore_host\",\n    \"--replace-from-file\": \"replacements (use @ to specify path)\",\n    \"-t\": \"--stickycookie\",\n    \"-u\": \"--stickyauth\",\n    \"--wfile\": \"--save-stream-file\",\n    \"-a\": \"-w  Prefix path with + to append.\",\n    \"--afile\": \"-w  Prefix path with + to append.\",\n    \"-z\": \"--anticomp\",\n    \"-b\": \"--listen-host\",\n    \"--bind-address\": \"--listen-host\",\n    \"--port\": \"--listen-port\",\n    \"-I\": \"--ignore-hosts\",\n    \"--ignore\": \"--ignore-hosts\",\n    \"--tcp\": \"--tcp-hosts\",\n    \"--cert\": \"--certs\",\n    \"--insecure\": \"--ssl-insecure\",\n    \"-c\": \"-C\",\n    \"--replace\": \"--replacements\",\n    \"-i\": \"--intercept\",\n    \"-f\": \"--view-filter\",\n    \"--filter\": \"--view-filter\",\n    \"--socks\": \"--mode socks5\"\n}\n\n\ndef check():\n    args = sys.argv[1:]\n    print()\n    if \"-U\" in args:\n        print(\"-U is deprecated, please use --mode upstream:SPEC instead\")\n\n    if \"-T\" in args:\n        print(\"-T is deprecated, please use --mode transparent instead\")\n\n    for option in (\"-e\", \"--eventlog\", \"--norefresh\"):\n        if option in args:\n            print(\"{} has been removed.\".format(option))\n\n    for option in (\"--nonanonymous\", \"--singleuser\", \"--htpasswd\"):\n        if option in args:\n            print(\n                '{} is deprecated.\\n'\n                'Please use `--proxyauth SPEC` instead.\\n'\n                'SPEC Format: \"username:pass\", \"any\" to accept any user/pass combination,\\n'\n                '\"@path\" to use an Apache htpasswd file, or\\n'\n                '\"ldap[s]:url_server_ldap:dn_auth:password:dn_subtree\" '\n                'for LDAP authentication.'.format(option))\n\n    for option in REPLACED.splitlines():\n        if option in args:\n            print(\n                \"{} is deprecated.\\n\"\n                \"Please use `{}` instead.\".format(\n                    option,\n                    REPLACEMENTS.get(option)\n                )\n            )\n\n    for option in DEPRECATED.splitlines():\n        if option in args:\n            print(\n                \"{} is deprecated.\\n\"\n                \"Please use `--set {}=value` instead.\\n\"\n                \"To show all options and their default values use --options\".format(\n                    option,\n                    REPLACEMENTS.get(option, None) or option.lstrip(\"-\").replace(\"-\", \"_\")\n                )\n            )\n", "path": "mitmproxy/utils/arg_check.py"}]}