From 488050aa10e688255e065ae7c1f5a37cfd5d08f7 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Fri, 4 Dec 2015 15:56:52 +0100 Subject: [PATCH] Implement --serverlist --- nvim-remote.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nvim-remote.py b/nvim-remote.py index db4ff5c..afeb8aa 100755 --- a/nvim-remote.py +++ b/nvim-remote.py @@ -89,17 +89,25 @@ def parse_args(): parser.add_argument('--servername', metavar='', help='path to unix socket (overrides $NVIM_LISTEN_ADDRESS)') + parser.add_argument('--serverlist', + action='store_true', + help='simply prints $NVIM_LISTEN_ADDRESS') return parser.parse_known_args() def main(): args, unused = parse_args() + sockpath = os.environ.get('NVIM_LISTEN_ADDRESS') + + if args.serverlist: + if sockpath is not None: + print(sockpath) + sys.exit(0) if args.servername: sockpath = args.servername else: - sockpath = os.environ.get('NVIM_LISTEN_ADDRESS') if sockpath is None: sockpath = '/tmp/nvimsocket'