提交 0ea609f9 编写于 作者: B Benjamin Pasero

💄 cli help format

上级 8c2efd61
......@@ -131,32 +131,38 @@ export function parseArgs(args: string[]): ParsedArgs {
return minimist(args, options) as ParsedArgs;
}
export const optionsHelp: { [name: string]: string; } = {
const optionsHelp: { [name: string]: string; } = {
'-d, --diff <file> <file>': localize('diff', "Compare two files with each other."),
'-a, --add <dir>': localize('add', "Add folder(s) to the last active window."),
'-g, --goto <file:line[:character]>': localize('goto', "Open a file at the path on the specified line and character position."),
'--locale <locale>': localize('locale', "The locale to use (e.g. en-US or zh-TW)."),
'-n, --new-window': localize('newWindow', "Force a new instance of Code."),
'-p, --performance': localize('performance', "Start with the 'Developer: Startup Performance' command enabled."),
'--prof-startup': localize('prof-startup', "Run CPU profiler during startup"),
'--inspect-extensions': localize('inspect-extensions', "Allow debugging and profiling of extensions. Check the developer tools for the connection uri."),
'--inspect-brk-extensions': localize('inspect-brk-extensions', "Allow debugging and profiling of extensions with the extension host being paused after start. Check the developer tools for the connection uri."),
'-r, --reuse-window': localize('reuseWindow', "Force opening a file or folder in the last active window."),
'--user-data-dir <dir>': localize('userDataDir', "Specifies the directory that user data is kept in, useful when running as root."),
'--log <level>': localize('log', "Log level to use. Default is 'info'. Allowed values are 'critical', 'error', 'warn', 'info', 'debug', 'trace', 'off'."),
'--verbose': localize('verbose', "Print verbose output (implies --wait)."),
'-w, --wait': localize('wait', "Wait for the files to be closed before returning."),
'--locale <locale>': localize('locale', "The locale to use (e.g. en-US or zh-TW)."),
'--user-data-dir <dir>': localize('userDataDir', "Specifies the directory that user data is kept in, useful when running as root."),
'-v, --version': localize('version', "Print version."),
'-h, --help': localize('help', "Print usage.")
};
const extensionsHelp: { [name: string]: string; } = {
'--extensions-dir <dir>': localize('extensionHomePath', "Set the root path for extensions."),
'--list-extensions': localize('listExtensions', "List the installed extensions."),
'--show-versions': localize('showVersions', "Show versions of installed extensions, when using --list-extension."),
'--install-extension (<extension-id> | <extension-vsix-path>)': localize('installExtension', "Installs an extension."),
'--uninstall-extension (<extension-id> | <extension-vsix-path>)': localize('uninstallExtension', "Uninstalls an extension."),
'--enable-proposed-api <extension-id>': localize('experimentalApis', "Enables proposed api features for an extension."),
'--disable-extensions': localize('disableExtensions', "Disable all installed extensions."),
'--disable-gpu': localize('disableGPU', "Disable GPU hardware acceleration."),
'--enable-proposed-api <extension-id>': localize('experimentalApis', "Enables proposed api features for an extension.")
};
const troubleshootingHelp: { [name: string]: string; } = {
'--verbose': localize('verbose', "Print verbose output (implies --wait)."),
'--log <level>': localize('log', "Log level to use. Default is 'info'. Allowed values are 'critical', 'error', 'warn', 'info', 'debug', 'trace', 'off'."),
'-s, --status': localize('status', "Print process usage and diagnostics information."),
'-v, --version': localize('version', "Print version."),
'-h, --help': localize('help', "Print usage.")
'-p, --performance': localize('performance', "Start with the 'Developer: Startup Performance' command enabled."),
'--prof-startup': localize('prof-startup', "Run CPU profiler during startup"),
'--disable-extensions': localize('disableExtensions', "Disable all installed extensions."),
'--inspect-extensions': localize('inspect-extensions', "Allow debugging and profiling of extensions. Check the developer tools for the connection uri."),
'--inspect-brk-extensions': localize('inspect-brk-extensions', "Allow debugging and profiling of extensions with the extension host being paused after start. Check the developer tools for the connection uri."),
'--disable-gpu': localize('disableGPU', "Disable GPU hardware acceleration.")
};
export function formatOptions(options: { [name: string]: string; }, columns: number): string {
......@@ -204,5 +210,11 @@ ${ localize('usage', "Usage")}: ${executable} [${localize('options', "options")}
${ isWindows ? localize('stdinWindows', "To read output from another program, append '-' (e.g. 'echo Hello World | {0} -')", product.applicationName) : localize('stdinUnix', "To read from stdin, append '-' (e.g. 'ps aux | grep code | {0} -')", product.applicationName)}
${ localize('optionsUpperCase', "Options")}:
${formatOptions(optionsHelp, columns)}`;
${formatOptions(optionsHelp, columns)}
${ localize('extensionsManagement', "Extensions Management")}:
${formatOptions(extensionsHelp, columns)}
${ localize('troubleshooting', "Troubleshooting")}:
${formatOptions(troubleshootingHelp, columns)}`;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册