From 15dec597729359d43cadc28af0b003430b35ce6f Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 12 Mar 2024 12:26:57 +0000 Subject: [PATCH] bin: generate date in mkcomponent --- bin/mkcomponent | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/mkcomponent b/bin/mkcomponent index 9f3a833..bca7468 100755 --- a/bin/mkcomponent +++ b/bin/mkcomponent @@ -2,7 +2,7 @@ version="0.1" -function usage () +function usage() { echo "Usage : $0 [options] @@ -21,7 +21,7 @@ while [[ $# -gt 0 ]]; do case $opt in -h|--help) usage; exit 0 ;; -v|--version) echo "$0 -- Version $version"; exit 0 ;; - -* ) + -*) echo -e "\n Option does not exist : $opt\n" usage; exit 1 ;; @@ -30,7 +30,7 @@ while [[ $# -gt 0 ]]; do done read -d '' fpp_copy < $f$_h - printf '%s\n\n#include "%s"\n\n' "$fpp_copy" "$c$_h" > $f$_c - printf '%s\n\n#include \n\n#include "%s"\n' "$fpp_copy" "$c$_h" > $f$_t + printf '%s\n\n#pragma once\n\n' "$fpp_copy" >$f$_h + printf '%s\n\n#include "%s"\n\n' "$fpp_copy" "$c$_h" >$f$_c + printf '%s\n\n#include \n\n#include "%s"\n' "$fpp_copy" "$c$_h" >$f$_t done -- 2.48.1