Commit Graph

33 Commits

Author SHA1 Message Date
Lux Aliaga 17217173f4 src: Revamp message displaying
Errors and messages will now be handled by a single module called
message.rs. This module has a new function called append_emoji(), which
will prefix emojis to each message. It also adds an enum named
EmojiType, which will contain each possible emoji prefix. Lastly, add
two new configs: "display_emoji" and "display_colors". "display_colors"
is yet to be implemented.
2023-08-19 18:54:43 -04:00
Lux Aliaga 1e2fb49dac inv: Remove whitespace between emoji and message
This happened to be an issue with the terminal I was using to test out
Vento. It would not space emojis correctly, causing them to require an
additional whitespace to be displayed correctly. Now that I've switched
terminals, it's now displayed as it really is: two whitespaces. Remove
the additional whitespaces I've accidentally added.
2023-08-19 18:54:43 -04:00
Lux Aliaga 27b42e963e
error: Add more error types
Since error refactoring was quite incomplete, I've added more errors for other parts of Vento. This should cover almost every error except slot errors, since those require their own formatting.
2023-02-19 14:42:26 -03:00
Lux Aliaga 791cdf3193
src: Supress clippy warnings
Most of them were related to unnecessary borrows, although one was
because I pointlessly added a format! inside a println!. Whoops.
2023-02-09 21:35:12 -03:00
Lux Aliaga ef3dcf8acc
inv: Emoji consistency
The slot switching action had a different emoji for confirming the
command was successful compared to other actions, so I switched it for
the green checkmark.
2022-11-03 21:15:00 -03:00
Lux Aliaga 19aa1955c8
inv: Add "message" arg to slot switching
When undoing a slot switching command, it would show the message
normally show when running the command by itself, which is not supposed
to happen. This commit fixes that by adding a boolean argument that will
print the message when true.
2022-11-03 19:42:39 -03:00
Lux Aliaga c1533e6b41
inv: Include slot switching in undoable actions
Turns out the history didn't include undoing slot switching, so an
action could accidentally be undone in the wrong slot. I've fixed that
and also reorganized the source so undoing actions wouldn't be pegged to
the item module.
2022-11-03 19:26:15 -03:00
Lux Aliaga 6ad43bbf82
src: Remove periods from end of sentences
For many messages there were some consistency issues in terms of
punctuation. I've fixed this issue by removing every period from every
sentence.
2022-11-03 19:08:50 -03:00
Lux Aliaga 69ce377ec1
src: Improve documentation
Also removes an extra unnecessary comma.
2022-10-26 16:49:45 -03:00
Lux Aliaga 5f5ae6e41e
src: Removed redundant clones
These suggestions were made by cargo clippy. These clones were
previously there to remove compiler messages, but it seems like they're
not needed anymore.
2022-10-23 12:54:23 -03:00
Lux Aliaga 5e05bfa2ef
src: Removed unnecessary contexts
This commit should remove some contexts that actually made some errors
more difficult to read. They will now display the idiomatic errors
generated by anyhow.
2022-10-17 19:56:23 -03:00
Lux Aliaga d51163ef09
common: Use struct to deliver settings
After learning more about structs, I've decided to try and use them in
the common module. It replaces the original behavior of delivering the
data using a vector in favor of the Settings struct, also defined on the
same file.
2022-10-17 18:11:38 -03:00
Lux Aliaga 4712c67bc2
src: Implemented clippy recommendations
Should make some code look less silly.
2022-10-01 17:38:14 -03:00
Lux Aliaga 6ec32037db
src: Code comments and cleanup
Basically some last refinements to make the code look a bit more
readable and presentable.
2022-09-27 20:05:08 -03:00
Lux Aliaga 45dfcc9f19
fixup! src: Universal error handling 2022-09-27 19:29:54 -03:00
Lux Aliaga 8fe5bca167
src: Universal error handling
This commit should unify the way Vento handles errors. Solves #7.
2022-09-27 19:16:18 -03:00
Lux Aliaga ac986f8822
vento: The BIG commit
Since I worked on a LOT of stuff here, it's quite hard for me to
separate every change I've done. Take this as one huge refactor, which
includes:
- Changing the syntax of the Vento command
- Separating Vento into three binaries: vento, take, drop
- Moving the help messages into a new file called help.rs
- Removing unnecessary format macros
- Changing expect macros to context, for better anyhow compatibility
- Updating the documentation for these changes.
2022-09-26 16:58:33 -03:00
Lux Aliaga 76ad4aad5a
src: Better error handling
Should make it more Rusty™. Solves #2. Thank you @j0 for the help. (i'm
big stupid lol)
2022-09-19 00:31:30 -03:00
Lux Aliaga d24727d301
inv: Prevent non-files from displaying file size
Maybe for folders I could later add a folder size but the method I'm
using to calculate file sizes doesn't work with folders, so yeah.
2022-09-18 00:35:50 -03:00
Lux Aliaga d11a200d6f
inv: Added directory listing
Now you can list the contents of directories with the list command!
2022-09-18 00:31:23 -03:00
Lux Aliaga 6c51a8da6e
inv: Show new message if inventory is empty
Basically so it looks less dumb if there aren't any items in the
inventory the user asked to list.
2022-09-17 22:53:44 -03:00
Lux Aliaga 445b5b1671
inv: Add directory count to inventory list
This commit modifies the spacing before an item in the inventory list.
2022-09-17 22:43:34 -03:00
Lux Aliaga 6c10953e88
inv: Add file size to inventory list
This commit also improves formatting in the inventory list.
2022-09-17 18:33:40 -03:00
Lux Aliaga 30f99bbda4
inv: Add file types to inventory list
This will be specially useful once we can access directories from vento
list. For now it still serves the function of letting the user know some
basic metadata about the files they're keeping in their inventory
2022-09-17 17:27:33 -03:00
Lux Aliaga c2e276c6e2
src: Code cleanup
To demessify the project I've decided to clean the code a bit and make
it a little less painful to see. The main change here is that instead of
defining every single time the active and inactive directories it calls
it from a vector in common.rs, which is cleaner and allows for easily
implementing a config file to customize those values later on. Also,
version bump!
2022-09-17 05:49:52 -03:00
Lux Aliaga 8a68b7d3b5 src: Moved env_config() to new module
Since item management will depend on this function, making it
independent from inv.rs will probably be for the best.
2022-09-14 19:45:28 -03:00
Lux Aliaga 524a5d3674 inv: list: Tabulation before item
Just to make it look a bit more fancy
2022-09-14 19:11:42 -03:00
Lux Aliaga 8ac901c0d6 src: Added license notice 2022-09-14 18:45:47 -03:00
Lux Aliaga 9d24f51b1c inv: list: Add method to catch invalid slot
If you tried to type anything that isn't a valid slot, Vento would
panic. This commit should fix that.
2022-09-14 16:33:19 -03:00
Lux Aliaga 88d07f5014 fixup! fixup! vento: Imported changes to Git 2022-09-14 16:21:11 -03:00
Lux Aliaga 9b49385044 inv: list: Code cleanup
inv::list() had quite an unnecessary function so I cleaned the code a
bit so it works a bit more cleanly™
2022-09-14 16:14:07 -03:00
Lux Aliaga 24d962fa7b inv: Code comments
I've added some comments to make browsing this file a bit less painful.
2022-09-14 16:11:24 -03:00
Lux Aliaga 282a358f6e vento: Imported changes to Git
Since I didn't work on the initial part of the project on Git, I guess
I'll just do a big commit with all of what I did. This includes the
inventory management commands "list" and "switch", plus the command to
initialize Vento.
2022-09-14 09:36:34 -03:00