本文档翻译自:https://docs.conan.io/en/latest/reference/commands/consumer/get.html
$ conan get [-h] [-p PACKAGE] [-r REMOTE] [-raw] reference [path]
获取文件或列出给定引用或包的目录。
positional arguments:reference Recipe reference or package reference e.g.,'MyPackage/1.2@user/channel', 'MyPackage/1.2@user/channel:af7901d8bdfde621d086181aa1c495c25a17b137'path Path to the file or directory. If not specified willget the conanfile if only a reference is specified anda conaninfo.txt file contents if the package is alsospecifiedoptional arguments:-h, --help show this help message and exit-p PACKAGE, --package PACKAGEPackage ID [DEPRECATED: use full reference instead]-r REMOTE, --remote REMOTEGet from this specific remote-raw, --raw Do not decorate the text
Examples:
从远程软件包中打印conanfile.py:
$ conan get zlib/1.2.8@ -r conan-center
列出本地软件包配方的文件: ```shell $ conan get zlib/1.2.11@ .
Listing directory ‘.’: CMakeLists.txt conanfile.py conanmanifest.txt
- 从配方文件夹中打印文件:```shell$ conan get zlib/1.2.11@ conanmanifest.txt
- 打印conaninfo.txt文件以获取二进制包:
```shell [settings] arch=x86_64 build_type=Release compiler=apple-clang compiler.version=8.1 os=Macos$ conan get zlib/1.2.11@:2144f833c251030c3cfd61c4354ae0e38607a909
[requires]
[options]
# ...
- 列出远程二进制包中的文件:```shell$ conan get zlib/1.2.11@:2144f833c251030c3cfd61c4354ae0e38607a909 . -r conan-centerListing directory '.':conan_package.tgzconaninfo.txtconanmanifest.txt
