]>
git.rmz.io Git - dotfiles.git/blob - bin/mkcomponent
7 echo "Usage : $0 [options]
9 Create a header/source/test triplet.
12 -h,--help Display this message
13 -v,--version Display script version"
18 while [[ $# -gt 0 ]]; do
22 -h|--help) usage
; exit 0 ;;
23 -v|--version) echo "$0 -- Version $version"; exit 0 ;;
25 echo -e "\n Option does not exist : $opt\n"
28 *) args
+=("$opt"); shift ;;
32 read -d '' fpp_copy
<<EOD
33 // Copyright © Focal Point Positioning Limited 2022. All Rights Reserved.
34 // This code is the copyright of Focal Point Positioning Limited and
35 // cannot be used, copied or distributed without the express written
36 // permission of Focal Point Positioning Limited.
39 _h
=${COMPONENT_HEADER_SUFFIX:-.hpp}
40 _c
=${COMPONENT_SOURCE_SUFFIX:-.cpp}
41 _t
=${COMPONENT_TEST_SUFFIX:-.t.cpp}
43 for f
in "${args[@]}"; do
45 printf '%s\n\n#pragma once\n\n' "$fpp_copy" > $f$_h
46 printf '%s\n\n#include "%s"\n\n' "$fpp_copy" "$c$_h" > $f$_c
47 printf '%s\n\n#include <gtest/gtest.h>\n\n#include "%s"\n' "$fpp_copy" "$c$_h" > $f$_t