mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 04:54:18 +02:00
add command tree
This commit is contained in:
62
README.md
62
README.md
@@ -6,30 +6,46 @@ Elasticsearch CLI
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
Command tree
|
||||||
|
|
||||||
```console
|
```console
|
||||||
NAME:
|
ccr
|
||||||
esctl - manage elasticsearch from cli
|
follower
|
||||||
|
add
|
||||||
USAGE:
|
delete
|
||||||
esctl [global options] [command [command options]]
|
pause
|
||||||
|
renew
|
||||||
VERSION:
|
resume
|
||||||
v0.0.4
|
show
|
||||||
|
unfollow
|
||||||
COMMANDS:
|
info
|
||||||
search, / search within an index
|
pause
|
||||||
index, i manage indicies
|
resume
|
||||||
snapshot, snap manage snapshots
|
status
|
||||||
cluster, c manage cluster[s]
|
cluster
|
||||||
node, snap manage nodes
|
list
|
||||||
help, h Shows a list of commands or help for one command
|
settings
|
||||||
|
list
|
||||||
GLOBAL OPTIONS:
|
set
|
||||||
--debug, -d enable debugging [$ES_DEBUG]
|
status
|
||||||
--config string, -c string config file [$ES_CONFIG]
|
doc
|
||||||
--cluster string, -C string cluster alias to work with
|
add
|
||||||
--help, -h show help
|
help
|
||||||
--version, -v print the version
|
index
|
||||||
|
allocation
|
||||||
|
close
|
||||||
|
create
|
||||||
|
delete
|
||||||
|
list
|
||||||
|
show
|
||||||
|
node
|
||||||
|
list
|
||||||
|
show
|
||||||
|
repl
|
||||||
|
search
|
||||||
|
snapshot
|
||||||
|
list
|
||||||
|
show
|
||||||
```
|
```
|
||||||
|
|
||||||
Configure `esctl` with environment variables:
|
Configure `esctl` with environment variables:
|
||||||
|
|||||||
31
commandtree.sh
Executable file
31
commandtree.sh
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
getcommands() {
|
||||||
|
local command
|
||||||
|
command="$*"
|
||||||
|
|
||||||
|
if ! test "$command" = "help"; then
|
||||||
|
./esctl $command -h | sed -e '/^COMMANDS:/,/^$/!d;//d' -e 's/^ //' -e 's/[, ].*//' | sort
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
printcommands() {
|
||||||
|
local indent basecommand commands command
|
||||||
|
indent="$1"
|
||||||
|
basecommand="$2"
|
||||||
|
commands="$3"
|
||||||
|
|
||||||
|
for command in $commands; do
|
||||||
|
echo "$indent" "$command"
|
||||||
|
|
||||||
|
commands=$(getcommands $basecommand $command)
|
||||||
|
|
||||||
|
if test -n "$commands"; then
|
||||||
|
printcommands "${indent} " "$basecommand $command" "$commands"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
commands=$(getcommands "")
|
||||||
|
printcommands "" "" "$commands"
|
||||||
Reference in New Issue
Block a user