[WIP] CLI: Add basic command alias mapping for grass run#7216
[WIP] CLI: Add basic command alias mapping for grass run#7216ArthPatel1502 wants to merge 1 commit intoOSGeo:mainfrom
grass run#7216Conversation
|
I don't know if this is a good direction, but you can explore a slight modification of your approach which I considered previously:
This can be computed, as opposed to a hardcoded mapping (leaving the r.slope.aspect vs slope vs aspect issue aside). There might be a in-the-middle solution as well. If you are asking what might a better area to focus on, evaluate the above against reading directly from a GeoTIFF and other files in the command line: Exploring both should give you a better picture. For PR, include tests of the new functionality even for experiments to clearly demonstrate the intended behavior. |
|
Hi, thank you — this is very helpful. I understand the concern about hardcoded alias mapping becoming arbitrary. The structured form such as I’ll explore both directions:
I’ll compare them from the perspective of usability, implementation complexity, and how well they align with the goals of the Subcommand CLI project. I’ll also make sure the next PR includes tests to demonstrate the intended behavior clearly. Thanks again — this gives me a much better direction for the next iteration. |
|
It could probably be computed also when used as suggested by @ArthPatel1502 For example, for
Apologies for the noise. |
|
Thanks for the detailed feedback — this clarifies the direction significantly. I see the limitation of hardcoded alias mapping and agree that a structured approach like grass raster slope.aspect is more scalable and aligns better with the existing module naming scheme. I’ll explore how this can be derived programmatically rather than relying on manual mappings. In parallel, I will also experiment with direct file-based workflows (e.g., running modules directly on GeoTIFF inputs/outputs) to evaluate how well they improve usability in practice. For the next iteration, I’ll focus on comparing these approaches in terms of usability and implementation, and include tests to clearly demonstrate the behavior. |
|
@luisponti Feel free to make suggestions here. The subcommand CLI is in design stage, although thinks can be committed and dome are already available. |
Hi,
This PR introduces a small proof-of-concept for command alias mapping in the experimental CLI (
grass run).Motivation:
Currently, users need to know full GRASS module names such as
r.slope.aspectorg.list. This can be unintuitive, especially for new users or quick workflows.This PR explores a simple alias layer that maps shorter commands to existing modules.
Current implementation:
slope→r.slope.aspectlist→g.listExample usage:
grass run slope elevation=elev_lid792_1m slope=out_slope aspect=out_aspect
grass run list type=raster
This is intentionally minimal and meant as a starting point for discussion.
Before this PR, I built a local prototype which mapped simplified commands and verified an end-to-end workflow including region setup, raster analysis, and GeoTIFF output.
Questions:
Thanks,
Arth