tsv option columnNames projectTags

This commit is contained in:
felixlohmeier 2023-01-09 10:42:51 +00:00
parent 5cf03927b6
commit 770effe16a
2 changed files with 8 additions and 4 deletions

6
orcli
View File

@ -1300,8 +1300,9 @@ orcli_import_tsv_command() {
options+='"storeBlankCellsAsNulls": false'
fi
if [[ ${args[--columnNames]} ]]; then
IFS=',' read -ra columnNames <<< "${args[--columnNames]}"
options+=', '
options+="\"columnNames\": \"[${args[--columnNames]}\"]"
options+="\"columnNames\": [ $(printf ',"'%s'"' "${columnNames[@]}" | cut -c2-) ]"
fi
if [[ ${args[--guessCellValueTypes]} ]]; then
options+=', '
@ -1352,8 +1353,9 @@ orcli_import_tsv_command() {
options+='"trimStrings": true'
fi
if [[ ${args[--projectTags]} ]]; then
IFS=',' read -ra projectTags <<< "${args[--projectTags]}"
options+=', '
options+="\"projectTags\": \"[${args[--projectTags]}\"]"
options+="\"projectTags\": [ $(printf ',"'%s'"' "${projectTags[@]}" | cut -c2-) ]"
fi
options+=' }'
data+=("options=${options}")

View File

@ -24,8 +24,9 @@ if [[ ${args[--blankCellsAsStrings]} ]]; then
options+='"storeBlankCellsAsNulls": false'
fi
if [[ ${args[--columnNames]} ]]; then
IFS=',' read -ra columnNames <<< "${args[--columnNames]}"
options+=', '
options+="\"columnNames\": \"[${args[--columnNames]}\"]"
options+="\"columnNames\": [ $(printf ',"'%s'"' "${columnNames[@]}" | cut -c2-) ]"
fi
if [[ ${args[--guessCellValueTypes]} ]]; then
options+=', '
@ -76,8 +77,9 @@ if [[ ${args[--trimStrings]} ]]; then
options+='"trimStrings": true'
fi
if [[ ${args[--projectTags]} ]]; then
IFS=',' read -ra projectTags <<< "${args[--projectTags]}"
options+=', '
options+="\"projectTags\": \"[${args[--projectTags]}\"]"
options+="\"projectTags\": [ $(printf ',"'%s'"' "${projectTags[@]}" | cut -c2-) ]"
fi
options+=' }'
data+=("options=${options}")