@sap/cds-dk 10.1.0 → 10.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/bin/bind.js +4 -0
- package/bin/build.js +1 -0
- package/bin/compile/index.js +12 -11
- package/bin/completion/index.js +21 -10
- package/bin/completion/scripts/cds.fish +179 -127
- package/bin/completion/scripts/cds.ps1 +88 -14
- package/bin/completion/scripts/cds.sh +71 -5
- package/bin/completion/scripts/cds.zsh +81 -15
- package/bin/completion/templates/cds-tmpl.ps1 +15 -6
- package/bin/deploy/index.js +7 -3
- package/bin/env.js +4 -1
- package/bin/export.js +9 -1
- package/bin/import.js +4 -1
- package/bin/init.js +1 -0
- package/bin/inspect.js +3 -1
- package/bin/lint.js +5 -3
- package/bin/minify.js +6 -1
- package/bin/repl.js +11 -2
- package/bin/run.js +12 -1
- package/bin/serve.js +13 -2
- package/bin/up.js +4 -1
- package/bin/util/containerize.js +2 -0
- package/bin/watch/index.js +8 -1
- package/lib/build/util.js +2 -4
- package/lib/init/constants.js +1 -1
- package/lib/init/template/data/as-json.js +3 -0
- package/node_modules/@cap-js/db-service/CHANGELOG.md +17 -0
- package/node_modules/@cap-js/db-service/lib/common/generic-pool.js +4 -7
- package/node_modules/@cap-js/db-service/lib/cqn2pql.js +1 -1
- package/node_modules/@cap-js/db-service/lib/cqn2sql.js +15 -11
- package/node_modules/@cap-js/db-service/lib/cqn4sql.js +119 -19
- package/node_modules/@cap-js/db-service/lib/infer/index.js +27 -16
- package/node_modules/@cap-js/db-service/lib/recursion-guard.js +40 -0
- package/node_modules/@cap-js/db-service/lib/search.js +1 -1
- package/node_modules/@cap-js/db-service/package.json +1 -1
- package/node_modules/@cap-js/sqlite/CHANGELOG.md +19 -0
- package/node_modules/@cap-js/sqlite/lib/SQLiteService.js +110 -14
- package/node_modules/@cap-js/sqlite/package.json +3 -3
- package/node_modules/@sap/cds-compiler/CHANGELOG.md +15 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/resolve.js +7 -3
- package/node_modules/@sap/cds-compiler/lib/model/csnUtils.js +2 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/applyTransformations.js +12 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/associations.js +5 -3
- package/node_modules/@sap/cds-compiler/lib/transform/db/flattening.js +4 -3
- package/node_modules/@sap/cds-compiler/lib/transform/effective/flattening.js +17 -1
- package/node_modules/@sap/cds-compiler/lib/transform/effective/main.js +19 -0
- package/node_modules/@sap/cds-compiler/lib/transform/fioriTreeViews.js +12 -1
- package/node_modules/@sap/cds-compiler/lib/transform/forRelationalDB.js +1 -1
- package/node_modules/@sap/cds-compiler/lib/transform/odata/adaptAnnotationRefs.js +11 -5
- package/node_modules/@sap/cds-compiler/lib/transform/translateAssocsToJoins.js +29 -2
- package/node_modules/@sap/cds-compiler/package.json +1 -1
- package/node_modules/@sap/cds-mtxs/CHANGELOG.md +34 -0
- package/node_modules/@sap/cds-mtxs/bin/cds-mtx-migrate.js +26 -5
- package/node_modules/@sap/cds-mtxs/bin/cds-mtx.js +3 -0
- package/node_modules/@sap/cds-mtxs/lib/utils.js +5 -4
- package/node_modules/@sap/cds-mtxs/package.json +1 -1
- package/node_modules/@sap/cds-mtxs/srv/cf/abstract-provisioning-service.js +62 -7
- package/node_modules/@sap/cds-mtxs/srv/cf/saas-provisioning-service.js +1 -1
- package/node_modules/@sap/cds-mtxs/srv/cf/sms-provisioning-service.js +23 -3
- package/node_modules/@sap/cds-mtxs/srv/extensibility/compat/update.js +15 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/annotations.js +2 -2
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/config.js +2 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/index.js +2 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/protected-namespace.js +45 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility-service.js +8 -3
- package/node_modules/@sap/cds-mtxs/srv/jobs-service.js +49 -10
- package/node_modules/@sap/cds-mtxs/srv/model-provider.js +11 -2
- package/node_modules/@sap/cds-mtxs/srv/plugins/common.js +19 -12
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/hdi-ctnr-mgr.js +6 -3
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/serverless.js +271 -0
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana.js +3 -2
- package/node_modules/@sap/cds-mtxs/srv/worker/job-worker-pool.js +212 -0
- package/node_modules/@sap/cds-mtxs/srv/worker/job-worker.js +61 -0
- package/package.json +2 -2
- /package/node_modules/@sap/cds-mtxs/srv/worker/{pool.js → model-worker-pool.js} +0 -0
- /package/node_modules/@sap/cds-mtxs/srv/worker/{load.js → model-worker.js} +0 -0
|
@@ -22,7 +22,7 @@ $_CDS_COMMAND = "cds"
|
|
|
22
22
|
# __shortcuts — hashtable of shortcut → canonical command name
|
|
23
23
|
# __positionals — hashtable of command → array of known positional string values
|
|
24
24
|
# __optionValues — hashtable of command → hashtable of flag → array of values,
|
|
25
|
-
# or one of the file sentinels ':file', ':dir', ':file:ext1,ext2'
|
|
25
|
+
# or one of the file sentinels ':file', ':dir', ':file:ext1,ext2', ':file+dir:ext1,ext2'
|
|
26
26
|
# __commaCases — hashtable of command → hashtable of flag → array of comma-separable values
|
|
27
27
|
# <cmd> — array of flags/options for that subcommand (used by step 3)
|
|
28
28
|
$_CDS_COMPLETIONS = @{
|
|
@@ -52,12 +52,17 @@ $_CDS_COMPLETIONS = @{
|
|
|
52
52
|
'__optionValues' = @{
|
|
53
53
|
'bind' = @{
|
|
54
54
|
'--on' = @('cf', 'k8s');
|
|
55
|
+
'--for' = @('development', 'hybrid', 'production');
|
|
56
|
+
'-4' = @('development', 'hybrid', 'production');
|
|
55
57
|
'--out' = ':file';
|
|
56
|
-
'--output-file' = ':file'
|
|
58
|
+
'--output-file' = ':file';
|
|
59
|
+
'--credentials' = ':file:json';
|
|
60
|
+
'-c' = ':file:json'
|
|
57
61
|
};
|
|
58
62
|
'build' = @{
|
|
59
63
|
'--for' = @('hana', 'helm', 'java', 'mtx', 'mtx-extension', 'mtx-sidecar', 'nodejs');
|
|
60
64
|
'--log-level' = @('debug', 'error', 'info', 'warn');
|
|
65
|
+
'--project' = ':dir';
|
|
61
66
|
'--dest' = ':dir';
|
|
62
67
|
'--src' = ':dir'
|
|
63
68
|
};
|
|
@@ -72,7 +77,8 @@ $_CDS_COMPLETIONS = @{
|
|
|
72
77
|
'--service' = @('all');
|
|
73
78
|
'--lang' = @('all');
|
|
74
79
|
'--dest' = ':dir';
|
|
75
|
-
'
|
|
80
|
+
'--openapi:config-file' = ':file:json';
|
|
81
|
+
'_' = ':file+dir:cds,json'
|
|
76
82
|
};
|
|
77
83
|
'completion' = @{
|
|
78
84
|
'--shell' = @('bash', 'fish', 'gitbash', 'ps', 'zsh')
|
|
@@ -80,19 +86,44 @@ $_CDS_COMPLETIONS = @{
|
|
|
80
86
|
'deploy' = @{
|
|
81
87
|
'--to' = @('hana', 'sqlite');
|
|
82
88
|
'--on' = @('cf', 'k8s');
|
|
83
|
-
'
|
|
89
|
+
'--for' = @('development', 'hybrid', 'production');
|
|
90
|
+
'-4' = @('development', 'hybrid', 'production');
|
|
91
|
+
'--vcap-file' = ':file:json';
|
|
92
|
+
'--delta-from' = ':file:json';
|
|
93
|
+
'_' = ':file+dir:cds,json'
|
|
94
|
+
};
|
|
95
|
+
'env' = @{
|
|
96
|
+
'--for' = @('development', 'hybrid', 'production');
|
|
97
|
+
'-4' = @('development', 'hybrid', 'production')
|
|
98
|
+
};
|
|
99
|
+
'export' = @{
|
|
100
|
+
'--as' = @('cdl', 'csn');
|
|
101
|
+
'--for' = @('mvn', 'npm');
|
|
102
|
+
'_' = ':file+dir:cds,json';
|
|
103
|
+
'--to' = ':dir'
|
|
84
104
|
};
|
|
85
105
|
'import' = @{
|
|
86
106
|
'--from' = @('asyncapi', 'edmx', 'openapi');
|
|
87
107
|
'--as' = @('cds', 'csn', 'json');
|
|
108
|
+
'--out' = ':dir';
|
|
109
|
+
'-o' = ':dir';
|
|
88
110
|
'_' = ':file:json,xml,edmx'
|
|
89
111
|
};
|
|
90
112
|
'init' = @{
|
|
91
|
-
'--java:package' = ':dir'
|
|
113
|
+
'--java:package' = ':dir';
|
|
114
|
+
'--base' = ':dir'
|
|
92
115
|
};
|
|
93
116
|
'inspect' = @{
|
|
94
117
|
'--kind' = @('aspect', 'entity', 'service', 'type');
|
|
95
|
-
'
|
|
118
|
+
'--list' = @('all', 'associations', 'compositions', 'elements', 'ids', 'keys', 'names', 'sources');
|
|
119
|
+
'-l' = @('all', 'associations', 'compositions', 'elements', 'ids', 'keys', 'names', 'sources');
|
|
120
|
+
'_' = ':file+dir:cds,json'
|
|
121
|
+
};
|
|
122
|
+
'lint' = @{
|
|
123
|
+
'_' = ':file+dir:js,ts,cds'
|
|
124
|
+
};
|
|
125
|
+
'minify' = @{
|
|
126
|
+
'_' = ':file+dir:cds,json'
|
|
96
127
|
};
|
|
97
128
|
'parse' = @{
|
|
98
129
|
'--to' = @('asyncapi', 'cdl', 'edm', 'edmx', 'edmx-v2', 'edmx-v4', 'hana', 'hdbtable', 'json', 'openapi', 'sql', 'xsuaa', 'yml');
|
|
@@ -105,17 +136,51 @@ $_CDS_COMPLETIONS = @{
|
|
|
105
136
|
'--service' = @('all');
|
|
106
137
|
'--lang' = @('all');
|
|
107
138
|
'--dest' = ':dir';
|
|
108
|
-
'
|
|
139
|
+
'--openapi:config-file' = ':file:json';
|
|
140
|
+
'_' = ':file+dir:cds,json'
|
|
141
|
+
};
|
|
142
|
+
'repl' = @{
|
|
143
|
+
'--use' = @('entities', 'ql', 'services', 'xl');
|
|
144
|
+
'-u' = @('entities', 'ql', 'services', 'xl');
|
|
145
|
+
'_' = ':dir';
|
|
146
|
+
'--run' = ':dir';
|
|
147
|
+
'-r' = ':dir'
|
|
148
|
+
};
|
|
149
|
+
'run' = @{
|
|
150
|
+
'--to' = @('fiori', 'odata', 'rest');
|
|
151
|
+
'-2' = @('fiori', 'odata', 'rest');
|
|
152
|
+
'_' = ':dir';
|
|
153
|
+
'--from' = ':dir';
|
|
154
|
+
'-f' = ':dir';
|
|
155
|
+
'--with' = ':dir';
|
|
156
|
+
'-w' = ':dir'
|
|
157
|
+
};
|
|
158
|
+
'serve' = @{
|
|
159
|
+
'--to' = @('fiori', 'odata', 'rest');
|
|
160
|
+
'-2' = @('fiori', 'odata', 'rest');
|
|
161
|
+
'_' = ':dir';
|
|
162
|
+
'--from' = ':dir';
|
|
163
|
+
'-f' = ':dir';
|
|
164
|
+
'--with' = ':dir';
|
|
165
|
+
'-w' = ':dir'
|
|
109
166
|
};
|
|
110
167
|
'up' = @{
|
|
111
|
-
'--to' = @('cf', 'k8s')
|
|
168
|
+
'--to' = @('cf', 'k8s');
|
|
169
|
+
'--overlay' = ':file:mtaext'
|
|
112
170
|
};
|
|
113
171
|
'version' = @{
|
|
114
172
|
'--omit' = @('dev', 'optional', 'peer')
|
|
115
173
|
};
|
|
116
174
|
'watch' = @{
|
|
175
|
+
'--to' = @('fiori', 'odata', 'rest');
|
|
176
|
+
'-2' = @('fiori', 'odata', 'rest');
|
|
117
177
|
'--experimental-hot-reload' = @('false', 'true');
|
|
118
178
|
'--livereload' = @('false');
|
|
179
|
+
'_' = ':dir';
|
|
180
|
+
'--from' = ':dir';
|
|
181
|
+
'-f' = ':dir';
|
|
182
|
+
'--with' = ':dir';
|
|
183
|
+
'-w' = ':dir';
|
|
119
184
|
'--include' = ':dir';
|
|
120
185
|
'--exclude' = ':dir'
|
|
121
186
|
}
|
|
@@ -128,7 +193,7 @@ $_CDS_COMPLETIONS = @{
|
|
|
128
193
|
'--add' = @('ai', 'ams', 'app-frontend', 'application-logging', 'approuter', 'attachments', 'audit-logging', 'cf-manifest', 'cjs', 'cloud-logging', 'completion', 'connectivity', 'console', 'data', 'destination', 'dynatrace', 'enterprise-messaging', 'enterprise-messaging-shared', 'event-mesh', 'event-mesh-shared', 'extensibility', 'extension', 'file-based-messaging', 'github-actions', 'h2', 'hana', 'hana-serverless', 'handler', 'html5-repo', 'http', 'ias', 'initial', 'kafka', 'kyma', 'lint', 'liquibase', 'local-messaging', 'malware-scanner', 'mta', 'mtx', 'multitenancy', 'notifications', 'pipeline', 'portal', 'postgres', 'react', 'redis', 'redis-messaging', 'sample', 'side-by-side-extensibility', 'sqlite', 'telemetry', 'test', 'tiny-sample', 'toggles', 'typer', 'typescript', 'ui5', 'vue', 'workzone', 'workzone-standard', 'xsuaa')
|
|
129
194
|
}
|
|
130
195
|
};
|
|
131
|
-
'add' = @('--base', '--cdm', '--cloudevents', '--content-type', '--data:for', '--dry', '--filter', '--for', '--for-app', '--force', '--into', '--java:mvn', '--keys-only', '--out', '--package', '--plan', '--records', '--sap', '--shell', '--unified-runtime', '--with-telemetry', '--y');
|
|
196
|
+
'add' = @('--base', '--cdm', '--cloudevents', '--composition-records', '--content-type', '--data:for', '--dry', '--filter', '--for', '--for-app', '--force', '--into', '--java:mvn', '--keys-only', '--out', '--package', '--plan', '--records', '--sap', '--shell', '--unified-runtime', '--with-telemetry', '--y');
|
|
132
197
|
'bind' = @('--credentials', '--exec', '--for', '--kind', '--no-create-service-key', '--on', '--out', '--output-file', '--to', '--to-app-services');
|
|
133
198
|
'build' = @('--dest', '--for', '--log-level', '--no-clean', '--no-ws-pack', '--options-model', '--opts', '--project', '--src', '--ws', '--ws-pack');
|
|
134
199
|
'compile' = @('--all', '--asyncapi:merged', '--beta', '--clean', '--conceptual', '--dest', '--dialect', '--docs', '--files', '--flavor', '--for', '--from', '--lang', '--locations', '--log-level', '--min', '--odata-version', '--openapi:config-file', '--openapi:diagram', '--openapi:servers', '--openapi:url', '--parse', '--plain', '--resolved', '--service', '--sort', '--sources', '--sql-dialect', '--to');
|
|
@@ -175,14 +240,16 @@ Register-ArgumentCompleter -Native -CommandName $_CDS_COMMAND -ScriptBlock {
|
|
|
175
240
|
|
|
176
241
|
# Helper: emit file/dir completions for a sentinel value.
|
|
177
242
|
# Sentinel formats: ':file' (any file), ':dir' (directories only),
|
|
178
|
-
# ':file:ext1,ext2' (files with specific extensions)
|
|
243
|
+
# ':file:ext1,ext2' (files with specific extensions),
|
|
244
|
+
# ':file+dir:ext1,ext2' (files with extensions + directories).
|
|
179
245
|
# Uses relative paths (preserving any typed prefix) so the completed text stays short.
|
|
180
246
|
function _CdsFileComplete($sentinel, $word) {
|
|
181
247
|
$base = if ($word) { $word } else { '' }
|
|
182
248
|
$search = if ($word) { "$word*" } else { '*' }
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
249
|
+
$inclDirs = $sentinel -like ':file+dir:*'
|
|
250
|
+
# Parse extension list from ':file:cds,json' or ':file+dir:cds,json' → @('.cds', '.json')
|
|
251
|
+
$exts = if ($sentinel -like ':file:*' -or $inclDirs) {
|
|
252
|
+
($sentinel -replace '^:file(\+dir)?:', '').Split(',') | ForEach-Object { ".$_" }
|
|
186
253
|
} else { $null }
|
|
187
254
|
if ($sentinel -eq ':dir') {
|
|
188
255
|
Get-ChildItem -Path $search -Directory -ErrorAction SilentlyContinue |
|
|
@@ -197,6 +264,13 @@ Register-ArgumentCompleter -Native -CommandName $_CDS_COMMAND -ScriptBlock {
|
|
|
197
264
|
$rel = $base + $_.Name
|
|
198
265
|
[System.Management.Automation.CompletionResult]::new($rel, $_.Name, 'ProviderItem', $_.Name)
|
|
199
266
|
}
|
|
267
|
+
if ($inclDirs) {
|
|
268
|
+
Get-ChildItem -Path $search -Directory -ErrorAction SilentlyContinue |
|
|
269
|
+
ForEach-Object {
|
|
270
|
+
$rel = $base + $_.Name
|
|
271
|
+
[System.Management.Automation.CompletionResult]::new($rel, $_.Name, 'ProviderContainer', $_.Name)
|
|
272
|
+
}
|
|
273
|
+
}
|
|
200
274
|
}
|
|
201
275
|
}
|
|
202
276
|
|
|
@@ -247,7 +321,7 @@ Register-ArgumentCompleter -Native -CommandName $_CDS_COMMAND -ScriptBlock {
|
|
|
247
321
|
if ($null -ne $optVals) {
|
|
248
322
|
$entry = $optVals[$previousWord]
|
|
249
323
|
if ($null -ne $entry) {
|
|
250
|
-
if ($entry -eq ':dir' -or $entry -eq ':file' -or $entry -like ':file:*') {
|
|
324
|
+
if ($entry -eq ':dir' -or $entry -eq ':file' -or $entry -like ':file:*' -or $entry -like ':file+dir:*') {
|
|
251
325
|
_CdsFileComplete $entry $wordToComplete
|
|
252
326
|
} else {
|
|
253
327
|
foreach ($val in $entry) {
|
|
@@ -60,7 +60,7 @@ _completeCds()
|
|
|
60
60
|
# Step 3: flag/option completion — only triggered when the token starts with '-'.
|
|
61
61
|
if [[ "$current" == -* ]]; then
|
|
62
62
|
case "$cmd" in
|
|
63
|
-
add) COMPREPLY=( $(compgen -W ""--base" "--cdm" "--cloudevents" "--content-type" "--data:for" "--dry" "--filter" "--for" "--for-app" "--force" "--into" "--java:mvn" "--keys-only" "--out" "--package" "--plan" "--records" "--sap" "--shell" "--unified-runtime" "--with-telemetry" "--y"" -- "$current") ) ;;
|
|
63
|
+
add) COMPREPLY=( $(compgen -W ""--base" "--cdm" "--cloudevents" "--composition-records" "--content-type" "--data:for" "--dry" "--filter" "--for" "--for-app" "--force" "--into" "--java:mvn" "--keys-only" "--out" "--package" "--plan" "--records" "--sap" "--shell" "--unified-runtime" "--with-telemetry" "--y"" -- "$current") ) ;;
|
|
64
64
|
bind) COMPREPLY=( $(compgen -W ""--credentials" "--exec" "--for" "--kind" "--no-create-service-key" "--on" "--out" "--output-file" "--to" "--to-app-services"" -- "$current") ) ;;
|
|
65
65
|
build) COMPREPLY=( $(compgen -W ""--dest" "--for" "--log-level" "--no-clean" "--no-ws-pack" "--options-model" "--opts" "--project" "--src" "--ws" "--ws-pack"" -- "$current") ) ;;
|
|
66
66
|
compile) COMPREPLY=( $(compgen -W ""--all" "--asyncapi:merged" "--beta" "--clean" "--conceptual" "--dest" "--dialect" "--docs" "--files" "--flavor" "--for" "--from" "--lang" "--locations" "--log-level" "--min" "--odata-version" "--openapi:config-file" "--openapi:diagram" "--openapi:servers" "--openapi:url" "--parse" "--plain" "--resolved" "--service" "--sort" "--sources" "--sql-dialect" "--to"" -- "$current") ) ;;
|
|
@@ -103,13 +103,18 @@ _completeCds()
|
|
|
103
103
|
bind)
|
|
104
104
|
case "$previous" in
|
|
105
105
|
--on) COMPREPLY=( $(compgen -W ""cf" "k8s"" -- "$current") ) ; return 0 ;;
|
|
106
|
+
--for) COMPREPLY=( $(compgen -W ""development" "production" "hybrid"" -- "$current") ) ; return 0 ;;
|
|
107
|
+
-4) COMPREPLY=( $(compgen -W ""development" "production" "hybrid"" -- "$current") ) ; return 0 ;;
|
|
106
108
|
--out) COMPREPLY=( $(compgen -f -- "$current") ) ; return 0 ;;
|
|
107
109
|
--output-file) COMPREPLY=( $(compgen -f -- "$current") ) ; return 0 ;;
|
|
110
|
+
--credentials) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(json)$') ) ; return 0 ;;
|
|
111
|
+
-c) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(json)$') ) ; return 0 ;;
|
|
108
112
|
esac ;;
|
|
109
113
|
build)
|
|
110
114
|
case "$previous" in
|
|
111
115
|
--for) COMPREPLY=( $(compgen -W ""hana" "helm" "java" "mtx" "mtx-extension" "mtx-sidecar" "nodejs"" -- "$current") ) ; return 0 ;;
|
|
112
116
|
--log-level) COMPREPLY=( $(compgen -W ""debug" "info" "warn" "error"" -- "$current") ) ; return 0 ;;
|
|
117
|
+
--project) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
113
118
|
--dest) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
114
119
|
--src) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
115
120
|
esac ;;
|
|
@@ -125,6 +130,7 @@ _completeCds()
|
|
|
125
130
|
--service) COMPREPLY=( $(compgen -W ""all"" -- "$current") ) ; return 0 ;;
|
|
126
131
|
--lang) COMPREPLY=( $(compgen -W ""all"" -- "$current") ) ; return 0 ;;
|
|
127
132
|
--dest) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
133
|
+
--openapi:config-file) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(json)$') ) ; return 0 ;;
|
|
128
134
|
esac ;;
|
|
129
135
|
completion)
|
|
130
136
|
case "$previous" in
|
|
@@ -134,19 +140,39 @@ _completeCds()
|
|
|
134
140
|
case "$previous" in
|
|
135
141
|
--to) COMPREPLY=( $(compgen -W ""sqlite" "hana"" -- "$current") ) ; return 0 ;;
|
|
136
142
|
--on) COMPREPLY=( $(compgen -W ""cf" "k8s"" -- "$current") ) ; return 0 ;;
|
|
143
|
+
--for) COMPREPLY=( $(compgen -W ""development" "production" "hybrid"" -- "$current") ) ; return 0 ;;
|
|
144
|
+
-4) COMPREPLY=( $(compgen -W ""development" "production" "hybrid"" -- "$current") ) ; return 0 ;;
|
|
145
|
+
--vcap-file) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(json)$') ) ; return 0 ;;
|
|
146
|
+
--delta-from) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(json)$') ) ; return 0 ;;
|
|
147
|
+
esac ;;
|
|
148
|
+
env)
|
|
149
|
+
case "$previous" in
|
|
150
|
+
--for) COMPREPLY=( $(compgen -W ""development" "production" "hybrid"" -- "$current") ) ; return 0 ;;
|
|
151
|
+
-4) COMPREPLY=( $(compgen -W ""development" "production" "hybrid"" -- "$current") ) ; return 0 ;;
|
|
152
|
+
esac ;;
|
|
153
|
+
export)
|
|
154
|
+
case "$previous" in
|
|
155
|
+
--as) COMPREPLY=( $(compgen -W ""csn" "cdl"" -- "$current") ) ; return 0 ;;
|
|
156
|
+
--for) COMPREPLY=( $(compgen -W ""npm" "mvn"" -- "$current") ) ; return 0 ;;
|
|
157
|
+
--to) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
137
158
|
esac ;;
|
|
138
159
|
import)
|
|
139
160
|
case "$previous" in
|
|
140
161
|
--from) COMPREPLY=( $(compgen -W ""asyncapi" "edmx" "openapi"" -- "$current") ) ; return 0 ;;
|
|
141
162
|
--as) COMPREPLY=( $(compgen -W ""cds" "csn" "json"" -- "$current") ) ; return 0 ;;
|
|
163
|
+
--out) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
164
|
+
-o) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
142
165
|
esac ;;
|
|
143
166
|
init)
|
|
144
167
|
case "$previous" in
|
|
145
168
|
--java:package) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
169
|
+
--base) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
146
170
|
esac ;;
|
|
147
171
|
inspect)
|
|
148
172
|
case "$previous" in
|
|
149
173
|
--kind) COMPREPLY=( $(compgen -W ""entity" "aspect" "type" "service"" -- "$current") ) ; return 0 ;;
|
|
174
|
+
--list) COMPREPLY=( $(compgen -W ""names" "elements" "keys" "associations" "compositions" "ids" "sources" "all"" -- "$current") ) ; return 0 ;;
|
|
175
|
+
-l) COMPREPLY=( $(compgen -W ""names" "elements" "keys" "associations" "compositions" "ids" "sources" "all"" -- "$current") ) ; return 0 ;;
|
|
150
176
|
esac ;;
|
|
151
177
|
parse)
|
|
152
178
|
case "$previous" in
|
|
@@ -160,10 +186,37 @@ _completeCds()
|
|
|
160
186
|
--service) COMPREPLY=( $(compgen -W ""all"" -- "$current") ) ; return 0 ;;
|
|
161
187
|
--lang) COMPREPLY=( $(compgen -W ""all"" -- "$current") ) ; return 0 ;;
|
|
162
188
|
--dest) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
189
|
+
--openapi:config-file) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(json)$') ) ; return 0 ;;
|
|
190
|
+
esac ;;
|
|
191
|
+
repl)
|
|
192
|
+
case "$previous" in
|
|
193
|
+
--use) COMPREPLY=( $(compgen -W ""xl" "ql" "entities" "services"" -- "$current") ) ; return 0 ;;
|
|
194
|
+
-u) COMPREPLY=( $(compgen -W ""xl" "ql" "entities" "services"" -- "$current") ) ; return 0 ;;
|
|
195
|
+
--run) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
196
|
+
-r) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
197
|
+
esac ;;
|
|
198
|
+
run)
|
|
199
|
+
case "$previous" in
|
|
200
|
+
--to) COMPREPLY=( $(compgen -W ""odata" "fiori" "rest"" -- "$current") ) ; return 0 ;;
|
|
201
|
+
-2) COMPREPLY=( $(compgen -W ""odata" "fiori" "rest"" -- "$current") ) ; return 0 ;;
|
|
202
|
+
--from) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
203
|
+
-f) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
204
|
+
--with) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
205
|
+
-w) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
206
|
+
esac ;;
|
|
207
|
+
serve)
|
|
208
|
+
case "$previous" in
|
|
209
|
+
--to) COMPREPLY=( $(compgen -W ""odata" "fiori" "rest"" -- "$current") ) ; return 0 ;;
|
|
210
|
+
-2) COMPREPLY=( $(compgen -W ""odata" "fiori" "rest"" -- "$current") ) ; return 0 ;;
|
|
211
|
+
--from) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
212
|
+
-f) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
213
|
+
--with) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
214
|
+
-w) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
163
215
|
esac ;;
|
|
164
216
|
up)
|
|
165
217
|
case "$previous" in
|
|
166
218
|
--to) COMPREPLY=( $(compgen -W ""cf" "k8s"" -- "$current") ) ; return 0 ;;
|
|
219
|
+
--overlay) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(mtaext)$') ) ; return 0 ;;
|
|
167
220
|
esac ;;
|
|
168
221
|
version)
|
|
169
222
|
case "$previous" in
|
|
@@ -171,8 +224,14 @@ _completeCds()
|
|
|
171
224
|
esac ;;
|
|
172
225
|
watch)
|
|
173
226
|
case "$previous" in
|
|
227
|
+
--to) COMPREPLY=( $(compgen -W ""odata" "fiori" "rest"" -- "$current") ) ; return 0 ;;
|
|
228
|
+
-2) COMPREPLY=( $(compgen -W ""odata" "fiori" "rest"" -- "$current") ) ; return 0 ;;
|
|
174
229
|
--experimental-hot-reload) COMPREPLY=( $(compgen -W ""true" "false"" -- "$current") ) ; return 0 ;;
|
|
175
230
|
--livereload) COMPREPLY=( $(compgen -W ""false"" -- "$current") ) ; return 0 ;;
|
|
231
|
+
--from) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
232
|
+
-f) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
233
|
+
--with) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
234
|
+
-w) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
176
235
|
--include) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
177
236
|
--exclude) COMPREPLY=( $(compgen -d -- "$current") ) ; return 0 ;;
|
|
178
237
|
esac ;;
|
|
@@ -226,11 +285,18 @@ _completeCds()
|
|
|
226
285
|
|
|
227
286
|
# Step 4: file-sentinel positionals — fill COMPREPLY with files and return.
|
|
228
287
|
case "$cmd" in
|
|
229
|
-
compile) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(cds|json)$') ) ;;
|
|
230
|
-
deploy) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(cds|json)$') ) ;;
|
|
288
|
+
compile) COMPREPLY=( $({ compgen -f -- "$current" | grep -E '\.(cds|json)$'; compgen -d -- "$current"; }) ) ;;
|
|
289
|
+
deploy) COMPREPLY=( $({ compgen -f -- "$current" | grep -E '\.(cds|json)$'; compgen -d -- "$current"; }) ) ;;
|
|
290
|
+
export) COMPREPLY=( $({ compgen -f -- "$current" | grep -E '\.(cds|json)$'; compgen -d -- "$current"; }) ) ;;
|
|
231
291
|
import) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(json|xml|edmx)$') ) ;;
|
|
232
|
-
inspect) COMPREPLY=( $(compgen -f -- "$current" | grep -E '\.(cds|json)$') ) ;;
|
|
233
|
-
|
|
292
|
+
inspect) COMPREPLY=( $({ compgen -f -- "$current" | grep -E '\.(cds|json)$'; compgen -d -- "$current"; }) ) ;;
|
|
293
|
+
lint) COMPREPLY=( $({ compgen -f -- "$current" | grep -E '\.(js|ts|cds)$'; compgen -d -- "$current"; }) ) ;;
|
|
294
|
+
minify) COMPREPLY=( $({ compgen -f -- "$current" | grep -E '\.(cds|json)$'; compgen -d -- "$current"; }) ) ;;
|
|
295
|
+
parse) COMPREPLY=( $({ compgen -f -- "$current" | grep -E '\.(cds|json)$'; compgen -d -- "$current"; }) ) ;;
|
|
296
|
+
repl) COMPREPLY=( $(compgen -d -- "$current") ) ;;
|
|
297
|
+
run) COMPREPLY=( $(compgen -d -- "$current") ) ;;
|
|
298
|
+
serve) COMPREPLY=( $(compgen -d -- "$current") ) ;;
|
|
299
|
+
watch) COMPREPLY=( $(compgen -d -- "$current") ) ;;
|
|
234
300
|
esac
|
|
235
301
|
if [[ "${#COMPREPLY[@]}" -gt 0 ]]; then
|
|
236
302
|
compopt -o nospace
|
|
@@ -57,7 +57,7 @@ _completeCds() {
|
|
|
57
57
|
# 'case ... esac && return' exits the function when a case arm matched.
|
|
58
58
|
if [[ "$current" == -* ]]; then
|
|
59
59
|
case "$cmd" in
|
|
60
|
-
add) compadd -S '' -- "--base" "--cdm" "--cloudevents" "--content-type" "--data:for" "--dry" "--filter" "--for" "--for-app" "--force" "--into" "--java:mvn" "--keys-only" "--out" "--package" "--plan" "--records" "--sap" "--shell" "--unified-runtime" "--with-telemetry" "--y" ;;
|
|
60
|
+
add) compadd -S '' -- "--base" "--cdm" "--cloudevents" "--composition-records" "--content-type" "--data:for" "--dry" "--filter" "--for" "--for-app" "--force" "--into" "--java:mvn" "--keys-only" "--out" "--package" "--plan" "--records" "--sap" "--shell" "--unified-runtime" "--with-telemetry" "--y" ;;
|
|
61
61
|
bind) compadd -S '' -- "--credentials" "--exec" "--for" "--kind" "--no-create-service-key" "--on" "--out" "--output-file" "--to" "--to-app-services" ;;
|
|
62
62
|
build) compadd -S '' -- "--dest" "--for" "--log-level" "--no-clean" "--no-ws-pack" "--options-model" "--opts" "--project" "--src" "--ws" "--ws-pack" ;;
|
|
63
63
|
compile) compadd -S '' -- "--all" "--asyncapi:merged" "--beta" "--clean" "--conceptual" "--dest" "--dialect" "--docs" "--files" "--flavor" "--for" "--from" "--lang" "--locations" "--log-level" "--min" "--odata-version" "--openapi:config-file" "--openapi:diagram" "--openapi:servers" "--openapi:url" "--parse" "--plain" "--resolved" "--service" "--sort" "--sources" "--sql-dialect" "--to" ;;
|
|
@@ -96,15 +96,20 @@ _completeCds() {
|
|
|
96
96
|
bind)
|
|
97
97
|
case "$previous" in
|
|
98
98
|
--on) compadd -S '' -- "cf" "k8s" ; return ;;
|
|
99
|
-
--
|
|
100
|
-
|
|
99
|
+
--for) compadd -S '' -- "development" "hybrid" "production" ; return ;;
|
|
100
|
+
-4) compadd -S '' -- "development" "hybrid" "production" ; return ;;
|
|
101
|
+
--out) compstate[nomatches]='' ; _path_files ; return ;;
|
|
102
|
+
--output-file) compstate[nomatches]='' ; _path_files ; return ;;
|
|
103
|
+
--credentials) compstate[nomatches]='' ; _path_files -g '*.json' ; return ;;
|
|
104
|
+
-c) compstate[nomatches]='' ; _path_files -g '*.json' ; return ;;
|
|
101
105
|
esac ;;
|
|
102
106
|
build)
|
|
103
107
|
case "$previous" in
|
|
104
108
|
--for) compadd -S '' -- "hana" "helm" "java" "mtx" "mtx-extension" "mtx-sidecar" "nodejs" ; return ;;
|
|
105
109
|
--log-level) compadd -S '' -- "debug" "error" "info" "warn" ; return ;;
|
|
106
|
-
--
|
|
107
|
-
--
|
|
110
|
+
--project) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
111
|
+
--dest) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
112
|
+
--src) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
108
113
|
esac ;;
|
|
109
114
|
compile)
|
|
110
115
|
case "$previous" in
|
|
@@ -117,7 +122,8 @@ _completeCds() {
|
|
|
117
122
|
--flavor) compadd -S '' -- "files" "inferred" "parsed" "sources" "xtended" ; return ;;
|
|
118
123
|
--service) compadd -S '' -- "all" ; return ;;
|
|
119
124
|
--lang) compadd -S '' -- "all" ; return ;;
|
|
120
|
-
--dest) _files -/ ; return ;;
|
|
125
|
+
--dest) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
126
|
+
--openapi:config-file) compstate[nomatches]='' ; _path_files -g '*.json' ; return ;;
|
|
121
127
|
esac ;;
|
|
122
128
|
completion)
|
|
123
129
|
case "$previous" in
|
|
@@ -127,19 +133,39 @@ _completeCds() {
|
|
|
127
133
|
case "$previous" in
|
|
128
134
|
--to) compadd -S '' -- "hana" "sqlite" ; return ;;
|
|
129
135
|
--on) compadd -S '' -- "cf" "k8s" ; return ;;
|
|
136
|
+
--for) compadd -S '' -- "development" "hybrid" "production" ; return ;;
|
|
137
|
+
-4) compadd -S '' -- "development" "hybrid" "production" ; return ;;
|
|
138
|
+
--vcap-file) compstate[nomatches]='' ; _path_files -g '*.json' ; return ;;
|
|
139
|
+
--delta-from) compstate[nomatches]='' ; _path_files -g '*.json' ; return ;;
|
|
140
|
+
esac ;;
|
|
141
|
+
env)
|
|
142
|
+
case "$previous" in
|
|
143
|
+
--for) compadd -S '' -- "development" "hybrid" "production" ; return ;;
|
|
144
|
+
-4) compadd -S '' -- "development" "hybrid" "production" ; return ;;
|
|
145
|
+
esac ;;
|
|
146
|
+
export)
|
|
147
|
+
case "$previous" in
|
|
148
|
+
--as) compadd -S '' -- "cdl" "csn" ; return ;;
|
|
149
|
+
--for) compadd -S '' -- "mvn" "npm" ; return ;;
|
|
150
|
+
--to) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
130
151
|
esac ;;
|
|
131
152
|
import)
|
|
132
153
|
case "$previous" in
|
|
133
154
|
--from) compadd -S '' -- "asyncapi" "edmx" "openapi" ; return ;;
|
|
134
155
|
--as) compadd -S '' -- "cds" "csn" "json" ; return ;;
|
|
156
|
+
--out) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
157
|
+
-o) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
135
158
|
esac ;;
|
|
136
159
|
init)
|
|
137
160
|
case "$previous" in
|
|
138
|
-
--java:package) _files -/ ; return ;;
|
|
161
|
+
--java:package) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
162
|
+
--base) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
139
163
|
esac ;;
|
|
140
164
|
inspect)
|
|
141
165
|
case "$previous" in
|
|
142
166
|
--kind) compadd -S '' -- "aspect" "entity" "service" "type" ; return ;;
|
|
167
|
+
--list) compadd -S '' -- "all" "associations" "compositions" "elements" "ids" "keys" "names" "sources" ; return ;;
|
|
168
|
+
-l) compadd -S '' -- "all" "associations" "compositions" "elements" "ids" "keys" "names" "sources" ; return ;;
|
|
143
169
|
esac ;;
|
|
144
170
|
parse)
|
|
145
171
|
case "$previous" in
|
|
@@ -152,11 +178,38 @@ _completeCds() {
|
|
|
152
178
|
--flavor) compadd -S '' -- "files" "inferred" "parsed" "sources" "xtended" ; return ;;
|
|
153
179
|
--service) compadd -S '' -- "all" ; return ;;
|
|
154
180
|
--lang) compadd -S '' -- "all" ; return ;;
|
|
155
|
-
--dest) _files -/ ; return ;;
|
|
181
|
+
--dest) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
182
|
+
--openapi:config-file) compstate[nomatches]='' ; _path_files -g '*.json' ; return ;;
|
|
183
|
+
esac ;;
|
|
184
|
+
repl)
|
|
185
|
+
case "$previous" in
|
|
186
|
+
--use) compadd -S '' -- "entities" "ql" "services" "xl" ; return ;;
|
|
187
|
+
-u) compadd -S '' -- "entities" "ql" "services" "xl" ; return ;;
|
|
188
|
+
--run) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
189
|
+
-r) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
190
|
+
esac ;;
|
|
191
|
+
run)
|
|
192
|
+
case "$previous" in
|
|
193
|
+
--to) compadd -S '' -- "fiori" "odata" "rest" ; return ;;
|
|
194
|
+
-2) compadd -S '' -- "fiori" "odata" "rest" ; return ;;
|
|
195
|
+
--from) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
196
|
+
-f) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
197
|
+
--with) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
198
|
+
-w) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
199
|
+
esac ;;
|
|
200
|
+
serve)
|
|
201
|
+
case "$previous" in
|
|
202
|
+
--to) compadd -S '' -- "fiori" "odata" "rest" ; return ;;
|
|
203
|
+
-2) compadd -S '' -- "fiori" "odata" "rest" ; return ;;
|
|
204
|
+
--from) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
205
|
+
-f) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
206
|
+
--with) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
207
|
+
-w) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
156
208
|
esac ;;
|
|
157
209
|
up)
|
|
158
210
|
case "$previous" in
|
|
159
211
|
--to) compadd -S '' -- "cf" "k8s" ; return ;;
|
|
212
|
+
--overlay) compstate[nomatches]='' ; _path_files -g '*.mtaext' ; return ;;
|
|
160
213
|
esac ;;
|
|
161
214
|
version)
|
|
162
215
|
case "$previous" in
|
|
@@ -164,10 +217,16 @@ _completeCds() {
|
|
|
164
217
|
esac ;;
|
|
165
218
|
watch)
|
|
166
219
|
case "$previous" in
|
|
220
|
+
--to) compadd -S '' -- "fiori" "odata" "rest" ; return ;;
|
|
221
|
+
-2) compadd -S '' -- "fiori" "odata" "rest" ; return ;;
|
|
167
222
|
--experimental-hot-reload) compadd -S '' -- "false" "true" ; return ;;
|
|
168
223
|
--livereload) compadd -S '' -- "false" ; return ;;
|
|
169
|
-
--
|
|
170
|
-
|
|
224
|
+
--from) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
225
|
+
-f) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
226
|
+
--with) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
227
|
+
-w) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
228
|
+
--include) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
229
|
+
--exclude) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
171
230
|
esac ;;
|
|
172
231
|
|
|
173
232
|
esac
|
|
@@ -206,11 +265,18 @@ _completeCds() {
|
|
|
206
265
|
|
|
207
266
|
# Step 4: file-sentinel positionals — emit files and return.
|
|
208
267
|
case "$cmd" in
|
|
209
|
-
compile)
|
|
210
|
-
deploy)
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
268
|
+
compile) compstate[nomatches]='' ; _path_files -g '*.cds *.json' -/ ; return ;;
|
|
269
|
+
deploy) compstate[nomatches]='' ; _path_files -g '*.cds *.json' -/ ; return ;;
|
|
270
|
+
export) compstate[nomatches]='' ; _path_files -g '*.cds *.json' -/ ; return ;;
|
|
271
|
+
import) compstate[nomatches]='' ; _path_files -g '*.json *.xml *.edmx' ; return ;;
|
|
272
|
+
inspect) compstate[nomatches]='' ; _path_files -g '*.cds *.json' -/ ; return ;;
|
|
273
|
+
lint) compstate[nomatches]='' ; _path_files -g '*.js *.ts *.cds' -/ ; return ;;
|
|
274
|
+
minify) compstate[nomatches]='' ; _path_files -g '*.cds *.json' -/ ; return ;;
|
|
275
|
+
parse) compstate[nomatches]='' ; _path_files -g '*.cds *.json' -/ ; return ;;
|
|
276
|
+
repl) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
277
|
+
run) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
278
|
+
serve) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
279
|
+
watch) compstate[nomatches]='' ; _files -/ ; return ;;
|
|
214
280
|
esac
|
|
215
281
|
|
|
216
282
|
# Step 4.6: string positionals (e.g. cds help <tab>) — return after matching.
|
|
@@ -22,7 +22,7 @@ $_CDS_COMMAND = "cds"
|
|
|
22
22
|
# __shortcuts — hashtable of shortcut → canonical command name
|
|
23
23
|
# __positionals — hashtable of command → array of known positional string values
|
|
24
24
|
# __optionValues — hashtable of command → hashtable of flag → array of values,
|
|
25
|
-
# or one of the file sentinels ':file', ':dir', ':file:ext1,ext2'
|
|
25
|
+
# or one of the file sentinels ':file', ':dir', ':file:ext1,ext2', ':file+dir:ext1,ext2'
|
|
26
26
|
# __commaCases — hashtable of command → hashtable of flag → array of comma-separable values
|
|
27
27
|
# <cmd> — array of flags/options for that subcommand (used by step 3)
|
|
28
28
|
$_CDS_COMPLETIONS = @{
|
|
@@ -54,14 +54,16 @@ Register-ArgumentCompleter -Native -CommandName $_CDS_COMMAND -ScriptBlock {
|
|
|
54
54
|
|
|
55
55
|
# Helper: emit file/dir completions for a sentinel value.
|
|
56
56
|
# Sentinel formats: ':file' (any file), ':dir' (directories only),
|
|
57
|
-
# ':file:ext1,ext2' (files with specific extensions)
|
|
57
|
+
# ':file:ext1,ext2' (files with specific extensions),
|
|
58
|
+
# ':file+dir:ext1,ext2' (files with extensions + directories).
|
|
58
59
|
# Uses relative paths (preserving any typed prefix) so the completed text stays short.
|
|
59
60
|
function _CdsFileComplete($sentinel, $word) {
|
|
60
61
|
$base = if ($word) { $word } else { '' }
|
|
61
62
|
$search = if ($word) { "$word*" } else { '*' }
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
$inclDirs = $sentinel -like ':file+dir:*'
|
|
64
|
+
# Parse extension list from ':file:cds,json' or ':file+dir:cds,json' → @('.cds', '.json')
|
|
65
|
+
$exts = if ($sentinel -like ':file:*' -or $inclDirs) {
|
|
66
|
+
($sentinel -replace '^:file(\+dir)?:', '').Split(',') | ForEach-Object { ".$_" }
|
|
65
67
|
} else { $null }
|
|
66
68
|
if ($sentinel -eq ':dir') {
|
|
67
69
|
Get-ChildItem -Path $search -Directory -ErrorAction SilentlyContinue |
|
|
@@ -76,6 +78,13 @@ Register-ArgumentCompleter -Native -CommandName $_CDS_COMMAND -ScriptBlock {
|
|
|
76
78
|
$rel = $base + $_.Name
|
|
77
79
|
[System.Management.Automation.CompletionResult]::new($rel, $_.Name, 'ProviderItem', $_.Name)
|
|
78
80
|
}
|
|
81
|
+
if ($inclDirs) {
|
|
82
|
+
Get-ChildItem -Path $search -Directory -ErrorAction SilentlyContinue |
|
|
83
|
+
ForEach-Object {
|
|
84
|
+
$rel = $base + $_.Name
|
|
85
|
+
[System.Management.Automation.CompletionResult]::new($rel, $_.Name, 'ProviderContainer', $_.Name)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
79
88
|
}
|
|
80
89
|
}
|
|
81
90
|
|
|
@@ -126,7 +135,7 @@ Register-ArgumentCompleter -Native -CommandName $_CDS_COMMAND -ScriptBlock {
|
|
|
126
135
|
if ($null -ne $optVals) {
|
|
127
136
|
$entry = $optVals[$previousWord]
|
|
128
137
|
if ($null -ne $entry) {
|
|
129
|
-
if ($entry -eq ':dir' -or $entry -eq ':file' -or $entry -like ':file:*') {
|
|
138
|
+
if ($entry -eq ':dir' -or $entry -eq ':file' -or $entry -like ':file:*' -or $entry -like ':file+dir:*') {
|
|
130
139
|
_CdsFileComplete $entry $wordToComplete
|
|
131
140
|
} else {
|
|
132
141
|
foreach ($val in $entry) {
|
package/bin/deploy/index.js
CHANGED
|
@@ -3,9 +3,13 @@ const { options, flags, shortcuts } = require('./options');
|
|
|
3
3
|
|
|
4
4
|
module.exports = Object.assign(deploy, {
|
|
5
5
|
staticCompletions: () => ({
|
|
6
|
-
'--to':
|
|
7
|
-
'--on':
|
|
8
|
-
'
|
|
6
|
+
'--to': ['sqlite', 'hana'],
|
|
7
|
+
'--on': ['cf', 'k8s'],
|
|
8
|
+
'--for': ['development', 'production', 'hybrid'],
|
|
9
|
+
'-4': ['development', 'production', 'hybrid'],
|
|
10
|
+
'--vcap-file': FILE('json'),
|
|
11
|
+
'--delta-from': FILE('json'),
|
|
12
|
+
'_': FILE('cds,json', { dirs: true }),
|
|
9
13
|
}),
|
|
10
14
|
options,
|
|
11
15
|
flags,
|
package/bin/env.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
module.exports = Object.assign (env, {
|
|
2
|
+
staticCompletions: () => ({
|
|
3
|
+
'--for': ['development', 'production', 'hybrid'],
|
|
4
|
+
'-4': ['development', 'production', 'hybrid'],
|
|
5
|
+
}),
|
|
2
6
|
options: ['--for', '--mocked'],
|
|
3
7
|
flags: ['--keys', '--properties', '--list', '--json', '--raw', '--process-env', '--resolve-bindings', '--sources'],
|
|
4
8
|
shortcuts: ['-4', 0, '-k', '-p', '-l', '-j', '-r', '-P', '-b'],
|
|
@@ -63,7 +67,6 @@ async function env ([cmd, key, value], options={}) {
|
|
|
63
67
|
)
|
|
64
68
|
|
|
65
69
|
let env = cds.env
|
|
66
|
-
// REVISIT: Currently only read in env.test.js
|
|
67
70
|
env['_home_cds-dk'] = path.resolve(__dirname, '..') // to help tools find the DK
|
|
68
71
|
|
|
69
72
|
if (!options.for && options.mocked || options["resolve-bindings"])
|
package/bin/export.js
CHANGED
|
@@ -278,4 +278,12 @@ class Export extends Minify {
|
|
|
278
278
|
|
|
279
279
|
const { DIMMED, RESET } = cds.utils.colors
|
|
280
280
|
|
|
281
|
-
|
|
281
|
+
const { FILE, DIR } = require('./completion')
|
|
282
|
+
module.exports = Object.assign (Export._for_cds_dk(), { Export,
|
|
283
|
+
staticCompletions: () => ({
|
|
284
|
+
'_': FILE('cds,json', { dirs: true }),
|
|
285
|
+
'--to': DIR(),
|
|
286
|
+
'--as': ['csn', 'cdl'],
|
|
287
|
+
'--for': ['npm', 'mvn'],
|
|
288
|
+
})
|
|
289
|
+
})
|