Make --gcc6 work with fish; add 'source' to usage

This commit is contained in:
Oliver Smith 2018-10-11 07:22:09 +02:00
parent a2484f2492
commit 946417d314
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
2 changed files with 15 additions and 6 deletions

View File

@ -2,12 +2,21 @@
# Copyright 2018 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
if [ "$argv" != "" ]
and [ "$argv" != "--gcc6" ]
echo "usage: source envkernel.fish"
echo "optional arguments:"
echo " --gcc6 Use GCC6 cross compiler"
echo " --help Show this help message"
exit 1
end
# Fish compatibility code from envkernel.sh
set script_dir (dirname (status filename))
sh "$script_dir/envkernel.sh" --fish 1>| read -z fishcode
sh "$script_dir/envkernel.sh" $argv --fish 1>| read -z fishcode
# Verbose output
if [ "$argv" = "-v" ]
# Verbose output (enable with: 'set ENVKERNEL_FISH_VERBOSE 1')
if [ "$ENVKERNEL_FISH_VERBOSE" = "1" ]
echo "(eval code start)"
printf "$fishcode"
echo "(eval code end)"

View File

@ -187,12 +187,12 @@ cross_compiler_version() {
print_usage() {
# shellcheck disable=SC2039
if [ -n "${BASH_SOURCE[0]}" ]; then
echo "usage: $(basename "${BASH_SOURCE[0]}")"
echo "usage: source $(basename "${BASH_SOURCE[0]}")"
else
echo "usage: $(basename "$1")"
echo "usage: source $(basename "$1")"
fi
echo "optional arguments:"
echo " --fish Print fish alias syntax"
echo " --fish Print fish alias syntax (internally used)"
echo " --gcc6 Use GCC6 cross compiler"
echo " --help Show this help message"
}