oh-my-posh/website/docs/segments/cds.mdx

56 lines
3.6 KiB
Plaintext
Raw Normal View History

2022-03-06 13:52:12 -08:00
---
id: cds
title: CDS (SAP CAP)
sidebar_label: CDS
---
## What
Display the active [CDS CLI][sap-cap-cds] version.
## Sample Configuration
2023-03-31 11:55:36 -07:00
import Config from '@site/src/components/Config.js';
<Config data={{
2022-03-06 13:52:12 -08:00
"background": "#a7cae1",
"foreground": "#100e23",
"powerline_symbol": "\ue0b0",
2022-03-27 01:12:47 -07:00
"template": " \ue311 cds {{ .Full }} ",
2022-03-06 13:52:12 -08:00
"style": "powerline",
"type": "cds"
2023-03-31 11:55:36 -07:00
}}/>
2022-03-06 13:52:12 -08:00
## Properties
| Name | Type | Description |
| ---------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | fetch the CDS version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the cds command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is displayed when `.cdsrc.json`, `.cdsrc-private` or `*.cds` file is present</li><li>`context`: the segment is displayed when conditions from `files` mode are fulfilled or `package.json` file is present and `@sap/cds` is in `dependencies` section (**default**)</li></ul> |
2022-03-06 13:52:12 -08:00
## Template ([info][templates])
:::note default template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
:::
### Properties
2022-03-06 13:52:12 -08:00
| Name | Type | Description |
| ---------------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.Error` | `string` | error encountered when fetching the version string |
| `.HasDependency` | `bool` | a flag if `@sap/cds` was found in `package.json` |
2022-03-06 13:52:12 -08:00
2022-04-20 09:43:59 -07:00
[templates]: /docs/configuration/templates
2022-03-06 13:52:12 -08:00
[sap-cap-cds]: https://cap.cloud.sap/docs/tools/#command-line-interface-cli