#!/bin/bash
# genshiken -- Helps build the command-line for Genshiken faster via a configuration file
# Copyright © 2015-2016 Michael Pagan
#
# Author: Michael Pagan
# E-Mail: michael.pagan@member.fsf.org
# Jabber: pegzmasta@member.fsf.org
#
# Genshiken is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Genshiken 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 Genshiken. If not, see http://www.gnu.org/licenses/.
#===================================================================

# Let's determine the location of our main bash script
main=/usr/local/share/genshiken/genshiken-main.sh

# Determine if there are any configuration files that the user has set
[[ -f /etc/genshiken.conf ]] && CONFIG=/etc/genshiken.conf
[[ -f $HOME/.config/genshiken-$USER/config ]] && CONFIG=$HOME/.config/genshiken-$USER/config

# Unset the $processing variable if it was needed during the bash-completion routine
[[ -n ${processing:-} ]] && unset processing

# Run genshiken
$main $@ $([[ -n ${CONFIG:-} ]] && echo $(< $CONFIG))

# End:
# genshiken ends here
