New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite #30
Conversation
I'm unsure how to add a pull request to a pull request, but just a suggestion on adding color to the help message. File: // --snip--
use clap::{Clap, AppSettings};
use wutag_core::Error;
pub const APP_NAME: &str = "wutag";
pub const APP_VERSION: &str = "0.4.0";
pub const APP_AUTHOR: &str = "Wojciech Kępka <wojciech@wkepka.dev>";
pub const APP_ABOUT: &str = "Tool to tag and manage tags of files.";
#[derive(Clap)]
#[clap(
version = APP_VERSION,
author = APP_AUTHOR,
about = APP_ABOUT,
global_setting = AppSettings::ColoredHelp,
global_setting = AppSettings::ColorAuto,
)]
pub struct Opts {
#[clap(short, long)]
// --snip-- And editing just to say that I like the new format, I'm unsure if the I know that this is just a pull request and has not been merged to the master branch yet, but I'm also putting in here to say that when running wutag rm '*' tag_name I get the following errors: /Users/lucasburns/test/lmformarks/formarks.plugin.zsh:
ERROR tag `ftagged` doesn't exist - /Users/lucasburns/test/lmformarks/formarks.plugin.zsh
/Users/lucasburns/test/ftag:
ERROR tag `ftagged` doesn't exist - /Users/lucasburns/test/ftag But when listing files with that same tag using: wutag list files
# or
wutag list tags The files still appear. Also, running wutag clear '**'
# or
wutag clear <same_pattern_used_to_tag> The files also still appear whenever listing. Like I said, I know that this is pull request, but I wanted to let you know what errors I am getting. I'm in the process of learning Rust now and could possibly help some. I'd like to at least. My system is |
Thanks for checking out the PR! This is very much helpful :) I added the color to the help message - it's a worthy addition and fits well with the style of wutag. I also updated how |
The issue still isn't resolved and I get the same behavior when using I can run the following command many times in a row and nothing happens except for this output. I'm unsure if it is both deleting the wutag rm '*.sh'
/Users/lucasburns/test/clap/count-tests.sh:
/Users/lucasburns/test/aaa.sh:
saving to /Users/lucasburns/Library/Caches/wutag.registry It is different with this command (I think this is how it's supposed to be used). If the command is ran again, I get an error saying that the tag doesn't exists, but when listing the files and the tags (these are the only files with the tags) they still show up. I'm unsure if you want the default behavior to remove all tags on files matching the glob, or if a tag has to be provided. If a tag is not provided, no error is thrown and it lists the files that are matching the wutag rm '*.sh' shell2
/Users/lucasburns/test/clap/count-tests.sh:
X shell2
/Users/lucasburns/test/aaa.sh:
X shell2
saving to /Users/lucasburns/Library/Caches/wutag.registry After running above command: $ wutag list files
/Users/lucasburns/test/clap/count-tests.sh
/Users/lucasburns/test/aaa.sh
$ wutag list tags
shell2 I think the behavior would be to delete the tag from the Showing errors if tag doesn't exist, and saying it is removing others.
Using the following does work: wutag edit <tag> --color 0x1f1f1f Another issue I am having (though I am unsure if this is default behavior), is that whenever I wutag -d $PWD list files
# or
wutag -d . list files the entire file system is also traversed. If there is anything that you'd like me to try out to see if I can resolve the problem, I can. Also, all the tests are passed. |
cargo runThis post should be much more complete and show every command.
|
I missed a few bugs, should be better now.
This should not display the paths anymore unless the tags are actually deleted.
This shouldn't be the case, current implementation doesn't touch the file system except for the cache file from which the list of entries or tags is read. The I saw you also got a panic when doing a |
Please try the latest commit 3c5dea7 , it should fix most of the issues. |
I also noticed that |
A sidenote, testing out some of the version of the code I ended up with files without tags that are in cache. To clear it up I had to manually remove |
I removed the registry manually, and when running both Would it also be possible to have an option to maybe implement this function Perhaps, |
Would you mind removing the registry again and noting exactly what commands you issue to get into this state? I cannot really reproduce it. EDIT: I was able to find the issue, it should be working now |
I think I will merge this PR for now as it contains way too many changes. If you find any new bugs please report them in separate issues :) Thanks! |
Awesome, it is working now! The tags and files both are no longer being displayed after removing the tags or clearing the tags. I like how it shows that it is cleared as well. I have been using jdberry's |
This PR is a big rewrite of the core functionality. Now the tags and entries are stored locally to a file in a OS cache directory. This allows for much better output and faster execution.
Closes: #6
Closes: #29