I have a CLI tool idea that'll be so powerful for people who always get so cool ideas that they want to test, but unfortunately it always comes in the wrong time or place (i.e. when you're in the bathroom or bed), we may call it "teda", TEst iDeA... basically it's a CLI tool to do much of the routine work required to test your ideas, for example let's say you got an idea of memory allocator in C that you really want to apply, you run something like:
teda "allocator" ~/tests/ -l=c
and it'll go to ~/tests/ dir, make a new dir called "allocator" (the project name) and it'll assume the language is C, we can support a lot of languages and each one has its own dir structure, for example C will tell the tool to make this dir structure:
allocator
|
|---src/
|
|---include/
|---README.md
|---.teda
|---CMakeLists.txt
and you have a dir structure ready to start coding directly!
now what about .teda file?
this is for teda tool itself to help you in the project itself not only in preparing it for you.. we can define a specific format this file will follow and teda will parse it, for example the first segment of the file can be build instructions, like:
mkdir -p build
cd build
etc..
and wherever you're in your machine, you can just type:
teda build allocator
and it'll go to ~/tests/ folder, search for a folder called "allocator", if it's not found it'll show us a beautiful message and exit, if it's found it'll go to that folder, search for .teda file, if it's not found it'll show us a beautiful message and exit, if it's found it'll execute the commands in the first part of the file, and now you have your project built and ready to run!
further more?
we can say the second segment is for building and running the project!
so it can simply be:
__BUILD__
./allocator
__BUILD__ is a reserved word and it tells teda to run another segment before this segment, in this case it's the first segment of the file, the build segment!
we can have punch of other segments, each with a corresponding command and you have total freedom about what gets executed there:
teda run, test, clean, docs (building the docs for the project) and more and more!
this idea is insanely powerful for me because I get A LOT of ideas every single minute!
I can show the structure of my tests folder:
No comments:
Post a Comment
any inappropriate comments will be deleted and the commenter will get blocked permanently unless I'm free to fuck him.