Overview

Extensions allow to modified aliases. The extended aliases are added in addition to the original alias.

Example with Extension

<aliases
  xmlns="http://smartics.de/alias/1.1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <extension env="windows">
    <name>aq</name>
    <template>@echo off $T color $T {@cmd} ^&amp;^&amp; exit $T color F4 $T @echo on $T echo ${bell}</template>
    <comment>and-quit: Launches the command and closes the shell on successful termination.
      On error the shell is turned red and beeps for attention.</comment>
    <apply-to>
      <group>mvn</group>
      <group>project-release</group>
    </apply-to>
  </extension>

  <extension env="bash">
    <name>aq</name>
    <template>{@cmd} ; exit</template>
    <comment>and-quit: Launches the command and closes the shell on successful termination.
      On error the shell is turned red and beeps for attention.</comment>
    <apply-to>
      <group>mvn</group>
      <group>project-release</group>
    </apply-to>
  </extension>

  <group name="mvn">
    <alias>
      <name>i</name>
      <command>mvn -T 4 clean install</command>
      <comment>Installs a project with Maven. Requires a valid Maven-POM.</comment>
    </alias>
    <alias>
      <name>s</name>
      <command>mvn -T 4 initialize site</command>
      <comment>Creates Maven site. Requires a valid Maven-POM.</comment>
    </alias>
    <alias>
      <name>l</name>
      <command>mvn initialize license:format</command>
      <comment>Formats licensen headers. Requires a valid Maven-POM.</comment>
    </alias>
  </group>

  <group name="integration">
    <alias>
      <name>b</name>
      <command>mvn bugzilla:sync</command>
      <comment>Syncs Bugzilla product with Maven-POM.</comment>
    </alias>

    ...
  </group>
</aliases>

The environment works as a guard to make sure that the extension is applied only to aliases of the specified environment. If no environment the extension is applied to all environments.

The name of the extension is appended the name of the alias the extension is applied to. That is if the name of the alias is i and the name of the extension is aq the name of the extended alias is iaq.

The template is applied to the alias command. The place holder {@cmd} is the location where the original alias command is written to.

The optional comment is for documentation purpose.

The apply-to specifies the aliases the extension is applied to. If the name of a group is specified with the group element, the extension is applied to all aliases of that group. If the element is a alias, the extension is only applied to this specific alias.