<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-activation="lazy">

    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.0.0">
        <command name="shell/cat">
            <action class="org.apache.karaf.shell.commands.CatAction"/>
        </command>
        <command name="shell/clear">
            <action class="org.apache.karaf.shell.commands.ClearAction"/>
        </command>
        <command name="shell/each">
            <action class="org.apache.karaf.shell.commands.EachAction"/>
        </command>
        <command name="shell/echo">
            <action class="org.apache.karaf.shell.commands.EchoAction"/>
        </command>
        <command name="shell/exec">
            <action class="org.apache.karaf.shell.commands.ExecuteAction"/>
        </command>
        <command name="shell/grep">
            <action class="org.apache.karaf.shell.commands.GrepAction"/>
        </command>
        <command name="shell/history">
            <action class="org.apache.karaf.shell.commands.HistoryAction"/>
        </command>
        <command name="shell/head">
            <action class="org.apache.karaf.shell.commands.HeadAction"/>
        </command>
        <command name="shell/if">
            <action class="org.apache.karaf.shell.commands.IfAction"/>
        </command>
        <command name="shell/info">
            <action class="org.apache.karaf.shell.commands.InfoAction">
                <property name="infoProviders" ref="infoProviders"/>
            </action>
        </command>
        <command name="shell/java">
            <action class="org.apache.karaf.shell.commands.JavaAction"/>
        </command>
        <command name="shell/more">
            <action class="org.apache.karaf.shell.commands.MoreAction"/>
        </command>
        <command name="shell/new">
            <action class="org.apache.karaf.shell.commands.NewAction"/>
        </command>
        <command name="shell/logout">
            <action class="org.apache.karaf.shell.commands.LogoutAction"/>
        </command>
        <command name="shell/printf">
            <action class="org.apache.karaf.shell.commands.PrintfAction"/>
        </command>
        <command name="shell/sleep">
            <action class="org.apache.karaf.shell.commands.SleepAction"/>
        </command>
        <command name="shell/sort">
            <action class="org.apache.karaf.shell.commands.SortAction"/>
        </command>
        <command name="shell/source">
            <action class="org.apache.karaf.shell.commands.SourceAction"/>
        </command>
        <command name="shell/tac">
            <action class="org.apache.karaf.shell.commands.TacAction"/>
        </command>
        <command name="shell/tail">
            <action class="org.apache.karaf.shell.commands.TailAction"/>
        </command>
        <command name="shell/watch">
            <action class="org.apache.karaf.shell.commands.WatchAction">
                <property name="commandProcessor" ref="commandProcessor"/>
            </action>
            <completers>
                <ref component-id="commandCompleter" />
                <null/>
            </completers>
        </command>
        <command name="shell/edit">
            <action class="org.apache.karaf.shell.commands.EditAction">
                <property name="editorFactory" ref="editorFactory"/>
            </action>
        </command>
    </command-bundle>

   <bean id="commandCompleter" class="org.apache.karaf.shell.console.completer.CommandsCompleter"/>

   <bean class="org.osgi.util.tracker.BundleTracker" init-method="open"
        destroy-method="close">
        <argument ref="blueprintBundleContext" />
        <argument value="32" />
        <argument>
            <bean class="org.apache.karaf.shell.commands.info.InfoBundleTrackerCustomizer">
                <argument ref="blueprintBundleContext" />
            </bean>
        </argument>
    </bean>

    <reference-list id="infoProviders" interface="org.apache.karaf.shell.commands.info.InfoProvider"
        availability="optional">
    </reference-list>

    <reference id="commandProcessor" interface="org.apache.felix.service.command.CommandProcessor"/>
    <reference id="editorFactory" interface="org.jledit.EditorFactory"/>
 
</blueprint>
