Skip to content

Commit b4ca3ef

Browse files
author
alexanderwoehler
committed
feat(snippets): add "getopts" snippet
1 parent 1fc9819 commit b4ca3ef

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

server/src/snippets.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,22 @@ export const SNIPPETS: BashCompletionItem[] = [
292292
'done',
293293
].join('\n'),
294294
},
295+
{
296+
label: 'while-getopts',
297+
documentation: 'while with getopts argument-parsing',
298+
insertText: [
299+
'while getopts "${1:patterns}" ${2:expression}; do',
300+
'\tcase "\\${$2}" in',
301+
'\t\t${3:pattern})',
302+
'\t\t\t${4:command ...}',
303+
'\t\t\t;;',
304+
'\t\t*)',
305+
'\t\t\t${5:command ...}',
306+
'\t\t\t;;',
307+
'\tesac',
308+
'done',
309+
].join('\n'),
310+
},
295311
{
296312
label: 'until',
297313
documentation: 'until operator',

0 commit comments

Comments
 (0)