import jsonl: remove recordPath

This commit is contained in:
Felix Lohmeier 2023-10-28 20:03:49 +00:00
parent d19031a04a
commit d88a4b5f05
5 changed files with 5 additions and 38 deletions

View File

@ -8,10 +8,6 @@ Usage:
orcli import jsonl --help | -h
Options:
--recordPath JSON
specify record path elements in JSON array
Default: [ "_" ]
--guessCellValueTypes
attempt to parse cell text into numbers

26
orcli
View File

@ -615,12 +615,6 @@ orcli_import_jsonl_usage() {
printf "%s\n" "Options:"
# :command.usage_flags
# :flag.usage
printf " %s\n" "--recordPath JSON"
printf " specify record path elements in JSON array\n"
printf " Default: [ \"_\" ]\n"
echo
# :flag.usage
printf " %s\n" "--guessCellValueTypes"
printf " attempt to parse cell text into numbers\n"
@ -1479,7 +1473,7 @@ send_completions() {
echo $' ;;'
echo $''
echo $' \'import jsonl\'*)'
echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_orcli_completions_filter "--guessCellValueTypes --help --includeArchiveFileName --includeFileSources --limit --projectName --projectTags --quiet --recordPath --storeEmptyStrings --trimStrings -h -q")" -- "$cur" )'
echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_orcli_completions_filter "--guessCellValueTypes --help --includeArchiveFileName --includeFileSources --limit --projectName --projectTags --quiet --storeEmptyStrings --trimStrings -h -q")" -- "$cur" )'
echo $' ;;'
echo $''
echo $' \'completions\'*)'
@ -1849,7 +1843,7 @@ orcli_import_jsonl_command() {
# assemble specific post data (some options require json format)
data+=("format=text/json")
options='{ '
options+="\"recordPath\": ${args[--recordPath]}"
options+="\"recordPath\": [\"_\"]"
if [[ ${args[--guessCellValueTypes]} ]]; then
options+=', '
options+='"guessCellValueTypes": true'
@ -3442,21 +3436,6 @@ orcli_import_jsonl_parse_requirements() {
while [[ $# -gt 0 ]]; do
key="$1"
case "$key" in
# :flag.case
--recordPath)
# :flag.case_arg
if [[ -n ${2+x} ]]; then
args['--recordPath']="$2"
shift
shift
else
printf "%s\n" "--recordPath requires an argument: --recordPath JSON" >&2
exit 1
fi
;;
# :flag.case
--guessCellValueTypes)
@ -3574,7 +3553,6 @@ orcli_import_jsonl_parse_requirements() {
# :command.default_assignments
[[ -n ${args['file']:-} ]] || args['file']="-"
[[ -n ${args['--recordPath']:-} ]] || args['--recordPath']="[ \"_\" ]"
[[ -n ${args['--limit']:-} ]] || args['--limit']="-1"
}

View File

@ -233,18 +233,11 @@ commands:
args:
- *file
flags:
- &recordPath
long: --recordPath
help: specify record path elements in JSON array
arg: json
default: "[ \\\"_\\\" ]"
- *guessCellValueTypes
- *includeFileSources
- *includeArchiveFileName
- *limit
- &storeEmptyStrings
long: --storeEmptyStrings
help: preserve empty strings
- *storeEmptyStrings
- *trimStrings
- *projectName
- *projectTags

View File

@ -12,7 +12,7 @@ fi
# assemble specific post data (some options require json format)
data+=("format=text/json")
options='{ '
options+="\"recordPath\": ${args[--recordPath]}"
options+="\"recordPath\": [\"_\"]"
if [[ ${args[--guessCellValueTypes]} ]]; then
options+=', '
options+='"guessCellValueTypes": true'

View File

@ -39,7 +39,7 @@ send_completions() {
echo $' ;;'
echo $''
echo $' \'import jsonl\'*)'
echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_orcli_completions_filter "--guessCellValueTypes --help --includeArchiveFileName --includeFileSources --limit --projectName --projectTags --quiet --recordPath --storeEmptyStrings --trimStrings -h -q")" -- "$cur" )'
echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_orcli_completions_filter "--guessCellValueTypes --help --includeArchiveFileName --includeFileSources --limit --projectName --projectTags --quiet --storeEmptyStrings --trimStrings -h -q")" -- "$cur" )'
echo $' ;;'
echo $''
echo $' \'completions\'*)'