UNPKG

@shutootaki/gwm

Version:
34 lines 929 B
/** * gwm completion script コマンド * 補完スクリプトを標準出力に出力 */ import { generateShellScript } from '../generators/shell/index.js'; /** * 引数をパース */ export function parseScriptArgs(args) { let shell; for (let i = 0; i < args.length; i++) { const arg = args[i]; if (arg === '--shell' && i + 1 < args.length) { const nextArg = args[++i]; if (nextArg === 'bash' || nextArg === 'zsh' || nextArg === 'fish') { shell = nextArg; } } } return { shell }; } /** * script コマンドを実行 */ export function runScript(args) { if (!args.shell) { console.error('Error: --shell option is required (bash, zsh, or fish)'); return false; } const script = generateShellScript(args.shell); process.stdout.write(script); return true; } //# sourceMappingURL=script.js.map