Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for profile show --format=json #3388

Merged
merged 3 commits into from
Sep 15, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 64 additions & 20 deletions reference/commands/profile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,54 +138,56 @@ conan profile show
.. code-block:: text

$ conan profile show -h
usage: conan profile show [-h] [-v [V]] [-o OPTIONS_HOST]
[-o:b OPTIONS_BUILD] [-o:h OPTIONS_HOST]
[-pr PROFILE_HOST] [-pr:b PROFILE_BUILD]
[-pr:h PROFILE_HOST] [-s SETTINGS_HOST]
[-s:b SETTINGS_BUILD] [-s:h SETTINGS_HOST]
[-c CONF_HOST] [-c:b CONF_BUILD] [-c:h CONF_HOST]
usage: conan profile show [-h] [-f FORMAT] [-v [V]] [-o OPTIONS_HOST]
[-o:b OPTIONS_BUILD] [-o:h OPTIONS_HOST]
[-pr PROFILE_HOST] [-pr:b PROFILE_BUILD]
[-pr:h PROFILE_HOST] [-s SETTINGS_HOST]
[-s:b SETTINGS_BUILD] [-s:h SETTINGS_HOST]
[-c CONF_HOST] [-c:b CONF_BUILD] [-c:h CONF_HOST]

Show aggregated profiles from the passed arguments.

optional arguments:
-h, --help show this help message and exit
-v [V] Level of detail of the output. Valid options from less
-h, --help show this help message and exit
-f FORMAT, --format FORMAT
Select the output format: json
-v [V] Level of detail of the output. Valid options from less
verbose to more verbose: -vquiet, -verror, -vwarning,
-vnotice, -vstatus, -v or -vverbose, -vv or -vdebug,
-vvv or -vtrace
-o OPTIONS_HOST, --options OPTIONS_HOST
-o OPTIONS_HOST, --options OPTIONS_HOST
Define options values (host machine), e.g.: -o
Pkg:with_qt=true
-o:b OPTIONS_BUILD, --options:build OPTIONS_BUILD
-o:b OPTIONS_BUILD, --options:build OPTIONS_BUILD
Define options values (build machine), e.g.: -o:b
Pkg:with_qt=true
-o:h OPTIONS_HOST, --options:host OPTIONS_HOST
-o:h OPTIONS_HOST, --options:host OPTIONS_HOST
Define options values (host machine), e.g.: -o:h
Pkg:with_qt=true
-pr PROFILE_HOST, --profile PROFILE_HOST
-pr PROFILE_HOST, --profile PROFILE_HOST
Apply the specified profile to the host machine
-pr:b PROFILE_BUILD, --profile:build PROFILE_BUILD
-pr:b PROFILE_BUILD, --profile:build PROFILE_BUILD
Apply the specified profile to the build machine
-pr:h PROFILE_HOST, --profile:host PROFILE_HOST
-pr:h PROFILE_HOST, --profile:host PROFILE_HOST
Apply the specified profile to the host machine
-s SETTINGS_HOST, --settings SETTINGS_HOST
-s SETTINGS_HOST, --settings SETTINGS_HOST
Settings to build the package, overwriting the
defaults (host machine). e.g.: -s compiler=gcc
-s:b SETTINGS_BUILD, --settings:build SETTINGS_BUILD
-s:b SETTINGS_BUILD, --settings:build SETTINGS_BUILD
Settings to build the package, overwriting the
defaults (build machine). e.g.: -s:b compiler=gcc
-s:h SETTINGS_HOST, --settings:host SETTINGS_HOST
-s:h SETTINGS_HOST, --settings:host SETTINGS_HOST
Settings to build the package, overwriting the
defaults (host machine). e.g.: -s:h compiler=gcc
-c CONF_HOST, --conf CONF_HOST
-c CONF_HOST, --conf CONF_HOST
Configuration to build the package, overwriting the
defaults (host machine). e.g.: -c
tools.cmake.cmaketoolchain:generator=Xcode
-c:b CONF_BUILD, --conf:build CONF_BUILD
-c:b CONF_BUILD, --conf:build CONF_BUILD
Configuration to build the package, overwriting the
defaults (build machine). e.g.: -c:b
tools.cmake.cmaketoolchain:generator=Xcode
-c:h CONF_HOST, --conf:host CONF_HOST
-c:h CONF_HOST, --conf:host CONF_HOST
Configuration to build the package, overwriting the
defaults (host machine). e.g.: -c:h
tools.cmake.cmaketoolchain:generator=Xcode
Expand Down Expand Up @@ -243,6 +245,48 @@ Check the evaluated profile:
[conf]
...


The command can also output a json witht the results:
czoido marked this conversation as resolved.
Show resolved Hide resolved

.. code-block:: text

$ conan profile show --format=json

{
"host": {
"settings": {
"arch": "armv8",
"build_type": "Release",
"compiler": "apple-clang",
"compiler.cppstd": "gnu17",
"compiler.libcxx": "libc++",
"compiler.version": "15",
"os": "Macos"
},
"package_settings": {},
"options": {},
"tool_requires": {},
"conf": {},
"build_env": ""
},
"build": {
"settings": {
"arch": "armv8",
"build_type": "Release",
"compiler": "apple-clang",
"compiler.cppstd": "gnu17",
"compiler.libcxx": "libc++",
"compiler.version": "15",
"os": "Macos"
},
"package_settings": {},
"options": {},
"tool_requires": {},
"conf": {},
"build_env": ""
}
}

.. seealso::

- Read more about :ref:`profiles<reference_config_files_profiles>`