zackfall / ltc

Local Todo CLI
MIT License
0 stars 0 forks source link

Create a simple view that can can read a file passed as an argument #1

Open zackfall opened 1 year ago

zackfall commented 1 year ago

Make a simple interface that show the content of a file that will be passed as an argument to the cli. It will be watching for key event, so if you click the "q" it will close the interface.

zackfall commented 1 year ago

To create the interface I will use crossterm, and for read the file I will use the fs module of the standard library. I could use bufRead but I don't want to waste memory unnecessary. Because I know that the todos tasks at least for now, wouldn't be too large to need it.

zackfall commented 1 year ago

I was thinking of creating the file when I execute the program, so I will have to use the Write trait of the io module in the standard library. I will use the OpenOptions to make it easier to manage files and avoid problems with permissions.

zackfall commented 1 year ago

I need to study in deep how crossterm works, and how it render in the terminal and how I can make an interface, so I will be learning that before make the interface itself

zackfall commented 1 year ago

I didn't study too in deep, but I think I can manage myself the crate, and I think I will be able to create what I want. Whatever, what I'm going to do first is try to open the file and print it in the console. I must have to add serde, because I want to parse the json file into a rust struct.

zackfall commented 1 year ago

Now that I added serde, uuid and created the Todo struct, I have to find the way to get/create a file in the root folder that will contain the todos, and also create a type like Todos or something that store a vec of Todos.

zackfall commented 1 year ago

I added two structs to the program, the App and AppBuilder struct, I hope those structs ease the development process