#!/usr/bin/env bash # # Copyright (c) 2018-2023 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 # set -e typeset -r script_name=${0##*/} # shellcheck disable=SC2034,SC2155 typeset -r cidir=$(dirname "$0") function usage() { cat <&2; exit 1; } while [[ $# -gt 1 ]] do case "$1" in -d|--default) ;; -g|--golang) type="golang";; -r|--rust) type="rust";; -h|--help) usage exit 0 ;; -k|--kernel) type="kernel";; --) shift break ;; esac shift done local -r arch=$(uname -m) case "${type}" in default) echo "${arch}";; golang) arch_to_golang "${arch}";; rust) arch_to_rust "${arch}";; kernel) arch_to_kernel "${arch}";; esac } main "$@"