#!/bin/sh
# This file is part of Checkbox.
#
# Copyright 2013 Canonical Ltd.
# Written by:
#   Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
#
# Checkbox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3,
# as published by the Free Software Foundation.

#
# Checkbox is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Checkbox.  If not, see <http://www.gnu.org/licenses/>.

# Helper script to enable tab completion 
# ======================================

# XXX: $0 differs depending on shell version, sometime it is /bin/bash,
# sometimes just bash sometimes bash with '-' in front.
case $(basename "$0") in
    sh)
        echo "W: /bin/sh is not supported"
        ;;
    bash)
        eval "$(register-python-argcomplete plainbox)"
        ;;
    mk-venv)
        ;;
    *)
        echo "E: this script is meant to be sourced, not executed"
        echo "I: \$0 was $0"
        ;;
esac
