From d9d41f428849258e5e88e520a97de7c34a6c38da Mon Sep 17 00:00:00 2001 From: Bernd Gollesch Date: Sat, 4 Apr 2015 02:38:07 +0200 Subject: [PATCH 1/2] added missing T ;) --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index ec4d0fd6..3270a351 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -50,7 +50,7 @@ v6.14.5 Mar 23 2015 . (kfsone) Solved the missing 6.14.3 commits v6.14.4 Mar 22 2015 -. (gazelle) Bernd's "getsation.sh" script (see scripts/README.txt) +. (gazelle) Bernd's "getstation.sh" script (see scripts/README.txt) . (kfsone) Fixed #209 Exception when you couldn't afford something, . (kfsone) Fixed #210 Exception when --from not reached, . (kfsone) Added "Salvage" Category, From c1842faef276558baa79123ca30bfc540df96067 Mon Sep 17 00:00:00 2001 From: Bernd Gollesch Date: Sat, 4 Apr 2015 02:39:15 +0200 Subject: [PATCH 2/2] adapted to current version (6.17.0) --- scripts/td-completion.bash | 129 +++++++++++++++++++++++++++++++------ 1 file changed, 108 insertions(+), 21 deletions(-) diff --git a/scripts/td-completion.bash b/scripts/td-completion.bash index 79cb4803..3e2e1fe9 100644 --- a/scripts/td-completion.bash +++ b/scripts/td-completion.bash @@ -2,6 +2,8 @@ # see http://kfs.org/td/source common_opts="--help --debug --detail --quiet --db --cwd --link-ly" +pad_opts="? l l? m m? ml ml? s s? sl sm sm? sml sml?" +ynq_opts="y n ?" _td_file_list() { @@ -56,12 +58,16 @@ _td_buy() prev="${COMP_WORDS[COMP_CWORD-1]}" case ${prev} in - --quantity|--near|--ly|--limit) + --quantity|--near|--ly|--limit|--gt|--lt) # argument required ;; + --pad-size|-p) + opts="${pad_opts}" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + ;; *) _td_common && return 0 - opts="--quantity --near --ly --limit --price-sort --stock-sort ${common_opts}" + opts="--quantity --near --ly --limit --pad-size --one-stop --price-sort --stock-sort --gt --lt ${common_opts}" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) ;; esac @@ -105,12 +111,12 @@ _td_import() # argument required ;; --option|-O) - opts="systems stations exportcsv skipdl force use3h use2d usefull" + opts="csvs corrections systems stations shipvendors exportcsv csvonly skipdl force use3h use2d usefull help" COMPREPLY+=( $(compgen -W "${opts}" -- ${cur}) ) ;; *) _td_common && return 0 - opts="--plug --url --download --ignore-unknown --option ${common_opts}" + opts="--plug --url --download --ignore-unknown --option --reset ${common_opts}" _td_file_list -f "$cur" COMPREPLY+=( $(compgen -W "${opts}" -- ${cur}) ) ;; @@ -128,9 +134,29 @@ _td_local() --ly) # argument required ;; + --pad-size|-p) + opts="${pad_opts}" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + ;; + *) + _td_common && return 0 + opts="--ly --pad-size --stations --trading --blackmarket --shipyard --outfitting --rearm --refuel --repair ${common_opts}" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + ;; + esac + return 0 +} + +_td_market() +{ + local cur prev opts + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + + case ${prev} in *) _td_common && return 0 - opts="--ly ${common_opts}" + opts="--buying --selling ${common_opts}" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) ;; esac @@ -144,12 +170,12 @@ _td_nav() prev="${COMP_WORDS[COMP_CWORD-1]}" case ${prev} in - --ly-per|--avoid|--via) + --ly-per|--avoid|--via|--refuel-jumps) # argument required ;; *) _td_common && return 0 - opts="--ly-per --avoid --via --stations ${common_opts}" + opts="--ly-per --avoid --via --stations --refuel-jumps ${common_opts}" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) ;; esac @@ -163,12 +189,12 @@ _td_olddata() prev="${COMP_WORDS[COMP_CWORD-1]}" case ${prev} in - --limit|--near|--ly) + --limit|--near|--ly|--min-age) # argument required ;; *) _td_common && return 0 - opts="--limit --near --ly ${common_opts}" + opts="--limit --near --ly --route --min-age ${common_opts}" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) ;; esac @@ -182,12 +208,16 @@ _td_rares() prev="${COMP_WORDS[COMP_CWORD-1]}" case ${prev} in - --ly|--limit) + --ly|--limit|--away|--from) # argument required ;; + --pad-size|-p) + opts="${pad_opts}" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + ;; *) _td_common && return 0 - opts="--ly --limit --price-sort --reverse ${common_opts}" + opts="--ly --limit --price-sort --reverse --pad-size --away --from ${common_opts}" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) ;; esac @@ -201,12 +231,16 @@ _td_run() prev="${COMP_WORDS[COMP_CWORD-1]}" case ${prev} in - --capacity|--credits|--ly-per|--from|--to|--via|--avoid|--hops|--jumps-per|--empty-ly|--start-jumps|-s|--end-jumps|-e|--limit|--max-days-old|-MD|--ls-penalty|--lsp|--margin|--insurance|--routes) + --capacity|--credits|--ly-per|--from|-f|--to|-t|--via|--avoid|--hops|--jumps-per|--empty-ly|--start-jumps|-s|--end-jumps|-e|--limit|--age|--max-days-old|-MD|--ls-penalty|--lsp|--margin|--insurance|--routes|--towards|-T|--ls-max|--gain-per-ton|--gpt|--max-gain-per-ton|--mgpt|--max-routes|--prune-score|--prune-hops) # argument required ;; + --pad-size|-p) + opts="${pad_opts}" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + ;; *) _td_common && return 0 - opts="--capacity --credits --ly-per --from --to --via --avoid --hops --jumps-per --empty-ly --start-jumps --end-jumps --limit --max-days-old --ls-penalty --unique --margin --insurance --routes --checklist --x52-pro ${common_opts}" + opts="--capacity --credits --ly-per --from --to --via --avoid --hops --jumps-per --empty-ly --start-jumps --end-jumps --limit --age --max-days-old --ls-penalty --unique --margin --insurance --routes --checklist --x52-pro --towards --loop --direct --pad-size --black-market --ls-max --gain-per-ton --gpt --max-gain-per-ton --mgpt --max-routes --prune-score --prune-hops --progress ${common_opts}" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) ;; esac @@ -220,12 +254,32 @@ _td_sell() prev="${COMP_WORDS[COMP_CWORD-1]}" case ${prev} in - --near|--ly-per|--limit) + --near|--ly-per|--limit|--gt|--lt) # argument required ;; + --pad-size|-p) + opts="${pad_opts}" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + ;; + *) + _td_common && return 0 + opts="--near --ly-per --limit --price-sort --pad-size --gt --lt ${common_opts}" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + ;; + esac + return 0 +} + +_td_shipvendor() +{ + local cur prev opts + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + + case ${prev} in *) _td_common && return 0 - opts="--near --ly-per --limit --price-sort ${common_opts}" + opts="--remove --add --name-sort --no-export ${common_opts}" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) ;; esac @@ -239,12 +293,36 @@ _td_station() prev="${COMP_WORDS[COMP_CWORD-1]}" case ${prev} in - --system|--ls-from-star|--black-market|--pad-size|--confirm) + --ls-from-star|--confirm) # argument required ;; + --black-market|--bm|--market|--shipyard|--outfitting|--rearm|--arm|--refuel|--repair) + opts="${ynq_opts}" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + ;; + --pad-size) + opts="${pad_opts}" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + ;; + *) + _td_common && return 0 + opts="--ls-from-star --black-market --market --shipyard --pad-size --outfitting --rearm --refuel --repair --confirm --add --remove --update --no-export ${common_opts}" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + ;; + esac + return 0 +} + +_td_trade() +{ + local cur prev opts + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + + case ${prev} in *) _td_common && return 0 - opts="--system --ls-from-star --black-market --pad-size --confirm --add --remove --update --no-export ${common_opts}" + opts="${common_opts}" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) ;; esac @@ -293,6 +371,9 @@ _td_main() local) _td_local ;; + market) + _td_market + ;; nav) _td_nav ;; @@ -308,14 +389,20 @@ _td_main() sell) _td_sell ;; - station) - _td_station - ;; + shipvendor) + _td_shipvendor + ;; + station) + _td_station + ;; + trade) + _td_trade + ;; update) _td_update ;; *) - opts="buildcache buy export import local nav olddata rares run sell station update" + opts="buildcache buy export import local market nav olddata rares run sell shipvendor station trade update" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) esac return 0