本文档翻译自:https://docs.conan.io/en/latest/reference/commands/misc/inspect.html
:::success
Warning
这是一项实验性功能,可能会在将来的发行版中进行重大更改。
:::
$ conan inspect [-h] [-a [ATTRIBUTE]] [-r REMOTE] [-j JSON] [--raw RAW]path_or_reference
显示conanfile属性,例如名称,版本和选项。 在本地,本地缓存和远程工作。
positional arguments:path_or_reference Path to a folder containing a recipe (conanfile.py) orto a recipe file. e.g., ./my_project/conanfile.py. Itcould also be a referenceoptional arguments:-h, --help show this help message and exit-a [ATTRIBUTE], --attribute [ATTRIBUTE]The attribute to be displayed, e.g "name"-r REMOTE, --remote REMOTElook in the specified remote server-j JSON, --json JSON json output file--raw RAW Print just the value of the requested attribute
Examples:
$ conan inspect zlib/1.2.11@ -a=name -a=version -a=options -a default_options -r=conan-centername: zlibversion: 1.2.11optionsshared: [True, False]default_options: shared=False
$ conan inspect zlib/1.2.11@ -a=license -a=urllicense: Zliburl: https://github.com/conan-io/conan-center-index
$ conan inspect zlib/1.2.11@ --raw=settings('os', 'arch', 'compiler', 'build_type')
如果未通过-a定义任何特定属性,则将显示一些默认属性:
$ conan inspect zlib/1.2.11@name: zlibversion: 1.2.11url: https://github.com/conan-io/conan-center-indexhomepage: https://zlib.netlicense: Zlibauthor: Nonedescription: A Massively Spiffy Yet Delicately Unobtrusive Compression Library (Also Free, Not to Mention Unencumbered by Patents)topics: Nonegenerators: cmakeexports: Noneexports_sources: ['CMakeLists.txt', 'CMakeLists_minizip.txt', 'minizip.patch']short_paths: Falseapply_env: Truebuild_policy: Nonerevision_mode: hashsettings: ('os', 'arch', 'compiler', 'build_type')options:fPIC: [True, False]minizip: [True, False]shared: [True, False]default_options:fPIC: Trueminizip: Falseshared: False
