Skip to content
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

Checking a Directory exists #18

Open
gedw99 opened this issue Jan 17, 2025 · 4 comments
Open

Checking a Directory exists #18

gedw99 opened this issue Jan 17, 2025 · 4 comments

Comments

@gedw99
Copy link

gedw99 commented Jan 17, 2025

I have this cross platform problem.

I need a way to know if a Folder exists.

If it exists then it just gives you back the absolute value.
If it does not exist, then it give you back "".

I think the way to do the CLI for this command is like this.

fsize which <PATH>

Why cal it "which". Well because we all know the the concept of which for asking the OS where a bin exists on the path.

So for knowing where a Folder exists it feels really intuitive.

--

On a side note, I am using this, to have a cross platform way to know where a binary exists in the OS. Works great...

https://github.com/hairyhenderson/go-which
# go install github.com/hairyhenderson/go-which/cmd/which
@Tom5521
Copy link
Owner

Tom5521 commented Jan 17, 2025

Is a good idea, but implementing a command that way I think would break the current implementation.

It should go with the way the program works, so it should be a flag.

@gedw99
Copy link
Author

gedw99 commented Jan 18, 2025

Ok flag it is . I was thinking that a command would be extra work not doing also ..

Do you want to do it , or shall I do it and or it in ?

@Tom5521
Copy link
Owner

Tom5521 commented Jan 18, 2025

Do you want to do it , or shall I do it and or it in ?

Do it yourself if you want, for now I'm more busy with xgotext and making it functional.

I was thinking that a command would be extra work not doing also ..

The main problem is as follows

the use of this program should be like this
fsize --flag1 --flag2 --flag3 file1 file2 file3 ...

If we add at least a single command to the root command of the program, this implementation would break because it would interpret file1 as a command and not an argument.

The only way to make it work that way is for it to add a command to do what it already does, something like fsize stat --flag1 --flag2 --flag3 file1 file2 file3

@gedw99
Copy link
Author

gedw99 commented Jan 18, 2025

I am fine with just using a flag .

I will do it .

It’s weekend here, so not working today :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants