diff --git a/orcli b/orcli index 875f219..7caa1ef 100755 --- a/orcli +++ b/orcli @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# This script was generated by bashly 0.9.1 (https://bashly.dannyb.co) +# This script was generated by bashly 0.9.4 (https://bashly.dannyb.co) # Modifying it manually is not recommended # :wrapper.bash3_bouncer @@ -27,47 +27,47 @@ orcli_usage() { fi - printf "Usage:\n" + printf "%s\n" "Usage:" printf " orcli COMMAND\n" printf " orcli [COMMAND] --help | -h\n" printf " orcli --version | -v\n" echo # :command.usage_commands - printf "Commands:\n" - echo " completions Generate bash completions" - echo " delete delete OpenRefine project" - echo " import commands to create OpenRefine projects from files or URLs" - echo " list list projects on OpenRefine server" - echo " info show OpenRefine project's metadata" - echo " test run functional tests on tmp OpenRefine workspace" - echo " transform apply undo/redo JSON file(s) to an OpenRefine project" - echo " export commands to export data from OpenRefine projects to files" - echo " run run tmp OpenRefine workspace and execute shell script(s)" + printf "%s\n" "Commands:" + printf " %s Generate bash completions\n" "completions" + printf " %s delete OpenRefine project\n" "delete " + printf " %s commands to create OpenRefine projects from files or URLs\n" "import " + printf " %s list projects on OpenRefine server\n" "list " + printf " %s show OpenRefine project's metadata\n" "info " + printf " %s run functional tests on tmp OpenRefine workspace\n" "test " + printf " %s apply undo/redo JSON file(s) to an OpenRefine project\n" "transform " + printf " %s commands to export data from OpenRefine projects to files\n" "export " + printf " %s run tmp OpenRefine workspace and execute shell script(s)\n" "run " echo # :command.long_usage if [[ -n $long_usage ]]; then - printf "Options:\n" + printf "%s\n" "Options:" # :command.usage_fixed_flags - echo " --help, -h" + printf " %s\n" "--help, -h" printf " Show this help\n" echo - echo " --version, -v" + printf " %s\n" "--version, -v" printf " Show version number\n" echo # :command.usage_environment_variables - printf "Environment Variables:\n" + printf "%s\n" "Environment Variables:" # :environment_variable.usage - echo " OPENREFINE_URL" + printf " %s\n" "OPENREFINE_URL" printf " URL to OpenRefine server\n" printf " Default: http://localhost:3333\n" echo # :command.usage_examples - printf "Examples:\n" + printf "%s\n" "Examples:" printf " orcli import csv \"https://git.io/fj5hF\" --projectName \"duplicates\"\n" printf " orcli list\n" printf " orcli info \"duplicates\"\n" @@ -100,17 +100,17 @@ orcli_completions_usage() { fi - printf "Usage:\n" + printf "%s\n" "Usage:" printf " orcli completions\n" printf " orcli completions --help | -h\n" echo # :command.long_usage if [[ -n $long_usage ]]; then - printf "Options:\n" + printf "%s\n" "Options:" # :command.usage_fixed_flags - echo " --help, -h" + printf " %s\n" "--help, -h" printf " Show this help\n" echo @@ -129,41 +129,41 @@ orcli_delete_usage() { fi - printf "Usage:\n" + printf "%s\n" "Usage:" printf " orcli delete PROJECT [OPTIONS]\n" printf " orcli delete --help | -h\n" echo # :command.long_usage if [[ -n $long_usage ]]; then - printf "Options:\n" + printf "%s\n" "Options:" # :command.usage_fixed_flags - echo " --help, -h" + printf " %s\n" "--help, -h" printf " Show this help\n" echo # :command.usage_flags # :flag.usage - echo " --force, -f" + printf " %s\n" "--force, -f" printf " delete all projects with the same name\n" echo # :flag.usage - echo " --quiet, -q" + printf " %s\n" "--quiet, -q" printf " suppress log output, print errors only\n" echo # :command.usage_args - printf "Arguments:\n" + printf "%s\n" "Arguments:" # :argument.usage - echo " PROJECT" + printf " %s\n" "PROJECT" printf " project name or id\n" echo # :command.usage_examples - printf "Examples:\n" + printf "%s\n" "Examples:" printf " orcli delete \"duplicates\"\n" printf " orcli delete 1234567890123\n" echo @@ -183,22 +183,22 @@ orcli_import_usage() { fi - printf "Usage:\n" + printf "%s\n" "Usage:" printf " orcli import COMMAND\n" printf " orcli import [COMMAND] --help | -h\n" echo # :command.usage_commands - printf "Commands:\n" - echo " csv import character-separated values (CSV)" - echo " tsv import tab-separated values (TSV)" + printf "%s\n" "Commands:" + printf " %s import character-separated values (CSV)\n" "csv" + printf " %s import tab-separated values (TSV)\n" "tsv" echo # :command.long_usage if [[ -n $long_usage ]]; then - printf "Options:\n" + printf "%s\n" "Options:" # :command.usage_fixed_flags - echo " --help, -h" + printf " %s\n" "--help, -h" printf " Show this help\n" echo @@ -217,118 +217,128 @@ orcli_import_csv_usage() { fi - printf "Usage:\n" + printf "%s\n" "Usage:" printf " orcli import csv [FILE...] [OPTIONS]\n" printf " orcli import csv --help | -h\n" echo # :command.long_usage if [[ -n $long_usage ]]; then - printf "Options:\n" + printf "%s\n" "Options:" # :command.usage_fixed_flags - echo " --help, -h" + printf " %s\n" "--help, -h" printf " Show this help\n" echo # :command.usage_flags # :flag.usage - echo " --separator SEPARATOR" + printf " %s\n" "--separator SEPARATOR" printf " character(s) that separates columns\n" printf " Default: ,\n" echo # :flag.usage - echo " --blankCellsAsStrings" + printf " %s\n" "--blankCellsAsStrings" printf " store blank cells as empty strings instead of nulls\n" echo # :flag.usage - echo " --encoding ENCODING" + printf " %s\n" "--columnNames COLUMNNAMES" + printf " set column names (comma separated)\n" + echo + + # :flag.usage + printf " %s\n" "--encoding ENCODING" printf " set character encoding\n" echo # :flag.usage - echo " --guessCellValueTypes" + printf " %s\n" "--guessCellValueTypes" printf " attempt to parse cell text into numbers\n" echo # :flag.usage - echo " --headerLines HEADERLINES" + printf " %s\n" "--headerLines HEADERLINES" printf " parse x line(s) as column headers\n" printf " Default: 1\n" echo # :flag.usage - echo " --ignoreLines IGNORELINES" + printf " %s\n" "--ignoreLines IGNORELINES" printf " ignore first x line(s) at beginning of file\n" printf " Default: -1\n" echo # :flag.usage - echo " --ignoreQuoteCharacter" + printf " %s\n" "--ignoreQuoteCharacter" printf " do not use any quote character to enclose cells containing column separators\n" echo # :flag.usage - echo " --includeFileSources" + printf " %s\n" "--includeFileSources" printf " add column with file source\n" echo # :flag.usage - echo " --includeArchiveFileName" + printf " %s\n" "--includeArchiveFileName" printf " add column with archive file name\n" echo # :flag.usage - echo " --limit LIMIT" + printf " %s\n" "--limit LIMIT" printf " load at most x row(s) of data\n" printf " Default: -1\n" echo # :flag.usage - echo " --quoteCharacter QUOTECHARACTER" + printf " %s\n" "--quoteCharacter QUOTECHARACTER" printf " quote character to enclose cells containing column separators\n" printf " Default: \\\"\n" echo # :flag.usage - echo " --skipBlankRows" + printf " %s\n" "--skipBlankRows" printf " do not store blank rows\n" echo # :flag.usage - echo " --skipDataLines SKIPDATALINES" + printf " %s\n" "--skipDataLines SKIPDATALINES" printf " discard initial x row(s) of data\n" printf " Default: 0\n" echo # :flag.usage - echo " --trimStrings" + printf " %s\n" "--trimStrings" printf " trim leading & trailing whitespace from strings\n" echo # :flag.usage - echo " --projectName PROJECTNAME" + printf " %s\n" "--projectName PROJECTNAME" printf " set a name for the OpenRefine project\n" echo # :flag.usage - echo " --quiet, -q" + printf " %s\n" "--projectTags PROJECTTAGS" + printf " set project tags (comma separated)\n" + echo + + # :flag.usage + printf " %s\n" "--quiet, -q" printf " suppress log output, print errors only\n" echo # :command.usage_args - printf "Arguments:\n" + printf "%s\n" "Arguments:" # :argument.usage - echo " FILE..." + printf " %s\n" "FILE..." printf " Path to one or more files or URLs. When FILE is -, read standard input.\n" printf " Default: -\n" echo # :command.usage_examples - printf "Examples:\n" + printf "%s\n" "Examples:" printf " orcli import csv \"file\"\n" printf " orcli import csv \"file1\" \"file2\"\n" printf " head -n 100 \"file\" | orcli import csv\n" @@ -351,52 +361,122 @@ orcli_import_tsv_usage() { fi - printf "Usage:\n" + printf "%s\n" "Usage:" printf " orcli import tsv [FILE...] [OPTIONS]\n" printf " orcli import tsv --help | -h\n" echo # :command.long_usage if [[ -n $long_usage ]]; then - printf "Options:\n" + printf "%s\n" "Options:" # :command.usage_fixed_flags - echo " --help, -h" + printf " %s\n" "--help, -h" printf " Show this help\n" echo # :command.usage_flags # :flag.usage - echo " --encoding ENCODING" + printf " %s\n" "--blankCellsAsStrings" + printf " store blank cells as empty strings instead of nulls\n" + echo + + # :flag.usage + printf " %s\n" "--columnNames COLUMNNAMES" + printf " set column names (comma separated)\n" + echo + + # :flag.usage + printf " %s\n" "--encoding ENCODING" printf " set character encoding\n" echo # :flag.usage - echo " --trimStrings" + printf " %s\n" "--guessCellValueTypes" + printf " attempt to parse cell text into numbers\n" + echo + + # :flag.usage + printf " %s\n" "--headerLines HEADERLINES" + printf " parse x line(s) as column headers\n" + printf " Default: 1\n" + echo + + # :flag.usage + printf " %s\n" "--ignoreLines IGNORELINES" + printf " ignore first x line(s) at beginning of file\n" + printf " Default: -1\n" + echo + + # :flag.usage + printf " %s\n" "--ignoreQuoteCharacter" + printf " do not use any quote character to enclose cells containing column separators\n" + echo + + # :flag.usage + printf " %s\n" "--includeFileSources" + printf " add column with file source\n" + echo + + # :flag.usage + printf " %s\n" "--includeArchiveFileName" + printf " add column with archive file name\n" + echo + + # :flag.usage + printf " %s\n" "--limit LIMIT" + printf " load at most x row(s) of data\n" + printf " Default: -1\n" + echo + + # :flag.usage + printf " %s\n" "--quoteCharacter QUOTECHARACTER" + printf " quote character to enclose cells containing column separators\n" + printf " Default: \\\"\n" + echo + + # :flag.usage + printf " %s\n" "--skipBlankRows" + printf " do not store blank rows\n" + echo + + # :flag.usage + printf " %s\n" "--skipDataLines SKIPDATALINES" + printf " discard initial x row(s) of data\n" + printf " Default: 0\n" + echo + + # :flag.usage + printf " %s\n" "--trimStrings" printf " trim leading & trailing whitespace from strings\n" echo # :flag.usage - echo " --projectName PROJECTNAME" + printf " %s\n" "--projectName PROJECTNAME" printf " set a name for the OpenRefine project\n" echo # :flag.usage - echo " --quiet, -q" + printf " %s\n" "--projectTags PROJECTTAGS" + printf " set project tags (comma separated)\n" + echo + + # :flag.usage + printf " %s\n" "--quiet, -q" printf " suppress log output, print errors only\n" echo # :command.usage_args - printf "Arguments:\n" + printf "%s\n" "Arguments:" # :argument.usage - echo " FILE..." + printf " %s\n" "FILE..." printf " Path to one or more files or URLs. When FILE is -, read standard input.\n" printf " Default: -\n" echo # :command.usage_examples - printf "Examples:\n" + printf "%s\n" "Examples:" printf " orcli import tsv \"file\"\n" printf " orcli import tsv \"file1\" \"file2\"\n" printf " head -n 100 \"file\" | orcli import tsv\n" @@ -419,17 +499,17 @@ orcli_list_usage() { fi - printf "Usage:\n" + printf "%s\n" "Usage:" printf " orcli list\n" printf " orcli list --help | -h\n" echo # :command.long_usage if [[ -n $long_usage ]]; then - printf "Options:\n" + printf "%s\n" "Options:" # :command.usage_fixed_flags - echo " --help, -h" + printf " %s\n" "--help, -h" printf " Show this help\n" echo @@ -448,30 +528,30 @@ orcli_info_usage() { fi - printf "Usage:\n" + printf "%s\n" "Usage:" printf " orcli info PROJECT\n" printf " orcli info --help | -h\n" echo # :command.long_usage if [[ -n $long_usage ]]; then - printf "Options:\n" + printf "%s\n" "Options:" # :command.usage_fixed_flags - echo " --help, -h" + printf " %s\n" "--help, -h" printf " Show this help\n" echo # :command.usage_args - printf "Arguments:\n" + printf "%s\n" "Arguments:" # :argument.usage - echo " PROJECT" + printf " %s\n" "PROJECT" printf " project name or id\n" echo # :command.usage_examples - printf "Examples:\n" + printf "%s\n" "Examples:" printf " orcli info \"duplicates\"\n" printf " orcli info 1234567890123\n" echo @@ -491,17 +571,17 @@ orcli_test_usage() { fi - printf "Usage:\n" + printf "%s\n" "Usage:" printf " orcli test\n" printf " orcli test --help | -h\n" echo # :command.long_usage if [[ -n $long_usage ]]; then - printf "Options:\n" + printf "%s\n" "Options:" # :command.usage_fixed_flags - echo " --help, -h" + printf " %s\n" "--help, -h" printf " Show this help\n" echo @@ -520,42 +600,42 @@ orcli_transform_usage() { fi - printf "Usage:\n" + printf "%s\n" "Usage:" printf " orcli transform PROJECT [FILE...] [OPTIONS]\n" printf " orcli transform --help | -h\n" echo # :command.long_usage if [[ -n $long_usage ]]; then - printf "Options:\n" + printf "%s\n" "Options:" # :command.usage_fixed_flags - echo " --help, -h" + printf " %s\n" "--help, -h" printf " Show this help\n" echo # :command.usage_flags # :flag.usage - echo " --quiet, -q" + printf " %s\n" "--quiet, -q" printf " suppress log output, print errors only\n" echo # :command.usage_args - printf "Arguments:\n" + printf "%s\n" "Arguments:" # :argument.usage - echo " PROJECT" + printf " %s\n" "PROJECT" printf " project name or id\n" echo # :argument.usage - echo " FILE..." + printf " %s\n" "FILE..." printf " Path to one or more files or URLs. When FILE is -, read standard input.\n" printf " Default: -\n" echo # :command.usage_examples - printf "Examples:\n" + printf "%s\n" "Examples:" printf " orcli transform \"duplicates\" \"history.json\"\n" printf " cat \"history.json\" | orcli transform \"duplicates\"\n" printf " orcli transform \"duplicates\" \"https://git.io/fj5ju\"\n" @@ -577,21 +657,21 @@ orcli_export_usage() { fi - printf "Usage:\n" + printf "%s\n" "Usage:" printf " orcli export COMMAND\n" printf " orcli export [COMMAND] --help | -h\n" echo # :command.usage_commands - printf "Commands:\n" - echo " tsv export tab-separated values (TSV)" + printf "%s\n" "Commands:" + printf " %s export tab-separated values (TSV)\n" "tsv" echo # :command.long_usage if [[ -n $long_usage ]]; then - printf "Options:\n" + printf "%s\n" "Options:" # :command.usage_fixed_flags - echo " --help, -h" + printf " %s\n" "--help, -h" printf " Show this help\n" echo @@ -610,47 +690,47 @@ orcli_export_tsv_usage() { fi - printf "Usage:\n" + printf "%s\n" "Usage:" printf " orcli export tsv PROJECT [OPTIONS]\n" printf " orcli export tsv --help | -h\n" echo # :command.long_usage if [[ -n $long_usage ]]; then - printf "Options:\n" + printf "%s\n" "Options:" # :command.usage_fixed_flags - echo " --help, -h" + printf " %s\n" "--help, -h" printf " Show this help\n" echo # :command.usage_flags # :flag.usage - echo " --output FILE" + printf " %s\n" "--output FILE" printf " Write to file instead of stdout\n" echo # :flag.usage - echo " --encoding ENCODING" + printf " %s\n" "--encoding ENCODING" printf " set character encoding\n" printf " Default: UTF-8\n" echo # :flag.usage - echo " --quiet, -q" + printf " %s\n" "--quiet, -q" printf " suppress log output, print errors only\n" echo # :command.usage_args - printf "Arguments:\n" + printf "%s\n" "Arguments:" # :argument.usage - echo " PROJECT" + printf " %s\n" "PROJECT" printf " project name or id\n" echo # :command.usage_examples - printf "Examples:\n" + printf "%s\n" "Examples:" printf " orcli export tsv \"duplicates\"\n" printf " orcli export tsv \"duplicates\" --output \"duplicates.tsv\"\n" echo @@ -670,54 +750,54 @@ orcli_run_usage() { fi - printf "Usage:\n" + printf "%s\n" "Usage:" printf " orcli run [FILE...] [OPTIONS]\n" printf " orcli run --help | -h\n" echo # :command.long_usage if [[ -n $long_usage ]]; then - printf "Options:\n" + printf "%s\n" "Options:" # :command.usage_fixed_flags - echo " --help, -h" + printf " %s\n" "--help, -h" printf " Show this help\n" echo # :command.usage_flags # :flag.usage - echo " --memory RAM" + printf " %s\n" "--memory RAM" printf " maximum RAM for OpenRefine java heap space\n" printf " Default: 2048M\n" echo # :flag.usage - echo " --port PORT" + printf " %s\n" "--port PORT" printf " PORT on which OpenRefine should listen\n" printf " Default: 3333\n" echo # :flag.usage - echo " --interactive" + printf " %s\n" "--interactive" printf " do not exit on error and keep bash shell open\n" echo # :flag.usage - echo " --quiet, -q" + printf " %s\n" "--quiet, -q" printf " suppress log output, print errors only\n" echo # :command.usage_args - printf "Arguments:\n" + printf "%s\n" "Arguments:" # :argument.usage - echo " FILE..." + printf " %s\n" "FILE..." printf " Path to one or more files or URLs. When FILE is -, read standard input.\n" printf " Default: -\n" echo # :command.usage_examples - printf "Examples:\n" + printf "%s\n" "Examples:" printf " orcli run --interactive\n" printf " orcli run << EOF\n orcli import csv \"https://git.io/fj5hF\" --projectName \"duplicates\"\n orcli transform \"duplicates\" \"https://git.io/fj5ju\"\n orcli export tsv \"duplicates\"\n EOF\n" printf " orcli run --memory \"2000M\" --port \"3334\" << EOF\n orcli import csv \"https://git.io/fj5hF\" --projectName \"duplicates\" &\n orcli import csv \"https://git.io/fj5hF\" --projectName \"copy\" &\n wait\n echo \"finished import\"\n orcli export csv \"duplicates\" --output duplicates.csv &\n orcli export tsv \"duplicates\" --output duplicates.tsv &\n wait\n wc duplicates*\n EOF\n" @@ -1003,11 +1083,11 @@ send_completions() { echo $' ;;' echo $'' echo $' \'import csv\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_orcli_completions_filter "--blankCellsAsStrings --encoding --guessCellValueTypes --headerLines --help --ignoreLines --ignoreQuoteCharacter --includeArchiveFileName --includeFileSources --limit --projectName --quiet --quoteCharacter --separator --skipBlankRows --skipDataLines --trimStrings -h -q")" -- "$cur" )' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_orcli_completions_filter "--blankCellsAsStrings --columnNames --encoding --guessCellValueTypes --headerLines --help --ignoreLines --ignoreQuoteCharacter --includeArchiveFileName --includeFileSources --limit --projectName --projectTags --quiet --quoteCharacter --separator --skipBlankRows --skipDataLines --trimStrings -h -q")" -- "$cur" )' echo $' ;;' echo $'' echo $' \'import tsv\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_orcli_completions_filter "--encoding --help --projectName --quiet --trimStrings -h -q")" -- "$cur" )' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_orcli_completions_filter "--blankCellsAsStrings --columnNames --encoding --guessCellValueTypes --headerLines --help --ignoreLines --ignoreQuoteCharacter --includeArchiveFileName --includeFileSources --limit --projectName --projectTags --quiet --quoteCharacter --skipBlankRows --skipDataLines --trimStrings -h -q")" -- "$cur" )' echo $' ;;' echo $'' echo $' \'export tsv\'*)' @@ -1125,6 +1205,11 @@ orcli_import_csv_command() { options+=', ' options+='"storeBlankCellsAsNulls": false' fi + if [[ ${args[--columnNames]} ]]; then + IFS=',' read -ra columnNames <<< "${args[--columnNames]}" + options+=', ' + options+="\"columnNames\": [ $(printf ',"'%s'"' "${columnNames[@]}" | cut -c2-) ]" + fi if [[ ${args[--guessCellValueTypes]} ]]; then options+=', ' options+='"guessCellValueTypes": true' @@ -1173,6 +1258,11 @@ orcli_import_csv_command() { options+=', ' options+='"trimStrings": true' fi + if [[ ${args[--projectTags]} ]]; then + IFS=',' read -ra projectTags <<< "${args[--projectTags]}" + options+=', ' + options+="\"projectTags\": [ $(printf ',"'%s'"' "${projectTags[@]}" | cut -c2-) ]" + fi options+=' }' data+=("options=${options}") @@ -1205,9 +1295,65 @@ orcli_import_tsv_command() { options+=', ' options+="\"encoding\": \"${args[--encoding]}\"" fi + if [[ ${args[--blankCellsAsStrings]} ]]; then + options+=', ' + options+='"storeBlankCellsAsNulls": false' + fi + if [[ ${args[--columnNames]} ]]; then + options+=', ' + options+="\"columnNames\": \"[${args[--columnNames]}\"]" + fi + if [[ ${args[--guessCellValueTypes]} ]]; then + options+=', ' + options+='"guessCellValueTypes": true' + fi + if [[ ${args[--headerLines]} ]]; then + options+=', ' + options+="\"headerLines\": ${args[--headerLines]}" + fi + if [[ ${args[--ignoreLines]} ]]; then + options+=', ' + options+="\"ignoreLines\": ${args[--ignoreLines]}" + fi + if [[ ${args[--ignoreQuoteCharacter]} ]]; then + options+=', ' + options+='"processQuotes": false' + fi + if [[ ${args[--includeFileSources]} ]]; then + options+=', ' + options+='includeFileSources: true' + fi + if [[ ${args[--includeArchiveFileName]} ]]; then + options+=', ' + options+='"includeArchiveFileName": true' + fi + if [[ ${args[--limit]} ]]; then + options+=', ' + options+="\"limit\": ${args[--limit]}" + fi + if [[ ${args[--projectName]} ]]; then + options+=', ' + options+="\"projectName\": \"${args[--projectName]}\"" + fi + if [[ ${args[--quoteCharacter]} ]]; then + options+=', ' + options+="\"quoteCharacter\": \"${args[--quoteCharacter]}\"" + fi + if [[ ${args[--skipBlankRows]} ]]; then + options+=', ' + options+='"storeBlankRows": false' + fi + if [[ ${args[--skipDataLines]} ]]; then + options+=', ' + options+="\"skipDataLines\": ${args[--skipDataLines]}" + fi if [[ ${args[--trimStrings]} ]]; then options+=', ' - options+="\"trimStrings\": true" + options+='"trimStrings": true' + fi + if [[ ${args[--projectTags]} ]]; then + options+=', ' + options+="\"projectTags\": \"[${args[--projectTags]}\"]" fi options+=' }' data+=("options=${options}") @@ -1800,7 +1946,7 @@ orcli_delete_parse_requirements() { --force | -f) # :flag.case_no_arg - args[--force]=1 + args['--force']=1 shift ;; @@ -1808,7 +1954,7 @@ orcli_delete_parse_requirements() { --quiet | -q) # :flag.case_no_arg - args[--quiet]=1 + args['--quiet']=1 shift ;; @@ -1820,9 +1966,9 @@ orcli_delete_parse_requirements() { *) # :command.parse_requirements_case # :command.parse_requirements_case_simple - if [[ -z ${args[project]+x} ]]; then + if [[ -z ${args['project']+x} ]]; then - args[project]=$1 + args['project']=$1 shift else printf "invalid argument: %s\n" "$key" >&2 @@ -1835,7 +1981,7 @@ orcli_delete_parse_requirements() { done # :command.required_args_filter - if [[ -z ${args[project]+x} ]]; then + if [[ -z ${args['project']+x} ]]; then printf "missing required argument: PROJECT\nusage: orcli delete PROJECT [OPTIONS]\n" >&2 exit 1 fi @@ -1947,7 +2093,7 @@ orcli_import_csv_parse_requirements() { # :flag.case_arg if [[ -n ${2+x} ]]; then - args[--separator]="$2" + args['--separator']="$2" shift shift else @@ -1960,17 +2106,32 @@ orcli_import_csv_parse_requirements() { --blankCellsAsStrings) # :flag.case_no_arg - args[--blankCellsAsStrings]=1 + args['--blankCellsAsStrings']=1 shift ;; + # :flag.case + --columnNames) + + # :flag.case_arg + if [[ -n ${2+x} ]]; then + + args['--columnNames']="$2" + shift + shift + else + printf "%s\n" "--columnNames requires an argument: --columnNames COLUMNNAMES" >&2 + exit 1 + fi + ;; + # :flag.case --encoding) # :flag.case_arg if [[ -n ${2+x} ]]; then - args[--encoding]="$2" + args['--encoding']="$2" shift shift else @@ -1983,7 +2144,7 @@ orcli_import_csv_parse_requirements() { --guessCellValueTypes) # :flag.case_no_arg - args[--guessCellValueTypes]=1 + args['--guessCellValueTypes']=1 shift ;; @@ -1993,7 +2154,7 @@ orcli_import_csv_parse_requirements() { # :flag.case_arg if [[ -n ${2+x} ]]; then - args[--headerLines]="$2" + args['--headerLines']="$2" shift shift else @@ -2008,7 +2169,7 @@ orcli_import_csv_parse_requirements() { # :flag.case_arg if [[ -n ${2+x} ]]; then - args[--ignoreLines]="$2" + args['--ignoreLines']="$2" shift shift else @@ -2021,7 +2182,7 @@ orcli_import_csv_parse_requirements() { --ignoreQuoteCharacter) # :flag.case_no_arg - args[--ignoreQuoteCharacter]=1 + args['--ignoreQuoteCharacter']=1 shift ;; @@ -2029,7 +2190,7 @@ orcli_import_csv_parse_requirements() { --includeFileSources) # :flag.case_no_arg - args[--includeFileSources]=1 + args['--includeFileSources']=1 shift ;; @@ -2037,7 +2198,7 @@ orcli_import_csv_parse_requirements() { --includeArchiveFileName) # :flag.case_no_arg - args[--includeArchiveFileName]=1 + args['--includeArchiveFileName']=1 shift ;; @@ -2047,7 +2208,7 @@ orcli_import_csv_parse_requirements() { # :flag.case_arg if [[ -n ${2+x} ]]; then - args[--limit]="$2" + args['--limit']="$2" shift shift else @@ -2062,7 +2223,7 @@ orcli_import_csv_parse_requirements() { # :flag.case_arg if [[ -n ${2+x} ]]; then - args[--quoteCharacter]="$2" + args['--quoteCharacter']="$2" shift shift else @@ -2075,7 +2236,7 @@ orcli_import_csv_parse_requirements() { --skipBlankRows) # :flag.case_no_arg - args[--skipBlankRows]=1 + args['--skipBlankRows']=1 shift ;; @@ -2085,7 +2246,7 @@ orcli_import_csv_parse_requirements() { # :flag.case_arg if [[ -n ${2+x} ]]; then - args[--skipDataLines]="$2" + args['--skipDataLines']="$2" shift shift else @@ -2098,7 +2259,7 @@ orcli_import_csv_parse_requirements() { --trimStrings) # :flag.case_no_arg - args[--trimStrings]=1 + args['--trimStrings']=1 shift ;; @@ -2108,7 +2269,7 @@ orcli_import_csv_parse_requirements() { # :flag.case_arg if [[ -n ${2+x} ]]; then - args[--projectName]="$2" + args['--projectName']="$2" shift shift else @@ -2117,11 +2278,26 @@ orcli_import_csv_parse_requirements() { fi ;; + # :flag.case + --projectTags) + + # :flag.case_arg + if [[ -n ${2+x} ]]; then + + args['--projectTags']="$2" + shift + shift + else + printf "%s\n" "--projectTags requires an argument: --projectTags PROJECTTAGS" >&2 + exit 1 + fi + ;; + # :flag.case --quiet | -q) # :flag.case_no_arg - args[--quiet]=1 + args['--quiet']=1 shift ;; @@ -2133,12 +2309,12 @@ orcli_import_csv_parse_requirements() { *) # :command.parse_requirements_case # :command.parse_requirements_case_repeatable - if [[ -z ${args[file]+x} ]]; then - args[file]="\"$1\"" + if [[ -z ${args['file']+x} ]]; then + args['file']="\"$1\"" shift else - args[file]="${args[file]} \"$1\"" + args['file']="${args[file]} \"$1\"" shift fi @@ -2148,13 +2324,13 @@ orcli_import_csv_parse_requirements() { done # :command.default_assignments - [[ -n ${args[file]:-} ]] || args[file]="-" - [[ -n ${args[--separator]:-} ]] || args[--separator]="," - [[ -n ${args[--headerLines]:-} ]] || args[--headerLines]="1" - [[ -n ${args[--ignoreLines]:-} ]] || args[--ignoreLines]="-1" - [[ -n ${args[--limit]:-} ]] || args[--limit]="-1" - [[ -n ${args[--quoteCharacter]:-} ]] || args[--quoteCharacter]="\\\"" - [[ -n ${args[--skipDataLines]:-} ]] || args[--skipDataLines]="0" + [[ -n ${args['file']:-} ]] || args['file']="-" + [[ -n ${args['--separator']:-} ]] || args['--separator']="," + [[ -n ${args['--headerLines']:-} ]] || args['--headerLines']="1" + [[ -n ${args['--ignoreLines']:-} ]] || args['--ignoreLines']="-1" + [[ -n ${args['--limit']:-} ]] || args['--limit']="-1" + [[ -n ${args['--quoteCharacter']:-} ]] || args['--quoteCharacter']="\\\"" + [[ -n ${args['--skipDataLines']:-} ]] || args['--skipDataLines']="0" } @@ -2183,13 +2359,36 @@ orcli_import_tsv_parse_requirements() { while [[ $# -gt 0 ]]; do key="$1" case "$key" in + # :flag.case + --blankCellsAsStrings) + + # :flag.case_no_arg + args['--blankCellsAsStrings']=1 + shift + ;; + + # :flag.case + --columnNames) + + # :flag.case_arg + if [[ -n ${2+x} ]]; then + + args['--columnNames']="$2" + shift + shift + else + printf "%s\n" "--columnNames requires an argument: --columnNames COLUMNNAMES" >&2 + exit 1 + fi + ;; + # :flag.case --encoding) # :flag.case_arg if [[ -n ${2+x} ]]; then - args[--encoding]="$2" + args['--encoding']="$2" shift shift else @@ -2198,11 +2397,126 @@ orcli_import_tsv_parse_requirements() { fi ;; + # :flag.case + --guessCellValueTypes) + + # :flag.case_no_arg + args['--guessCellValueTypes']=1 + shift + ;; + + # :flag.case + --headerLines) + + # :flag.case_arg + if [[ -n ${2+x} ]]; then + + args['--headerLines']="$2" + shift + shift + else + printf "%s\n" "--headerLines requires an argument: --headerLines HEADERLINES" >&2 + exit 1 + fi + ;; + + # :flag.case + --ignoreLines) + + # :flag.case_arg + if [[ -n ${2+x} ]]; then + + args['--ignoreLines']="$2" + shift + shift + else + printf "%s\n" "--ignoreLines requires an argument: --ignoreLines IGNORELINES" >&2 + exit 1 + fi + ;; + + # :flag.case + --ignoreQuoteCharacter) + + # :flag.case_no_arg + args['--ignoreQuoteCharacter']=1 + shift + ;; + + # :flag.case + --includeFileSources) + + # :flag.case_no_arg + args['--includeFileSources']=1 + shift + ;; + + # :flag.case + --includeArchiveFileName) + + # :flag.case_no_arg + args['--includeArchiveFileName']=1 + shift + ;; + + # :flag.case + --limit) + + # :flag.case_arg + if [[ -n ${2+x} ]]; then + + args['--limit']="$2" + shift + shift + else + printf "%s\n" "--limit requires an argument: --limit LIMIT" >&2 + exit 1 + fi + ;; + + # :flag.case + --quoteCharacter) + + # :flag.case_arg + if [[ -n ${2+x} ]]; then + + args['--quoteCharacter']="$2" + shift + shift + else + printf "%s\n" "--quoteCharacter requires an argument: --quoteCharacter QUOTECHARACTER" >&2 + exit 1 + fi + ;; + + # :flag.case + --skipBlankRows) + + # :flag.case_no_arg + args['--skipBlankRows']=1 + shift + ;; + + # :flag.case + --skipDataLines) + + # :flag.case_arg + if [[ -n ${2+x} ]]; then + + args['--skipDataLines']="$2" + shift + shift + else + printf "%s\n" "--skipDataLines requires an argument: --skipDataLines SKIPDATALINES" >&2 + exit 1 + fi + ;; + # :flag.case --trimStrings) # :flag.case_no_arg - args[--trimStrings]=1 + args['--trimStrings']=1 shift ;; @@ -2212,7 +2526,7 @@ orcli_import_tsv_parse_requirements() { # :flag.case_arg if [[ -n ${2+x} ]]; then - args[--projectName]="$2" + args['--projectName']="$2" shift shift else @@ -2221,11 +2535,26 @@ orcli_import_tsv_parse_requirements() { fi ;; + # :flag.case + --projectTags) + + # :flag.case_arg + if [[ -n ${2+x} ]]; then + + args['--projectTags']="$2" + shift + shift + else + printf "%s\n" "--projectTags requires an argument: --projectTags PROJECTTAGS" >&2 + exit 1 + fi + ;; + # :flag.case --quiet | -q) # :flag.case_no_arg - args[--quiet]=1 + args['--quiet']=1 shift ;; @@ -2237,12 +2566,12 @@ orcli_import_tsv_parse_requirements() { *) # :command.parse_requirements_case # :command.parse_requirements_case_repeatable - if [[ -z ${args[file]+x} ]]; then - args[file]="\"$1\"" + if [[ -z ${args['file']+x} ]]; then + args['file']="\"$1\"" shift else - args[file]="${args[file]} \"$1\"" + args['file']="${args[file]} \"$1\"" shift fi @@ -2252,7 +2581,12 @@ orcli_import_tsv_parse_requirements() { done # :command.default_assignments - [[ -n ${args[file]:-} ]] || args[file]="-" + [[ -n ${args['file']:-} ]] || args['file']="-" + [[ -n ${args['--headerLines']:-} ]] || args['--headerLines']="1" + [[ -n ${args['--ignoreLines']:-} ]] || args['--ignoreLines']="-1" + [[ -n ${args['--limit']:-} ]] || args['--limit']="-1" + [[ -n ${args['--quoteCharacter']:-} ]] || args['--quoteCharacter']="\\\"" + [[ -n ${args['--skipDataLines']:-} ]] || args['--skipDataLines']="0" } @@ -2334,9 +2668,9 @@ orcli_info_parse_requirements() { *) # :command.parse_requirements_case # :command.parse_requirements_case_simple - if [[ -z ${args[project]+x} ]]; then + if [[ -z ${args['project']+x} ]]; then - args[project]=$1 + args['project']=$1 shift else printf "invalid argument: %s\n" "$key" >&2 @@ -2349,7 +2683,7 @@ orcli_info_parse_requirements() { done # :command.required_args_filter - if [[ -z ${args[project]+x} ]]; then + if [[ -z ${args['project']+x} ]]; then printf "missing required argument: PROJECT\nusage: orcli info PROJECT\n" >&2 exit 1 fi @@ -2429,7 +2763,7 @@ orcli_transform_parse_requirements() { --quiet | -q) # :flag.case_no_arg - args[--quiet]=1 + args['--quiet']=1 shift ;; @@ -2441,16 +2775,16 @@ orcli_transform_parse_requirements() { *) # :command.parse_requirements_case # :command.parse_requirements_case_repeatable - if [[ -z ${args[project]+x} ]]; then - args[project]=$1 + if [[ -z ${args['project']+x} ]]; then + args['project']=$1 shift - elif [[ -z ${args[file]+x} ]]; then - args[file]="\"$1\"" + elif [[ -z ${args['file']+x} ]]; then + args['file']="\"$1\"" shift else - args[file]="${args[file]} \"$1\"" + args['file']="${args[file]} \"$1\"" shift fi @@ -2460,13 +2794,13 @@ orcli_transform_parse_requirements() { done # :command.required_args_filter - if [[ -z ${args[project]+x} ]]; then + if [[ -z ${args['project']+x} ]]; then printf "missing required argument: PROJECT\nusage: orcli transform PROJECT [FILE...] [OPTIONS]\n" >&2 exit 1 fi # :command.default_assignments - [[ -n ${args[file]:-} ]] || args[file]="-" + [[ -n ${args['file']:-} ]] || args['file']="-" } @@ -2568,7 +2902,7 @@ orcli_export_tsv_parse_requirements() { # :flag.case_arg if [[ -n ${2+x} ]]; then - args[--output]="$2" + args['--output']="$2" shift shift else @@ -2583,7 +2917,7 @@ orcli_export_tsv_parse_requirements() { # :flag.case_arg if [[ -n ${2+x} ]]; then - args[--encoding]="$2" + args['--encoding']="$2" shift shift else @@ -2596,7 +2930,7 @@ orcli_export_tsv_parse_requirements() { --quiet | -q) # :flag.case_no_arg - args[--quiet]=1 + args['--quiet']=1 shift ;; @@ -2608,9 +2942,9 @@ orcli_export_tsv_parse_requirements() { *) # :command.parse_requirements_case # :command.parse_requirements_case_simple - if [[ -z ${args[project]+x} ]]; then + if [[ -z ${args['project']+x} ]]; then - args[project]=$1 + args['project']=$1 shift else printf "invalid argument: %s\n" "$key" >&2 @@ -2623,13 +2957,13 @@ orcli_export_tsv_parse_requirements() { done # :command.required_args_filter - if [[ -z ${args[project]+x} ]]; then + if [[ -z ${args['project']+x} ]]; then printf "missing required argument: PROJECT\nusage: orcli export tsv PROJECT [OPTIONS]\n" >&2 exit 1 fi # :command.default_assignments - [[ -n ${args[--encoding]:-} ]] || args[--encoding]="UTF-8" + [[ -n ${args['--encoding']:-} ]] || args['--encoding']="UTF-8" } @@ -2664,7 +2998,7 @@ orcli_run_parse_requirements() { # :flag.case_arg if [[ -n ${2+x} ]]; then - args[--memory]="$2" + args['--memory']="$2" shift shift else @@ -2679,7 +3013,7 @@ orcli_run_parse_requirements() { # :flag.case_arg if [[ -n ${2+x} ]]; then - args[--port]="$2" + args['--port']="$2" shift shift else @@ -2692,7 +3026,7 @@ orcli_run_parse_requirements() { --interactive) # :flag.case_no_arg - args[--interactive]=1 + args['--interactive']=1 shift ;; @@ -2700,7 +3034,7 @@ orcli_run_parse_requirements() { --quiet | -q) # :flag.case_no_arg - args[--quiet]=1 + args['--quiet']=1 shift ;; @@ -2712,12 +3046,12 @@ orcli_run_parse_requirements() { *) # :command.parse_requirements_case # :command.parse_requirements_case_repeatable - if [[ -z ${args[file]+x} ]]; then - args[file]="\"$1\"" + if [[ -z ${args['file']+x} ]]; then + args['file']="\"$1\"" shift else - args[file]="${args[file]} \"$1\"" + args['file']="${args[file]} \"$1\"" shift fi @@ -2727,9 +3061,9 @@ orcli_run_parse_requirements() { done # :command.default_assignments - [[ -n ${args[file]:-} ]] || args[file]="-" - [[ -n ${args[--memory]:-} ]] || args[--memory]="2048M" - [[ -n ${args[--port]:-} ]] || args[--port]="3333" + [[ -n ${args['file']:-} ]] || args['file']="-" + [[ -n ${args['--memory']:-} ]] || args['--memory']="2048M" + [[ -n ${args['--port']:-} ]] || args['--port']="3333" } @@ -2756,7 +3090,7 @@ run() { case "$action" in "completions") - if [[ ${args[--help]:-} ]]; then + if [[ ${args['--help']:-} ]]; then long_usage=yes orcli_completions_usage else @@ -2765,7 +3099,7 @@ run() { ;; "delete") - if [[ ${args[--help]:-} ]]; then + if [[ ${args['--help']:-} ]]; then long_usage=yes orcli_delete_usage else @@ -2774,7 +3108,7 @@ run() { ;; "import") - if [[ ${args[--help]:-} ]]; then + if [[ ${args['--help']:-} ]]; then long_usage=yes orcli_import_usage else @@ -2783,7 +3117,7 @@ run() { ;; "import csv") - if [[ ${args[--help]:-} ]]; then + if [[ ${args['--help']:-} ]]; then long_usage=yes orcli_import_csv_usage else @@ -2792,7 +3126,7 @@ run() { ;; "import tsv") - if [[ ${args[--help]:-} ]]; then + if [[ ${args['--help']:-} ]]; then long_usage=yes orcli_import_tsv_usage else @@ -2801,7 +3135,7 @@ run() { ;; "list") - if [[ ${args[--help]:-} ]]; then + if [[ ${args['--help']:-} ]]; then long_usage=yes orcli_list_usage else @@ -2810,7 +3144,7 @@ run() { ;; "info") - if [[ ${args[--help]:-} ]]; then + if [[ ${args['--help']:-} ]]; then long_usage=yes orcli_info_usage else @@ -2819,7 +3153,7 @@ run() { ;; "test") - if [[ ${args[--help]:-} ]]; then + if [[ ${args['--help']:-} ]]; then long_usage=yes orcli_test_usage else @@ -2828,7 +3162,7 @@ run() { ;; "transform") - if [[ ${args[--help]:-} ]]; then + if [[ ${args['--help']:-} ]]; then long_usage=yes orcli_transform_usage else @@ -2837,7 +3171,7 @@ run() { ;; "export") - if [[ ${args[--help]:-} ]]; then + if [[ ${args['--help']:-} ]]; then long_usage=yes orcli_export_usage else @@ -2846,7 +3180,7 @@ run() { ;; "export tsv") - if [[ ${args[--help]:-} ]]; then + if [[ ${args['--help']:-} ]]; then long_usage=yes orcli_export_tsv_usage else @@ -2855,7 +3189,7 @@ run() { ;; "run") - if [[ ${args[--help]:-} ]]; then + if [[ ${args['--help']:-} ]]; then long_usage=yes orcli_run_usage else diff --git a/src/bashly.yml b/src/bashly.yml index 2fbf9b3..206af03 100644 --- a/src/bashly.yml +++ b/src/bashly.yml @@ -73,6 +73,10 @@ commands: - &blankCellsAsStrings long: --blankCellsAsStrings help: store blank cells as empty strings instead of nulls + - &columnNames + long: --columnNames + help: set column names (comma separated) + arg: columnNames - &encoding_import long: --encoding help: set character encoding @@ -124,6 +128,10 @@ commands: long: --projectName arg: projectName help: set a name for the OpenRefine project + - &projectTags + long: --projectTags + help: set project tags (comma separated) + arg: projectTags - *quiet examples: - orcli import csv "file" @@ -142,9 +150,22 @@ commands: args: - *file flags: + - *blankCellsAsStrings + - *columnNames - *encoding_import + - *guessCellValueTypes + - *headerLines + - *ignoreLines + - *ignoreQuoteCharacter + - *includeFileSources + - *includeArchiveFileName + - *limit + - *quoteCharacter + - *skipBlankRows + - *skipDataLines - *trimStrings - *projectName + - *projectTags - *quiet examples: - orcli import tsv "file" diff --git a/src/import_csv_command.sh b/src/import_csv_command.sh index e341644..8e8f37f 100644 --- a/src/import_csv_command.sh +++ b/src/import_csv_command.sh @@ -23,6 +23,11 @@ if [[ ${args[--blankCellsAsStrings]} ]]; then options+=', ' options+='"storeBlankCellsAsNulls": false' fi +if [[ ${args[--columnNames]} ]]; then + IFS=',' read -ra columnNames <<< "${args[--columnNames]}" + options+=', ' + options+="\"columnNames\": [ $(printf ',"'%s'"' "${columnNames[@]}" | cut -c2-) ]" +fi if [[ ${args[--guessCellValueTypes]} ]]; then options+=', ' options+='"guessCellValueTypes": true' @@ -71,6 +76,11 @@ if [[ ${args[--trimStrings]} ]]; then options+=', ' options+='"trimStrings": true' fi +if [[ ${args[--projectTags]} ]]; then + IFS=',' read -ra projectTags <<< "${args[--projectTags]}" + options+=', ' + options+="\"projectTags\": [ $(printf ',"'%s'"' "${projectTags[@]}" | cut -c2-) ]" +fi options+=' }' data+=("options=${options}") diff --git a/src/import_tsv_command.sh b/src/import_tsv_command.sh index 02644bd..439e508 100644 --- a/src/import_tsv_command.sh +++ b/src/import_tsv_command.sh @@ -19,9 +19,65 @@ if [[ ${args[--encoding]} ]]; then options+=', ' options+="\"encoding\": \"${args[--encoding]}\"" fi +if [[ ${args[--blankCellsAsStrings]} ]]; then + options+=', ' + options+='"storeBlankCellsAsNulls": false' +fi +if [[ ${args[--columnNames]} ]]; then + options+=', ' + options+="\"columnNames\": \"[${args[--columnNames]}\"]" +fi +if [[ ${args[--guessCellValueTypes]} ]]; then + options+=', ' + options+='"guessCellValueTypes": true' +fi +if [[ ${args[--headerLines]} ]]; then + options+=', ' + options+="\"headerLines\": ${args[--headerLines]}" +fi +if [[ ${args[--ignoreLines]} ]]; then + options+=', ' + options+="\"ignoreLines\": ${args[--ignoreLines]}" +fi +if [[ ${args[--ignoreQuoteCharacter]} ]]; then + options+=', ' + options+='"processQuotes": false' +fi +if [[ ${args[--includeFileSources]} ]]; then + options+=', ' + options+='includeFileSources: true' +fi +if [[ ${args[--includeArchiveFileName]} ]]; then + options+=', ' + options+='"includeArchiveFileName": true' +fi +if [[ ${args[--limit]} ]]; then + options+=', ' + options+="\"limit\": ${args[--limit]}" +fi +if [[ ${args[--projectName]} ]]; then + options+=', ' + options+="\"projectName\": \"${args[--projectName]}\"" +fi +if [[ ${args[--quoteCharacter]} ]]; then + options+=', ' + options+="\"quoteCharacter\": \"${args[--quoteCharacter]}\"" +fi +if [[ ${args[--skipBlankRows]} ]]; then + options+=', ' + options+='"storeBlankRows": false' +fi +if [[ ${args[--skipDataLines]} ]]; then + options+=', ' + options+="\"skipDataLines\": ${args[--skipDataLines]}" +fi if [[ ${args[--trimStrings]} ]]; then options+=', ' - options+="\"trimStrings\": true" + options+='"trimStrings": true' +fi +if [[ ${args[--projectTags]} ]]; then + options+=', ' + options+="\"projectTags\": \"[${args[--projectTags]}\"]" fi options+=' }' data+=("options=${options}") diff --git a/src/lib/send_completions.sh b/src/lib/send_completions.sh index 473d54b..4ee0d0d 100644 --- a/src/lib/send_completions.sh +++ b/src/lib/send_completions.sh @@ -35,11 +35,11 @@ send_completions() { echo $' ;;' echo $'' echo $' \'import csv\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_orcli_completions_filter "--blankCellsAsStrings --encoding --guessCellValueTypes --headerLines --help --ignoreLines --ignoreQuoteCharacter --includeArchiveFileName --includeFileSources --limit --projectName --quiet --quoteCharacter --separator --skipBlankRows --skipDataLines --trimStrings -h -q")" -- "$cur" )' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_orcli_completions_filter "--blankCellsAsStrings --columnNames --encoding --guessCellValueTypes --headerLines --help --ignoreLines --ignoreQuoteCharacter --includeArchiveFileName --includeFileSources --limit --projectName --projectTags --quiet --quoteCharacter --separator --skipBlankRows --skipDataLines --trimStrings -h -q")" -- "$cur" )' echo $' ;;' echo $'' echo $' \'import tsv\'*)' - echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_orcli_completions_filter "--encoding --help --projectName --quiet --trimStrings -h -q")" -- "$cur" )' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_orcli_completions_filter "--blankCellsAsStrings --columnNames --encoding --guessCellValueTypes --headerLines --help --ignoreLines --ignoreQuoteCharacter --includeArchiveFileName --includeFileSources --limit --projectName --projectTags --quiet --quoteCharacter --skipBlankRows --skipDataLines --trimStrings -h -q")" -- "$cur" )' echo $' ;;' echo $'' echo $' \'export tsv\'*)'