add builtin fish arg/description/documentation to suggestion (#243271)

This commit is contained in:
Megan Rogge
2025-03-13 18:28:50 -04:00
committed by GitHub
parent 0eb916d682
commit 8bbbc45f4f
10 changed files with 751 additions and 24 deletions

View File

@@ -3,16 +3,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { exec } from 'child_process';
import { promisify } from 'util';
import * as fs from 'fs/promises';
import * as path from 'path';
import { platform } from 'os';
import { checkWindows, execAsync, copyright } from './terminalScriptHelpers';
if (platform() === 'win32') {
console.error('\x1b[31mThis command is not supported on Windows\x1b[0m');
process.exit(1);
}
checkWindows();
const latestZshVersion = 5.9;
@@ -126,14 +121,14 @@ const shortDescriptions: Map<string, string> = new Map([
['ztcp', 'Manipulate TCP sockets'],
]);
const execAsync = promisify(exec);
interface ICommandDetails {
description: string;
args: string | undefined;
shortDescription?: string;
}
let zshBuiltinsCommandDescriptionsCache = new Map<string, ICommandDetails>();
async function createCommandDescriptionsCache(): Promise<void> {
const cachedCommandDescriptions: Map<string, { shortDescription?: string; description: string; args: string | undefined }> = new Map();
let output = '';
@@ -259,10 +254,4 @@ const main = async () => {
}
};
const copyright = `
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/`;
main();