Package: cmdu
Installationpipinstall-Ucmdubuildpipinstall-rrequirements.txt
rm-rfdist
python-mbuild
python-mtwineuploaddist/*-u__token__-p{token}Commands|-- cmdu
|   |-- file-mod
|   |   |-- hosts
|   |   |   |-- add
|   |   |   |-- delete
|   |   |   |-- delete-all
|   |
|   |-- check-list
|   |   |-- create
|   |   |-- check
|   |   |-- uncheck
|   |
|   |-- lnes
|   |   |-- set-nu
|   |   |-- count
|   |   |-- trim
|   |   |-- split
|   |   |-- skip
|   |   |-- filter
|   |   |-- filter-not
|   |
|   |-- convert
|   |   |-- j2j
|   |   |-- j2y
|   |   |-- y2j
|   |file-mod hosts addadd a host to specific ip# input127.0.0.1abc.com

python-mcmdufile-modhostsadd-ip127.0.0.1-hostabcx.com# output127.0.0.1abc.comabcx.comfile-mod hosts deletedelete a host from specific ip# input127.0.0.1abc.comabcx.com

python-mcmdufile-modhostsdelete-ip127.0.0.1-hostabcx.com# output127.0.0.1abc.comfile-mod hosts delete-alldelete all hosts from specific ip# input127.0.0.1abc.com127.0.0.2abcx.com

python-mcmdufile-modhostsdelete-all-ip127.0.0.2# output127.0.0.2abcx.comcheck-list createcreate line by line record to check list# inputline1line2line3python-mcmducheck-listcreate# output[]000001|line1[]000002|line2[]000003|line3check-list loadload check list from different format (simple, json, yaml) into other format (simple, json, yaml)# input[]000001|line1[x]000002|line2[X]000003|line3python-mcmducheck-list--simple-in--yaml-out# out-checked:falseid:'000001'line:item1-checked:trueid:'000002'line:item2-checked:trueid:'000003'line:item3check-lst checkcheck the item by number# input[]000001|line1[]000002|line2[]000003|line3python-mcmducheck-listcheck23# out[]000001|line1[X]000002|line2[X]000003|line3check-lst uncheckuncheck the item by number# input[]000001|line1[x]000002|line2[X]000003|line3python-mcmducheck-listcheck123# out[]000001|line1[]000002|line2[]000003|line3lines set-nuset line number to each line, pad000000 |to the leftpython -m cmdu lines set-nu# input
line 1
line 2

# output
000001 |line 1
000002 |line 2lines countCount the number of linespython -m cmdu lines count# input
line 1
line 2

# output
2lines trimTrim the line by delimiterTrim right# inputxline1x
bline2b
xline3x

python-mcmdulinestrim--right-cx# outputxline1bline2b
xline3Trim left# inputxline1x
bline2b
xline3x

python-mcmdulinestrim--left-cx# outputline1x
bline2b
line3xTrim both side# inputxline1x
bline2b
xline3x

python-mcmdulinestrim--both-cx# outputline1bline2b
line3lines splitSplit the line by delimiter# inputa,b,c

python-mcmdulinessplit--d","# outputa
b
clines skipSkip the first n linespython -m cmdu lines skip 2# input
line 1
line 2
line 3

# output
line 3lines filterFilter any match linefilter by regex, any matching in regex will make the whole line accepted# inputline1line2line3python-mcmdufilter--regex"^line 1$"# outputline1lines filter notFilter any not match linefilter by regex, any matching in regex will make the whole line rejected# inputline1line2line3python-mcmdufilter-not--regex"^line 1$"# outputline2line3convert j2jconvert a json input (from stdin) as json output (to stdout)with raw json(no indentation and new line)python -m cmdu json2json# input{"a":1,"b":2}python-mcmdujson2json# output{"a":1,"b":2}with pretty formatpython -m cmdu json2json --pretty# input{"a":1,"b":2}python-mcmdujson2json--pretty# output{"a":1,"b":2}with pretty format and indentation as 2python -m cmdu json2json --pretty --indent 2# input{"a":1,"b":2}python-mcmdujson2json--pretty--indent2# output{"a":1,"b":2}convert j2yconvert a json input (from stdin) as yaml output (to stdout)with json as yaml# input{"a":1,"b":2}python-mcmduj2y# outputa:1b:2convert y2jconvert a yaml input (from stdin) as json output (to stdout)with raw json# inputa:1b:2python-mcmduy2j# output{"a":1,"b":2}with pretty formatpython -m cmdu yaml2json --pretty# inputa:1b:2python-mcmduyaml2json--pretty# output{"a":1,"b":2}with pretty format and indentation as 2python -m cmdu yaml2json --pretty --indent 2# inputa:1b:2python-mcmduyaml2json--pretty--indent2# output{"a":1,"b":2}