!/usr/bin/env python
# Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
import os
import socket
import struct
import sys
import traceback
# See com.intellij.idea.SocketLock for the server side of this interface.
RUN_PATH = u'/Applications/IntelliJ IDEA.app'
CONFIG_PATH = u'/Users/yangbin5/Library/Application Support/JetBrains/IntelliJIdea2021.2'
SYSTEM_PATH = u'/Users/yangbin5/Library/Caches/JetBrains/IntelliJIdea2021.2'
def print_usage(cmd):
print(('Usage:\n' +
' {0} -h | -? | --help\n' +
' {0} [project_dir] [-w|--wait]\n' +
' {0} [-l|--line line] [project_dir|--temp-project] [-w|--wait] file[:line]\n' +
' {0} diff <left> <right>\n' +
' {0} merge <local> <remote> [base] <merged>').format(cmd))
def write_to_sock(sock, data):
if sys.version_info[0] >= 3:
data = data.encode('utf-8')
sock.send(struct.pack('>h', len(data)) + data)入代码片
idea 命令行原来是python写的
于 2024-02-17 13:17:59 首次发布