Files
openide/plugins/sh/core/resources/liveTemplates/ShellScriptArray.xml
Mikhail Mazurkevich 906c5743db [intellij sh] IDEA-273336 i18n for live templates
GitOrigin-RevId: a0e24e8f19b3a1a0080f0dd825acbc3483ec6f91
2022-10-31 14:32:26 +00:00

90 lines
4.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="Shell Script">
<template name="array create" value="$ARRAY$=($ITEMS$)&#10;"
resource-bundle="messages.ShBundle" key="sh.livetemplate.description.array.create"
toShortenFQNames="false">
<variable name="ARRAY" expression="" defaultValue="&quot;myArray&quot;" alwaysStopAt="true"/>
<variable name="ITEMS" expression="" defaultValue="&quot;item1 item2 item3&quot;" alwaysStopAt="true"/>
<context>
<option name="SHELL_SCRIPT" value="true"/>
<option name="OTHER" value="false"/>
</context>
</template>
<template name="array all" value="${$ARRAY$[@]}&#10;"
resource-bundle="messages.ShBundle" key="sh.livetemplate.description.array.all"
toShortenFQNames="false">
<variable name="ARRAY" expression="" defaultValue="&quot;myArray&quot;" alwaysStopAt="true"/>
<context>
<option name="SHELL_SCRIPT" value="true"/>
<option name="OTHER" value="false"/>
</context>
</template>
<template name="array at index" value="${$ARRAY$[$INDEX$]}&#10;"
resource-bundle="messages.ShBundle" key="sh.livetemplate.description.array.at.index"
toShortenFQNames="false">
<variable name="ARRAY" expression="" defaultValue="&quot;myArray&quot;" alwaysStopAt="true"/>
<variable name="INDEX" expression="" defaultValue="&quot;index&quot;" alwaysStopAt="true"/>
<context>
<option name="SHELL_SCRIPT" value="true"/>
<option name="OTHER" value="false"/>
</context>
</template>
<template name="array length" value="${#$ARRAY$[@]}&#10;"
resource-bundle="messages.ShBundle" key="sh.livetemplate.description.array.length"
toShortenFQNames="false">
<variable name="ARRAY" expression="" defaultValue="&quot;myArray&quot;" alwaysStopAt="true"/>
<context>
<option name="SHELL_SCRIPT" value="true"/>
<option name="OTHER" value="false"/>
</context>
</template>
<template name="array delete" value="unset $ARRAY$&#10;"
resource-bundle="messages.ShBundle" key="sh.livetemplate.description.array.delete"
toShortenFQNames="false">
<variable name="ARRAY" expression="" defaultValue="&quot;myArray&quot;" alwaysStopAt="true"/>
<context>
<option name="SHELL_SCRIPT" value="true"/>
<option name="OTHER" value="false"/>
</context>
</template>
<template name="array delete at" value="unset $ARRAY$[$INDEX$]&#10;"
resource-bundle="messages.ShBundle" key="sh.livetemplate.description.array.delete.at"
toShortenFQNames="false">
<variable name="ARRAY" expression="" defaultValue="&quot;myArray&quot;" alwaysStopAt="true"/>
<variable name="INDEX" expression="" defaultValue="&quot;index&quot;" alwaysStopAt="true"/>
<context>
<option name="SHELL_SCRIPT" value="true"/>
<option name="OTHER" value="false"/>
</context>
</template>
<template name="array set element" value="$ARRAY$[$INDEX$]=$VALUE$&#10;"
resource-bundle="messages.ShBundle" key="sh.livetemplate.description.array.set.element"
toShortenFQNames="false">
<variable name="ARRAY" expression="" defaultValue="&quot;myArray&quot;" alwaysStopAt="true"/>
<variable name="INDEX" expression="" defaultValue="&quot;index&quot;" alwaysStopAt="true"/>
<variable name="VALUE" expression="" defaultValue="&quot;value&quot;" alwaysStopAt="true"/>
<context>
<option name="SHELL_SCRIPT" value="true"/>
<option name="OTHER" value="false"/>
</context>
</template>
<template name="array add" value="$ARRAY$+=($ITEM$)&#10;"
resource-bundle="messages.ShBundle" key="sh.livetemplate.description.array.add"
toShortenFQNames="false">
<variable name="ARRAY" expression="" defaultValue="&quot;myArray&quot;" alwaysStopAt="true"/>
<variable name="ITEM" expression="" defaultValue="&quot;item&quot;" alwaysStopAt="true"/>
<context>
<option name="SHELL_SCRIPT" value="true"/>
<option name="OTHER" value="false"/>
</context>
</template>
<template name="array iteration" value="for item in ${$ARRAY$[@]}; do&#10; echo &quot;$item&quot;$END$&#10;done&#10;"
resource-bundle="messages.ShBundle" key="sh.livetemplate.description.array.iteration"
toReformat="true" toShortenFQNames="false">
<variable name="ARRAY" expression="" defaultValue="&quot;myArray&quot;" alwaysStopAt="true"/>
<context>
<option name="SHELL_SCRIPT" value="true"/>
<option name="OTHER" value="false"/>
</context>
</template>
</templateSet>