Files
Netcatty/electron/specs/awk.js
T
陈大猫 c924259fc0 fix: add local autocomplete specs and isolate command history per host (#536)
Add local spec files for commands missing from @withfig/autocomplete
(journalctl, yum, awk) and load them with priority over the upstream
package. Also enforce strict per-host isolation for command history —
previously cross-host matching by OS leaked host-specific commands
(e.g. cd /cq/) into unrelated sessions.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 00:04:42 +08:00

34 lines
2.3 KiB
JavaScript

// awk spec — pattern scanning and text processing language
const completionSpec = {
name: "awk",
description: "Pattern scanning and text processing language",
args: [
{ name: "program", description: "AWK program text (e.g. '{print $1}')" },
{ name: "file", description: "Input file(s)", isOptional: true, isVariadic: true, template: "filepaths" },
],
options: [
{ name: "-F", description: "Set field separator", args: { name: "separator", description: "e.g. ',' or '\\t'" } },
{ name: "-v", description: "Assign a variable (var=value)", args: { name: "var=value" } },
{ name: "-f", description: "Read AWK program from file", args: { name: "progfile", template: "filepaths" } },
{ name: "-o", description: "Enable pretty-printed output", args: { name: "file", isOptional: true, template: "filepaths" } },
{ name: "-b", description: "Treat all input data as single-byte characters (gawk)" },
{ name: "-c", description: "Run in POSIX compatibility mode (gawk)" },
{ name: "-C", description: "Print copyright information" },
{ name: "-d", description: "Dump variables to file (gawk)", args: { name: "file", isOptional: true, template: "filepaths" } },
{ name: "-e", description: "Specify AWK program text", args: { name: "program" } },
{ name: "-E", description: "Read AWK program from file (like -f but disables command-line variable assignments)", args: { name: "file", template: "filepaths" } },
{ name: "-i", description: "Include AWK source library", args: { name: "source-file", template: "filepaths" } },
{ name: "-l", description: "Load dynamic extension (gawk)", args: { name: "ext" } },
{ name: "-n", description: "Disable automatic input record splitting (gawk)" },
{ name: "-N", description: "Use locale decimal point for parsing input data (gawk)" },
{ name: "-p", description: "Profile execution and write to file (gawk)", args: { name: "file", isOptional: true, template: "filepaths" } },
{ name: "-P", description: "POSIX compatibility mode (gawk)" },
{ name: "-S", description: "Sandbox mode — disable system(), I/O redirection (gawk)" },
{ name: "-t", description: "Enable type checking (gawk)" },
{ name: "--help", description: "Show help" },
{ name: "--version", description: "Print version information" },
],
};
export default completionSpec;