From 199a8b527ca956fec328cd105fb95ce15828d135 Mon Sep 17 00:00:00 2001 From: Venelin Date: Wed, 1 Mar 2023 10:10:39 +0200 Subject: [PATCH] initial release --- install.sh | 18 ++++---- readme.md | 0 readme.txt | 53 ++++++++++++++++++++++++ src/create_tree.cpp | 22 +++++----- example_tree.hpp => src/example_tree.hpp | 0 tft_create | 30 -------------- 6 files changed, 71 insertions(+), 52 deletions(-) delete mode 100644 readme.md create mode 100644 readme.txt rename example_tree.hpp => src/example_tree.hpp (100%) delete mode 100755 tft_create diff --git a/install.sh b/install.sh index 9068c29..e824054 100755 --- a/install.sh +++ b/install.sh @@ -1,10 +1,6 @@ #!/bin/sh set -e -# cp tft_create /usr/local/bin - -cd src - language=' -std=c++17 -fno-rtti @@ -17,22 +13,22 @@ optimizations=' -Ofast -flto -fipa-pta - -fallow-store-data-races -fgcse-sm -fgcse-las -march=native' warnings=' -Wall - -Wextra - -Wpedantic - -Wmultiple-inheritance - -Wvirtual-inheritance' #-fanalyzer + -Wextra' +# -Wpedantic' #-fanalyzer other='-fno-fat-lto-objects' -g++ -o tft $language $optimizations $warnings $other -DNDEBUG -pipe -s tft.cpp tree.cpp person.cpp utils.cpp -lncursesw +cd src + +g++ -o tft $language $optimizations $warnings $other -DNDEBUG -pipe -s *.cpp -lncursesw +#-static -lncursesw -ltinfo + chmod 775 tft exec mv tft /usr/local/bin -#-static -lncursesw -ltinfo diff --git a/readme.md b/readme.md deleted file mode 100644 index e69de29..0000000 diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..528b28b --- /dev/null +++ b/readme.txt @@ -0,0 +1,53 @@ +tft - Terminal Family Tree + +tft can create and display family trees on the terminal. + + +HOW TO CREATE: + +Trees are created using the tft file format, for example this tft file: + +# This is a comment +Adam, M # Adam is a male + +Eve, F +s: Adam # Eve's spouse is Adam + +Cain, M +p: Adam, Eve # Cain's parents are Adam and Eve + +Abel, M +p: - # Abel's parents are the same as the last person's (Cain) + +Seth, M +p: - + + +Will produce: + +├──────┬┬─────┐ +│ ││ │ +│ Adam ││ Eve │ +│ ││ │ +├──────┘└─────┘ +│ +├────────┬────────┐ +│ │ │ +├──────┐ ├──────┐ ├──────┐ +│ │ │ │ │ │ +│ Cain │ │ Abel │ │ Seth │ +│ │ │ │ │ │ +└──────┘ └──────┘ └──────┘ + + + +HOW TO INSTALL: + +Make sure you have permissons and execute: + git clone https://gitlab.com/venelin98/tft.git + ./install.sh + + +HOW TO USE: + + tft ${MY_TFT_FILE} diff --git a/src/create_tree.cpp b/src/create_tree.cpp index 6da506a..af96fdc 100644 --- a/src/create_tree.cpp +++ b/src/create_tree.cpp @@ -1,15 +1,15 @@ -#include -#include "tree.hpp" -#include "utils.hpp" +/* #include */ +/* #include "tree.hpp" */ +/* #include "utils.hpp" */ -#include "user_tree.hpp" +/* #include "user_tree.hpp" */ -int main() -{ - init(); +/* int main() */ +/* { */ +/* init(); */ - create_tree(); +/* create_tree(); */ - endwin(); /* stop ncursers */ - return 0; -} +/* endwin(); /\* stop ncursers *\/ */ +/* return 0; */ +/* } */ diff --git a/example_tree.hpp b/src/example_tree.hpp similarity index 100% rename from example_tree.hpp rename to src/example_tree.hpp diff --git a/tft_create b/tft_create deleted file mode 100755 index 5d5f6b5..0000000 --- a/tft_create +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -set -e - -if [ "$1" = '' ] -then - echo 'The first argument needs to be the tree file' - exit 1 -fi - -tree_file="$(realpath "$1")" -start_dir="$PWD" -script_dir="$(dirname $(readlink -f $0))" - -cd "$script_dir/src" - -language=' - -std=c++17 - -fno-rtti - -fno-exceptions - -fno-non-call-exceptions - -fno-common' -# force each global variable to be only defined once - -warnings='-Wall -Wextra -Wpedantic' #-fanalyzer - -cp -f "$tree_file" user_tree.hpp -g++ -o "$start_dir/${1%.*}.tft" $language $warnings -march=native -DNDEBUG -pipe -g create_tree.cpp tree.cpp person.cpp utils.cpp -lncursesw -rm user_tree.hpp -cd "$start_dir" -exec "./${1%.*}.tft"