本文档翻译自:https://docs.conan.io/en/latest/reference/commands/consumer/get.html

    1. $ conan get [-h] [-p PACKAGE] [-r REMOTE] [-raw] reference [path]

    获取文件或列出给定引用或包的目录。

    1. positional arguments:
    2. reference Recipe reference or package reference e.g.,
    3. 'MyPackage/1.2@user/channel', 'MyPackage/1.2@user/chan
    4. nel:af7901d8bdfde621d086181aa1c495c25a17b137'
    5. path Path to the file or directory. If not specified will
    6. get the conanfile if only a reference is specified and
    7. a conaninfo.txt file contents if the package is also
    8. specified
    9. optional arguments:
    10. -h, --help show this help message and exit
    11. -p PACKAGE, --package PACKAGE
    12. Package ID [DEPRECATED: use full reference instead]
    13. -r REMOTE, --remote REMOTE
    14. Get from this specific remote
    15. -raw, --raw Do not decorate the text

    Examples:

    • 从远程软件包中打印conanfile.py:

      1. $ conan get zlib/1.2.8@ -r conan-center
    • 列出本地软件包配方的文件: ```shell $ conan get zlib/1.2.11@ .

    Listing directory ‘.’: CMakeLists.txt conanfile.py conanmanifest.txt

    1. - 从配方文件夹中打印文件:
    2. ```shell
    3. $ conan get zlib/1.2.11@ conanmanifest.txt
    • 打印conaninfo.txt文件以获取二进制包:
      1. $ conan get zlib/1.2.11@:2144f833c251030c3cfd61c4354ae0e38607a909
      ```shell [settings] arch=x86_64 build_type=Release compiler=apple-clang compiler.version=8.1 os=Macos

    [requires]

    [options]

    1. # ...
    1. - 列出远程二进制包中的文件:
    2. ```shell
    3. $ conan get zlib/1.2.11@:2144f833c251030c3cfd61c4354ae0e38607a909 . -r conan-center
    4. Listing directory '.':
    5. conan_package.tgz
    6. conaninfo.txt
    7. conanmanifest.txt