-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
gdal CLI: add Bash completion #11563
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rouault
added
the
funded through GSP
Work funded through the GDAL Sponsorship Program
label
Jan 1, 2025
rouault
force-pushed
the
gdal_completion
branch
2 times, most recently
from
January 1, 2025 18:12
5ea32a4
to
651abe7
Compare
rouault
force-pushed
the
gdal_completion
branch
2 times, most recently
from
January 1, 2025 18:21
ff0c031
to
821f294
Compare
rouault
force-pushed
the
gdal_completion
branch
2 times, most recently
from
January 1, 2025 18:45
6654eea
to
12d1899
Compare
rouault
force-pushed
the
gdal_completion
branch
from
January 1, 2025 19:08
12d1899
to
5dfb911
Compare
rouault
force-pushed
the
gdal_completion
branch
3 times, most recently
from
January 1, 2025 22:46
d2346af
to
e25a4ab
Compare
rouault
force-pushed
the
gdal_completion
branch
2 times, most recently
from
January 1, 2025 23:18
c9493ff
to
a3b32dc
Compare
rouault
force-pushed
the
gdal_completion
branch
10 times, most recently
from
January 2, 2025 04:10
36553dd
to
e53e8ab
Compare
rouault
force-pushed
the
gdal_completion
branch
8 times, most recently
from
January 2, 2025 14:24
875906a
to
de2b68d
Compare
Examples: ``` $ gdal <TAB><TAB> convert info pipeline raster vector ``` ``` $ gdal r<TAB> ==> $ gdal raster ``` ``` $ gdal raster<TAB><TAB> convert edit info pipeline reproject ``` ``` $ gdal raster info -<TAB><TAB> --approx-stats -f --help --if --json-usage --min-max --no-fl --no-md --oo --stats --checksum --format --hist --input --list-mdd --mm --no-gcp --no-nodata --open-option --subdataset --drivers -h -i --input-format --mdd --no-ct --no-mask --of --output-format --version ``` ``` $ gdal raster info --of <TAB><TAB> json text ``` ``` $ gdal raster info --of=<TAB><TAB> json text ``` ``` $ gdal raster info --of=j<TAB> ==> $ gdal raster info --of=json ``` ``` $ gdal raster convert --of <TAB><TAB> AAIGrid CALS ERS GSAG ILWIS KEA MFF OpenFileGDB R SQLite WMTS ADRG COG EXR GSBG ISCE KMLSUPEROVERLAY MFF2 PAux Rasterlite SRTMHGT XPM AVIF CTable2 FIT GTA ISIS2 KRO MRF PCIDSK RMF Terragen XYZ BAG DDS FITS GTiff ISIS3 KTX2 netCDF PCRaster ROI_PAC TileDB Zarr BASISU DTED GeoRaster GTX JP2ECW LAN NGW PDF RRASTER USGSDEM ZMap BLX ECW GIF HDF4Image JP2KAK LCP NITF PDS4 RST VICAR BMP EHdr GPKG HEIF JP2OpenJPEG Leveller NTv2 PNG SAGA VRT BT ELAS GRIB HF2 JPEG MBTiles NULL PNM SGI WEBP BYN ENVI GS7BG HFA JPEGXL MEM NWT_GRD PostGISRaster SIGDEM WMS ``` ``` $ gdal raster convert in.tif out.tif --co <TAB><TAB> ALPHA= ENDIANNESS= JXL_EFFORT= PIXELTYPE= SOURCE_PRIMARIES_RED= TIFFTAG_TRANSFERRANGE_BLACK= BIGTIFF= GEOTIFF_KEYS_FLAVOR= JXL_LOSSLESS= PREDICTOR= SOURCE_WHITEPOINT= TIFFTAG_TRANSFERRANGE_WHITE= BLOCKXSIZE= GEOTIFF_VERSION= LZMA_PRESET= PROFILE= SPARSE_OK= TILED= [ ... snip ... ] ``` ``` $ gdal raster convert in.tif out.tif --co COMP<TAB> ==> $ gdal raster convert in.tif out.tif --co COMPRESS= ``` ``` $ gdal raster convert in.tif out.tif --co COMPRESS=<TAB><TAB> CCITTFAX3 CCITTRLE JPEG LERC LERC_ZSTD LZW PACKBITS ZSTD CCITTFAX4 DEFLATE JXL LERC_DEFLATE LZMA NONE WEBP ``` ``` $ gdal raster convert in.tif out.tif --co TILED=<TAB><TAB> NO YES ``` ``` $ gdal raster convert in.tif out.tif --co ZLEVEL=<TAB><TAB> 1 10 11 12 2 3 4 5 6 7 8 9 ``` ``` $ gdal raster convert --of COG --co <TAB><TAB> ADD_ALPHA= EXTENT= JXL_LOSSLESS= NUM_THREADS= OVERVIEW_RESAMPLING= RESAMPLING= WARP_RESAMPLING= ALIGNED_LEVELS= GEOTIFF_VERSION= LEVEL= OVERVIEW_COMPRESS= OVERVIEWS= SPARSE_OK= ZOOM_LEVEL= BIGTIFF= JXL_ALPHA_DISTANCE= MAX_Z_ERROR= OVERVIEW_COUNT= PREDICTOR= STATISTICS= ZOOM_LEVEL_STRATEGY= BLOCKSIZE= JXL_DISTANCE= MAX_Z_ERROR_OVERVIEW= OVERVIEW_PREDICTOR= QUALITY= TARGET_SRS= COMPRESS= JXL_EFFORT= NBITS= OVERVIEW_QUALITY= RES= TILING_SCHEME= ``` ``` $ gdal --config <TAB><TAB> ... long list of known configuration options ... ``` ``` $ gdal --config AWS_<TAB><TAB> AWS_ACCESS_KEY_ID= AWS_DEFAULT_REGION= AWS_REQUEST_PAYER= AWS_STS_ENDPOINT= AWS_CONFIG_FILE= AWS_HTTPS= AWS_ROLE_ARN= AWS_STS_REGION= AWS_CONTAINER_AUTHORIZATION_TOKEN= AWS_MAX_KEYS= AWS_ROLE_SESSION_NAME= AWS_STS_REGIONAL_ENDPOINTS= AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE= AWS_NO_SIGN_REQUEST= AWS_S3_ENDPOINT= AWS_TIMESTAMP= AWS_CONTAINER_CREDENTIALS_FULL_URI= AWS_PROFILE= AWS_SECRET_ACCESS_KEY= AWS_VIRTUAL_HOSTING= AWS_DEFAULT_PROFILE= AWS_REGION= AWS_SESSION_TOKEN= AWS_WEB_IDENTITY_TOKEN_FILE= ``` ``` $ gdal raster reproject --dst-crs EPSG: ESRI: IAU_2015: IGNF: NKG: OGC: ``` ``` $ gdal raster reproject --dst-crs EP<TAB> ==> $ gdal raster reproject --dst-crs EPSG: ``` ``` $ gdal raster reproject --dst-crs EPSG:<TAB> 10150 -- MSL UK & Ireland VORF08 depth 10151 -- CD UK & Ireland VORF08 depth 10156 -- ETRS89 + MSL UK & Ireland VORF08 depth 10157 -- ETRS89 + CD UK & Ireland VORF08 depth [ ... snip ... ] ``` ``` $ gdal raster reproject --dst-crs EPSG:432<TAB> 4322 -- WGS 72 4324 -- WGS 72BE 4326 -- WGS 84 4327 -- WGS 84 (geographic 3D) 4328 -- WGS 84 (geocentric) 4329 -- WGS 84 (3D) ``` Last but not least: autocompletion of VSI files ``` $ gdal raster info /vsis3/my_bucket/b<TAB><TAB> /vsis3/my_bucket/byte.tif /vsis3/my_bucket/byte2.tif ```
rouault
force-pushed
the
gdal_completion
branch
from
January 2, 2025 16:15
de2b68d
to
f239c6f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #11520
Examples:
Last but not least: autocompletion of VSI files