Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Project: GDAL 4 : * Purpose: gdal "info" subcommand 5 : * Author: Even Rouault <even dot rouault at spatialys.com> 6 : * 7 : ****************************************************************************** 8 : * Copyright (c) 2024, Even Rouault <even dot rouault at spatialys.com> 9 : * 10 : * SPDX-License-Identifier: MIT 11 : ****************************************************************************/ 12 : 13 : //! @cond Doxygen_Suppress 14 : 15 : #include "cpl_error.h" 16 : #include "gdalalg_info.h" 17 : #include "gdalalg_raster_info.h" 18 : #include "gdalalg_vector_info.h" 19 : #include "gdalalg_dispatcher.h" 20 : #include "gdal_priv.h" 21 : 22 : /************************************************************************/ 23 : /* GDALInfoAlgorithm */ 24 : /************************************************************************/ 25 : 26 83 : GDALInfoAlgorithm::GDALInfoAlgorithm() 27 83 : : GDALDispatcherAlgorithm(NAME, DESCRIPTION, HELP_URL) 28 : { 29 83 : AddProgressArg(/* hidden = */ true); 30 : // only for the help message 31 83 : AddOutputFormatArg(&m_format).SetChoices("json", "text"); 32 83 : AddInputDatasetArg(&m_dataset).AddAlias("dataset"); 33 : 34 : m_longDescription = "For all options, run 'gdal raster info --help' or " 35 83 : "'gdal vector info --help'"; 36 83 : } 37 : 38 2 : bool GDALInfoAlgorithm::RunImpl(GDALProgressFunc, void *) 39 : { 40 2 : CPLError(CE_Failure, CPLE_AppDefined, 41 : "The Run() method should not be called directly on the \"gdal " 42 : "info\" program."); 43 2 : return false; 44 : } 45 : 46 : //! @endcond