-
- Added
extract
command - Added
getall
command - Updated Picocli version to 3.9.5
- Updated JUnit 5.4
- Fixed issue with exception generated on host
- Added
-
1.7.x
- Updated Picocli version to 3.9.2
- Use of
net.jodah:failsafe
-
1.5.x
- Updates on documentation
- Updates in some commands
CLI application to communicate with host.
Global parameters:
KDHOST_HOST
- host name/adres and port in formathost:port
. Default value:127.0.0.1:19200
KDHOST_USER
- user used to login to host, default value: "1"KDHOST_PASS
- password for login to host. default "xxx".
Example:
java -DKDHOST_HOST=127.0.0.1:11111 -jar kdhost.jar list procedure
Aliases can make this much better:
alias p761env="java -DKDHOST_HOST=127.0.0.1:11111 -jar kdhost.jar"
alias pipenv="java -DKDHOST_HOST=127.0.0.1:61012 -jar kdhost.jar"
# and then
pipenv list procedure
p761env get MRPC029.PROC
Requirements:
- Java (JRE) 11+
- Network connection to host (PIPv0.2+), but P7.5+ is recomended.
Host version | compile | drop | fwkinfo | get | install | list | mrpc | send | sql | refresh | test | tsc | watch |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PIP v0.2 | ❌ | ❌ | ❌ | ✔ | ❌ | ❌ | ✔ | ✔ | ✔ | ❌ | ❌ | ❌ | |
P7.5.3 | ✔ | ❌ | ✔ | ✔ 💪 | ❌ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
P7.6.1 | ✔ ️ | ✔ | ✔ | ✔ 💪 | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
P7.6.2 | ✔ ️ | ✔ ️ | ✔ | ✔ 💪 | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
- ✔️ - supported
⁉️ - not all options are supported, check command section for details.- ❌ - not supported
- ❓ - not tested
- 💪 - xxxall version of the command is supported to.
-v LEVEL
This option changes verbosity of output. The levels in descending order are:- SEVERE (highest value)
- WARNING (default value)
- INFO
- CONFIG
- FINE
- FINER
- FINEST (lowest value)
- ALL - will display ALL messages
-h, --help
Show help/usage information and quit program.-V, --version
Print versin information
will compile in host elements with given names (name should include extension).
Will drop/remove element form host. Supported from P761.
Gets information about PSL/Fwk from Host. Supported requests: classes, keywords,functions,featuers Available options:
--all
Will list all elements that can be listed
This command can be used to get specific elements from host. It takes list of elements to download as space separated list (name should include extension).
Available options:
--force
Override file if it exist localy
kdhost get MRPC121.PROC && cat dataqwik/procedure/MRPC121.PROC
Command will download all elements of specific type. TYou need to specify element type (types) you would like to download.
Available options:
--force
Override file if it exist localy
This is special version of getall
command. It will get all posible elements from host for all types. This is not possible
for all elements.
kdhost getall procedure
- will download all procedure files from hostkdhost getall --all
- will make environment extractkdhost getall -t DEP
- will download TBL and COL elementskdhost getall -f DEP
- will download TBL, COL, IDX, JFD, TRG and RegordTABLE.psl
This command expects valid path to unpacked SP or FP. It will read content of it and use online services to 'instal' elements.
⚠ This is command just simulates instalation with bulk send and compile command in proper order. But keep in mind that some actions like index regeneration, screen, report compilation are still missing. Some elements like big filers will not compile due to time outs. Use this command just for simple FP/SP that don't have complicated elements and compilation will be fast.
List elements from host.
Available options:
--list-listable
Provide list of element types that can be listed--list-types
Provide list of all supported element types-n, --as-names
Print element names instead element file names. Skips extensions.-t, --from-table=<table>
Get subelement for specific table.--all
Will list all elements that can be listed
kdhost list procedure
will list all procedures from host, one per line.
kdhost list triggers -t DEP
Will list triggers for DEP table.
This command can be used to call any MRPC from host. User his class should have authorization to call this MRPC.
Available options:
-r N
Repeat callN
times.-mv,--mrpc-version
MRPC version to use, default: "1"-dp, --describe-parameters
- Get list of MRPC parameters, Not supported in PIP.
Parameters:
MRPCID
- MRPCID, as defined on host. This is expected as first parameter.PARAMETERS
- MRPC parameters, excluding version. From second parameter.
kdhost mrpc 121 INITOBJ "" "" "" Procedure MRPC121
Can send element(s) to host. Will take element form path and send it to host. '*' can be used to send multiple elements from on folder. This command is not recursive.
Will execute SQL query on host. No validation and checks are made. Available options:
-s, --separator
Separator that is used in column separation, default value =|
kdhost sql "select fid,des from dbtbl1" -s=" | "
Will redownload elements existing in local direcories.
kdhost refresh dataqwik/pocedure
- Will rrefresh all procedures that are on local drive. Will not download new ones from host
Will test compile element on host.
Will execute following commands in chain: test
send
compile
. Error from any of them will stop further execution.
Will start watching specific directory and execute tsc
or drop
command on changes. This command is recursive.
-
Download elements with specific patern in name:
kdhost get -v ALL $(kdhost list procedure | grep ^DE | awk '{print}' ORS=' ')
- will get all procedures which name starts withDE
(^DE).kdhost get -v ALL $(kdhost sql "select FID from DBTBL1" | awk '{print}' ORS='.DAT ' )
- will download all TABELS (without BLOB/CLOB/Memo) columns form host - data extract. Using of this is not a good idea.
-
Display content of any file in env.
kdhost mrpc 121 RETOBJ ../errorlog/2020202020202020.log
- Will display error log file on screen. This can be redirected to file. Just remember to skip "RESPONSE: " string from begining. This will remove file after this command finishes. Be awared.
Installation
- Source all completion scripts in your .bash_profile
cd $YOUR_APP_HOME/bin
for f in $(find . -name "*_completion"); do line=". $(pwd)/$f"; grep "$line" ~/.bash_profile || echo "$line" >> ~/.bash_profile; done
Alternatively, if you have bash-completion installed:
Place this file in a bash-completion.d
folder:
- /etc/bash-completion.d
- /usr/local/etc/bash-completion.d
- ~/bash-completion.d
- Open a new bash console, and type
kdhost [TAB][TAB]
All exmples made with PIP v0.2 - If you are reading this - then you know what it is.