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 orcli import jsonl --help | -h
Options: Options:
--recordPath JSON
specify record path elements in JSON array
Default: [ "_" ]
--guessCellValueTypes --guessCellValueTypes
attempt to parse cell text into numbers attempt to parse cell text into numbers

26
orcli
View File

@ -615,12 +615,6 @@ orcli_import_jsonl_usage() {
printf "%s\n" "Options:" printf "%s\n" "Options:"
# :command.usage_flags # :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 # :flag.usage
printf " %s\n" "--guessCellValueTypes" printf " %s\n" "--guessCellValueTypes"
printf " attempt to parse cell text into numbers\n" printf " attempt to parse cell text into numbers\n"
@ -1479,7 +1473,7 @@ send_completions() {
echo $' ;;' echo $' ;;'
echo $'' echo $''
echo $' \'import jsonl\'*)' 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 $'' echo $''
echo $' \'completions\'*)' echo $' \'completions\'*)'
@ -1849,7 +1843,7 @@ orcli_import_jsonl_command() {
# assemble specific post data (some options require json format) # assemble specific post data (some options require json format)
data+=("format=text/json") data+=("format=text/json")
options='{ ' options='{ '
options+="\"recordPath\": ${args[--recordPath]}" options+="\"recordPath\": [\"_\"]"
if [[ ${args[--guessCellValueTypes]} ]]; then if [[ ${args[--guessCellValueTypes]} ]]; then
options+=', ' options+=', '
options+='"guessCellValueTypes": true' options+='"guessCellValueTypes": true'
@ -3442,21 +3436,6 @@ orcli_import_jsonl_parse_requirements() {
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
key="$1" key="$1"
case "$key" in 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 # :flag.case
--guessCellValueTypes) --guessCellValueTypes)
@ -3574,7 +3553,6 @@ orcli_import_jsonl_parse_requirements() {
# :command.default_assignments # :command.default_assignments
[[ -n ${args['file']:-} ]] || args['file']="-" [[ -n ${args['file']:-} ]] || args['file']="-"
[[ -n ${args['--recordPath']:-} ]] || args['--recordPath']="[ \"_\" ]"
[[ -n ${args['--limit']:-} ]] || args['--limit']="-1" [[ -n ${args['--limit']:-} ]] || args['--limit']="-1"
} }

View File

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

View File

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

View File

@ -39,7 +39,7 @@ send_completions() {
echo $' ;;' echo $' ;;'
echo $'' echo $''
echo $' \'import jsonl\'*)' 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 $'' echo $''
echo $' \'completions\'*)' echo $' \'completions\'*)'