Skip to content

Commit

Permalink
Fill in zsh short descriptions
Browse files Browse the repository at this point in the history
Fixes #241128
  • Loading branch information
Tyriar committed Feb 19, 2025
1 parent 780e17b commit ba568fd
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 435 deletions.
134 changes: 70 additions & 64 deletions extensions/terminal-suggest/scripts/pullZshBuiltins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ import { exec } from 'child_process';
import { promisify } from 'util';
import * as fs from 'fs/promises';
import * as path from 'path';
import { platform } from 'os';

if (platform() === 'win32') {
console.error('\x1b[31mThis command is not supported on Windows\x1b[0m');
process.exit(1);
}

const shortDescriptions: Map<string, string> = new Map([
['.', 'Source a file'],
// [':', ''],
[':', 'Null command'],
['alias', 'Define or view aliases'],
['autoload', 'Autoload a function'],
['bg', 'Put a job in the background'],
Expand All @@ -19,85 +25,85 @@ const shortDescriptions: Map<string, string> = new Map([
['builtin', 'Executes a builtin'],
['bye', 'Exit the shell'],
['chdir', 'Change the current directory'],
// ['comparguments', ''],
// ['compcall', ''],
// ['compctl', ''],
// ['compdescribe', ''],
// ['compfiles', ''],
// ['compgroups', ''],
// ['compquote', ''],
// ['comptags', ''],
// ['comptry', ''],
// ['compvalues', ''],
['comparguments', 'Complete arguments'],
['compcall', 'Complete call'],
['compctl', 'Complete control'],
['compdescribe', 'Complete describe'],
['compfiles', 'Complete files'],
['compgroups', 'Complete groups'],
['compquote', 'Complete quote'],
['comptags', 'Complete tags'],
['comptry', 'Complete try'],
['compvalues', 'Complete values'],
['continue', 'Resume the next loop iteration'],
['declare', 'Set or display parameter attributes/values'],
['dirs', 'Interact with directory stack'],
['disable', 'Disable shell features'],
['disown', 'Remove job from job table'],
['echo', 'Write on standard output'],
// ['echotc', ''],
['echotc', 'Echo terminal capabilities'],
['enable', 'Enable shell features'],
['eval', 'Execute arguments in shell'],
['exec', 'Replace shell with command'],
['exit', 'Exit the shell'],
['export', 'Export to environment'],
['false', 'Return exit status of 1'],
// ['fc', ''],
// ['fg', ''],
// ['float', ''],
// ['functions', ''],
// ['getcap', ''],
// ['getopts', ''],
// ['hash', ''],
// ['history', ''],
// ['integer', ''],
// ['jobs', ''],
// ['kill', ''],
// ['let', ''],
// ['limit', ''],
// ['local', ''],
// ['logout', ''],
// ['noglob', ''],
// ['popd', ''],
// ['print', ''],
// ['printf', ''],
// ['pushd', ''],
// ['pushln', ''],
['fc', 'Fix command'],
['fg', 'Put a job in the foreground'],
['float', 'Floating point arithmetic'],
['functions', 'List functions'],
['getcap', 'Get capabilities'],
['getopts', 'Parse positional parameters'],
['hash', 'Remember command locations'],
['history', 'Command history'],
['integer', 'Integer arithmetic'],
['jobs', 'List active jobs'],
['kill', 'Send a signal to a process'],
['let', 'Evaluate arithmetic expression'],
['limit', 'Set or display resource limits'],
['local', 'Create a local variable'],
['logout', 'Exit the shell'],
['noglob', 'Disable filename expansion'],
['popd', 'Remove directory from stack'],
['print', 'Print arguments'],
['printf', 'Format and print data'],
['pushd', 'Add directory to stack'],
['pushln', 'Push arguments onto the buffer'],
['pwd', 'Print working directory'],
// ['r', ''],
// ['readonly', ''],
// ['rehash', ''],
// ['sched', ''],
// ['setcap', ''],
// ['shift', ''],
// ['source', ''],
// ['stat', ''],
// ['test', ''],
// ['times', ''],
// ['trap', ''],
['r', 'Re-execute command'],
['readonly', 'Mark variables as read-only'],
['rehash', 'Recompute command hash table'],
['sched', 'Schedule commands'],
['setcap', 'Set capabilities'],
['shift', 'Shift positional parameters'],
['source', 'Source a file'],
['stat', 'Display file status'],
['test', 'Evaluate a conditional expression'],
['times', 'Display shell times'],
['trap', 'Set signal handlers'],
['true', 'Return exit status of 0'],
// ['ttyctl', ''],
// ['type', ''],
['ttyctl', 'Control terminal attributes'],
['type', 'Describe a command'],
['typeset', 'Set or display parameter attributes/values'],
// ['ulimit', ''],
// ['umask', ''],
['ulimit', 'Set or display resource limits'],
['umask', 'Set file creation mask'],
['unalias', 'Removes aliases'],
// ['unfunction', ''],
// ['unhash', ''],
// ['unlimit', ''],
// ['unset', ''],
// ['unsetopt', ''],
// ['vared', ''],
// ['whence', ''],
// ['where', ''],
// ['which', ''],
// ['zcompile', ''],
// ['zformat', ''],
// ['zftp', ''],
// ['zparseopts', ''],
// ['zprof', ''],
// ['zsocket', ''],
// ['zstyle', ''],
['unfunction', 'Remove function definition'],
['unhash', 'Remove command from hash table'],
['unlimit', 'Remove resource limits'],
['unset', 'Unset values and attributes of variables'],
['unsetopt', 'Unset shell options'],
['vared', 'Edit shell variables'],
['whence', 'Locate a command'],
['where', 'Locate a command'],
['which', 'Locate a command'],
['zcompile', 'Compile functions'],
['zformat', 'Format strings'],
['zftp', 'Zsh FTP client'],
['zparseopts', 'Parse options'],
['zprof', 'Zsh profiler'],
['zsocket', 'Zsh socket interface'],
['zstyle', 'Define styles']
]);

const execAsync = promisify(exec);
Expand Down
Loading

0 comments on commit ba568fd

Please sign in to comment.