Skip to content

Comments

g.remove: improve user message to contain more details#5484

Merged
echoix merged 1 commit intoOSGeo:mainfrom
neteler:g_remove_improve_message
Apr 1, 2025
Merged

g.remove: improve user message to contain more details#5484
echoix merged 1 commit intoOSGeo:mainfrom
neteler:g_remove_improve_message

Conversation

@neteler
Copy link
Member

@neteler neteler commented Apr 1, 2025

I find it unhelpful that g.remove is unspecific with its "file not found" message, e.g.

g.remove -f type=vector 'pattern=voronoi*'
WARNING: No data base element files found

g.remove -f type=raster,vector 'pattern=map*'
WARNING: No data base element files found

g.remove -f type=raster 'pattern=model*'
WARNING: No data base element files found

g.remove -f type=vector 'pattern=ato*'
WARNING: No data base element files found

Running this in scripted (cloud) environments may flood the logs with messages not helpful for debugging.

This PR changes the message to

g.remove -f type=raster 'pattern=bla*'
No file(s) found for type(s): raster

g.remove -f type=region 'pattern=bla*'
No file(s) found for type(s): region

g.remove -f type=all 'pattern=bla*'
No file(s) found for type(s): raster, raster_3d, vector, region, group

Co-authored-by: @nilason

I find it unhelpful that `g.remove` is unspecific with its "file not found" message, e.g.

```bash
g.remove -f type=vector 'pattern=voronoi*'
WARNING: No data base element files found

g.remove -f type=raster,vector 'pattern=map*'
WARNING: No data base element files found

g.remove -f type=raster 'pattern=model*'
WARNING: No data base element files found

g.remove -f type=vector 'pattern=ato*'
WARNING: No data base element files found
```

Running this in scripted (cloud) environments may flood the logs with messages not helpful for debugging.

This PR changes the message to

```bash
g.remove -f type=raster 'pattern=bla*'
No file(s) found for type(s): raster

g.remove -f type=region 'pattern=bla*'
No file(s) found for type(s): region

g.remove -f type=all 'pattern=bla*'
No file(s) found for type(s): raster, raster_3d, vector, region, group
```

Co-authored-by: Nicklas Larsson <[email protected]>
@neteler neteler added the manual Documentation related issues label Apr 1, 2025
@neteler neteler added this to the 8.5.0 milestone Apr 1, 2025
@neteler neteler self-assigned this Apr 1, 2025
@github-actions github-actions bot added C Related code is in C module general labels Apr 1, 2025
@echoix echoix merged commit 79b2bc9 into OSGeo:main Apr 1, 2025
28 of 30 checks passed
@neteler neteler deleted the g_remove_improve_message branch April 2, 2025 09:32
neteler added a commit that referenced this pull request Apr 2, 2025
g.remove:

I find it unhelpful that `g.remove` is unspecific with its "file not found" message, e.g.

```bash
g.remove -f type=vector 'pattern=voronoi*'
WARNING: No data base element files found

g.remove -f type=raster,vector 'pattern=map*'
WARNING: No data base element files found

g.remove -f type=raster 'pattern=model*'
WARNING: No data base element files found

g.remove -f type=vector 'pattern=ato*'
WARNING: No data base element files found
```

Running this in scripted (cloud) environments may flood the logs with messages not helpful for debugging.

This PR changes the message to

```bash
g.remove -f type=raster 'pattern=bla*'
No file(s) found for type(s): raster

g.remove -f type=region 'pattern=bla*'
No file(s) found for type(s): region

g.remove -f type=all 'pattern=bla*'
No file(s) found for type(s): raster, raster_3d, vector, region, group
```

Co-authored-by: Nicklas Larsson <[email protected]>
@neteler neteler modified the milestones: 8.5.0, 8.4.2 Apr 2, 2025
Kiraschild pushed a commit to Kiraschild/grass that referenced this pull request Apr 4, 2025
g.remove:

I find it unhelpful that `g.remove` is unspecific with its "file not found" message, e.g.

```bash
g.remove -f type=vector 'pattern=voronoi*'
WARNING: No data base element files found

g.remove -f type=raster,vector 'pattern=map*'
WARNING: No data base element files found

g.remove -f type=raster 'pattern=model*'
WARNING: No data base element files found

g.remove -f type=vector 'pattern=ato*'
WARNING: No data base element files found
```

Running this in scripted (cloud) environments may flood the logs with messages not helpful for debugging.

This PR changes the message to

```bash
g.remove -f type=raster 'pattern=bla*'
No file(s) found for type(s): raster

g.remove -f type=region 'pattern=bla*'
No file(s) found for type(s): region

g.remove -f type=all 'pattern=bla*'
No file(s) found for type(s): raster, raster_3d, vector, region, group
```

Co-authored-by: Nicklas Larsson <[email protected]>
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 manual Documentation related issues module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants