Skip to content

g.findfile: use element aliases #5998

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

petrasovaa
Copy link
Contributor

@petrasovaa petrasovaa commented Jun 30, 2025

g.findfile didn't take raster/raster_3d/region, even though g.findfile -l lists them. This PR fixes that.

Also adds a new -t flag similarly to r.mask.status to get the error code without printing the results. In the future, without -t it should always return success.

@github-actions github-actions bot added Python Related code is in Python C Related code is in C libraries module general tests Related to Test Suite labels Jul 1, 2025
@@ -74,6 +75,12 @@ int main(int argc, char *argv[])
l_flag->description = _("List available elements and exit");
l_flag->suppress_required = YES;

t_flag = G_define_flag();
t_flag->key = 't';
t_flag->label = _("Return code 0 when file found, 1 otherwise");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the terminology, exit code or return code? Is it clear for the translators?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exit status and return code are the same thing, I think it would be difficult to guess what translators are more familiar with. I copied this from r.mask.status.

Copy link
Member

@echoix echoix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming nothing is wrong in the C file

Copy link
Contributor

@nilason nilason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C code looks fine to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C general libraries module Python Related code is in Python tests Related to Test Suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants