本文档翻译自: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) or
to a recipe file. e.g., ./my_project/conanfile.py. It
could also be a reference
optional arguments:
-h, --help show this help message and exit
-a [ATTRIBUTE], --attribute [ATTRIBUTE]
The attribute to be displayed, e.g "name"
-r REMOTE, --remote REMOTE
look 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-center
name: zlib
version: 1.2.11
options
shared: [True, False]
default_options: shared=False
$ conan inspect zlib/1.2.11@ -a=license -a=url
license: Zlib
url: 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: zlib
version: 1.2.11
url: https://github.com/conan-io/conan-center-index
homepage: https://zlib.net
license: Zlib
author: None
description: A Massively Spiffy Yet Delicately Unobtrusive Compression Library (Also Free, Not to Mention Unencumbered by Patents)
topics: None
generators: cmake
exports: None
exports_sources: ['CMakeLists.txt', 'CMakeLists_minizip.txt', 'minizip.patch']
short_paths: False
apply_env: True
build_policy: None
revision_mode: hash
settings: ('os', 'arch', 'compiler', 'build_type')
options:
fPIC: [True, False]
minizip: [True, False]
shared: [True, False]
default_options:
fPIC: True
minizip: False
shared: False