Skip to content

Commit

Permalink
feat(snippets): add "getopts" snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderwoehler committed May 12, 2024
1 parent 1fc9819 commit b4ca3ef
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions server/src/snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,22 @@ export const SNIPPETS: BashCompletionItem[] = [
'done',
].join('\n'),
},
{
label: 'while-getopts',
documentation: 'while with getopts argument-parsing',
insertText: [
'while getopts "${1:patterns}" ${2:expression}; do',
'\tcase "\\${$2}" in',
'\t\t${3:pattern})',
'\t\t\t${4:command ...}',
'\t\t\t;;',
'\t\t*)',
'\t\t\t${5:command ...}',
'\t\t\t;;',
'\tesac',
'done',
].join('\n'),
},
{
label: 'until',
documentation: 'until operator',
Expand Down

0 comments on commit b4ca3ef

Please sign in to comment.