From 6d7465c395c2678a4544f5f4c23ec26c5122abe5 Mon Sep 17 00:00:00 2001 From: johnerikhalse Date: Tue, 5 Sep 2023 10:39:10 +0200 Subject: [PATCH] Updated documentation --- docs/generate.go | 5 +- docs/veidemannctl.md | 3 +- docs/veidemannctl_abort.md | 2 +- docs/veidemannctl_abortjobexecution.md | 2 +- docs/veidemannctl_completion.md | 37 ++++++++++++++ docs/veidemannctl_completion_bash.md | 56 +++++++++++++++++++++ docs/veidemannctl_completion_fish.md | 47 ++++++++++++++++++ docs/veidemannctl_completion_powershell.md | 44 ++++++++++++++++ docs/veidemannctl_completion_zsh.md | 58 ++++++++++++++++++++++ docs/veidemannctl_delete.md | 4 +- docs/veidemannctl_get.md | 2 +- docs/veidemannctl_update.md | 2 +- 12 files changed, 254 insertions(+), 8 deletions(-) create mode 100644 docs/veidemannctl_completion.md create mode 100644 docs/veidemannctl_completion_bash.md create mode 100644 docs/veidemannctl_completion_fish.md create mode 100644 docs/veidemannctl_completion_powershell.md create mode 100644 docs/veidemannctl_completion_zsh.md diff --git a/docs/generate.go b/docs/generate.go index 6b20b31..1210d14 100644 --- a/docs/generate.go +++ b/docs/generate.go @@ -31,7 +31,10 @@ func main() { var _, b, _, _ = runtime.Caller(0) var dir = filepath.Dir(b) fmt.Println("Generating documentation...") - err := doc.GenMarkdownTree(cmd.NewRootCmd(), dir) + c := cmd.NewRootCmd() + c.InitDefaultCompletionCmd() + c.InitDefaultVersionFlag() + err := doc.GenMarkdownTree(c, dir) if err != nil { _, _ = fmt.Fprintln(os.Stderr, err) os.Exit(1) diff --git a/docs/veidemannctl.md b/docs/veidemannctl.md index 61b6c0c..5c505ef 100644 --- a/docs/veidemannctl.md +++ b/docs/veidemannctl.md @@ -18,6 +18,7 @@ veidemannctl controls the Veidemann web crawler --log-level string set log level, available levels are "panic", "fatal", "error", "warn", "info", "debug" and "trace" (default "info") --server string The address of the Veidemann server to use --server-name-override string If set, it will override the virtual host name of authority (e.g. :authority header field) in requests + -v, --version version for veidemannctl ``` ### SEE ALSO @@ -25,6 +26,7 @@ veidemannctl controls the Veidemann web crawler * [veidemannctl abort](veidemannctl_abort.md) - Abort crawl executions * [veidemannctl abortjobexecution](veidemannctl_abortjobexecution.md) - Abort job executions * [veidemannctl activeroles](veidemannctl_activeroles.md) - Get the active roles for the currently logged in user +* [veidemannctl completion](veidemannctl_completion.md) - Generate the autocompletion script for the specified shell * [veidemannctl config](veidemannctl_config.md) - Modify or view configuration files * [veidemannctl create](veidemannctl_create.md) - Create or update config objects * [veidemannctl delete](veidemannctl_delete.md) - Delete config objects @@ -40,5 +42,4 @@ veidemannctl controls the Veidemann web crawler * [veidemannctl status](veidemannctl_status.md) - Display crawler status * [veidemannctl unpause](veidemannctl_unpause.md) - Request crawler to unpause * [veidemannctl update](veidemannctl_update.md) - Update fields of config objects of the same kind -* [veidemannctl version](veidemannctl_version.md) - Print the client version information diff --git a/docs/veidemannctl_abort.md b/docs/veidemannctl_abort.md index 9c81ddb..5e2987f 100644 --- a/docs/veidemannctl_abort.md +++ b/docs/veidemannctl_abort.md @@ -4,7 +4,7 @@ Abort crawl executions ### Synopsis -Abort one or many crawl executions. +Abort one or more crawl executions. ``` veidemannctl abort CRAWL-EXECUTION-ID ... [flags] diff --git a/docs/veidemannctl_abortjobexecution.md b/docs/veidemannctl_abortjobexecution.md index 52dea7a..b92d8c5 100644 --- a/docs/veidemannctl_abortjobexecution.md +++ b/docs/veidemannctl_abortjobexecution.md @@ -4,7 +4,7 @@ Abort job executions ### Synopsis -Abort one or many job executions. +Abort one or more job executions. ``` veidemannctl abortjobexecution JOB-EXECUTION-ID ... [flags] diff --git a/docs/veidemannctl_completion.md b/docs/veidemannctl_completion.md new file mode 100644 index 0000000..532acf0 --- /dev/null +++ b/docs/veidemannctl_completion.md @@ -0,0 +1,37 @@ +## veidemannctl completion + +Generate the autocompletion script for the specified shell + +### Synopsis + +Generate the autocompletion script for veidemannctl for the specified shell. +See each sub-command's help for details on how to use the generated script. + + +### Options + +``` + -h, --help help for completion +``` + +### Options inherited from parent commands + +``` + --api-key string If set, it will be used as the bearer token for authentication + --config string Path to the config file to use (By default configuration file is stored under $HOME/.veidemann/contexts/ + --context string The name of the context to use + --log-caller include information about caller in log output + --log-format string set log format, available formats are: "pretty" or "json" (default "pretty") + --log-level string set log level, available levels are "panic", "fatal", "error", "warn", "info", "debug" and "trace" (default "info") + --server string The address of the Veidemann server to use + --server-name-override string If set, it will override the virtual host name of authority (e.g. :authority header field) in requests +``` + +### SEE ALSO + +* [veidemannctl](veidemannctl.md) - veidemannctl controls the Veidemann web crawler +* [veidemannctl completion bash](veidemannctl_completion_bash.md) - Generate the autocompletion script for bash +* [veidemannctl completion fish](veidemannctl_completion_fish.md) - Generate the autocompletion script for fish +* [veidemannctl completion powershell](veidemannctl_completion_powershell.md) - Generate the autocompletion script for powershell +* [veidemannctl completion zsh](veidemannctl_completion_zsh.md) - Generate the autocompletion script for zsh + diff --git a/docs/veidemannctl_completion_bash.md b/docs/veidemannctl_completion_bash.md new file mode 100644 index 0000000..fb3d5cf --- /dev/null +++ b/docs/veidemannctl_completion_bash.md @@ -0,0 +1,56 @@ +## veidemannctl completion bash + +Generate the autocompletion script for bash + +### Synopsis + +Generate the autocompletion script for the bash shell. + +This script depends on the 'bash-completion' package. +If it is not installed already, you can install it via your OS's package manager. + +To load completions in your current shell session: + + source <(veidemannctl completion bash) + +To load completions for every new session, execute once: + +#### Linux: + + veidemannctl completion bash > /etc/bash_completion.d/veidemannctl + +#### macOS: + + veidemannctl completion bash > $(brew --prefix)/etc/bash_completion.d/veidemannctl + +You will need to start a new shell for this setup to take effect. + + +``` +veidemannctl completion bash +``` + +### Options + +``` + -h, --help help for bash + --no-descriptions disable completion descriptions +``` + +### Options inherited from parent commands + +``` + --api-key string If set, it will be used as the bearer token for authentication + --config string Path to the config file to use (By default configuration file is stored under $HOME/.veidemann/contexts/ + --context string The name of the context to use + --log-caller include information about caller in log output + --log-format string set log format, available formats are: "pretty" or "json" (default "pretty") + --log-level string set log level, available levels are "panic", "fatal", "error", "warn", "info", "debug" and "trace" (default "info") + --server string The address of the Veidemann server to use + --server-name-override string If set, it will override the virtual host name of authority (e.g. :authority header field) in requests +``` + +### SEE ALSO + +* [veidemannctl completion](veidemannctl_completion.md) - Generate the autocompletion script for the specified shell + diff --git a/docs/veidemannctl_completion_fish.md b/docs/veidemannctl_completion_fish.md new file mode 100644 index 0000000..cad935a --- /dev/null +++ b/docs/veidemannctl_completion_fish.md @@ -0,0 +1,47 @@ +## veidemannctl completion fish + +Generate the autocompletion script for fish + +### Synopsis + +Generate the autocompletion script for the fish shell. + +To load completions in your current shell session: + + veidemannctl completion fish | source + +To load completions for every new session, execute once: + + veidemannctl completion fish > ~/.config/fish/completions/veidemannctl.fish + +You will need to start a new shell for this setup to take effect. + + +``` +veidemannctl completion fish [flags] +``` + +### Options + +``` + -h, --help help for fish + --no-descriptions disable completion descriptions +``` + +### Options inherited from parent commands + +``` + --api-key string If set, it will be used as the bearer token for authentication + --config string Path to the config file to use (By default configuration file is stored under $HOME/.veidemann/contexts/ + --context string The name of the context to use + --log-caller include information about caller in log output + --log-format string set log format, available formats are: "pretty" or "json" (default "pretty") + --log-level string set log level, available levels are "panic", "fatal", "error", "warn", "info", "debug" and "trace" (default "info") + --server string The address of the Veidemann server to use + --server-name-override string If set, it will override the virtual host name of authority (e.g. :authority header field) in requests +``` + +### SEE ALSO + +* [veidemannctl completion](veidemannctl_completion.md) - Generate the autocompletion script for the specified shell + diff --git a/docs/veidemannctl_completion_powershell.md b/docs/veidemannctl_completion_powershell.md new file mode 100644 index 0000000..6b64251 --- /dev/null +++ b/docs/veidemannctl_completion_powershell.md @@ -0,0 +1,44 @@ +## veidemannctl completion powershell + +Generate the autocompletion script for powershell + +### Synopsis + +Generate the autocompletion script for powershell. + +To load completions in your current shell session: + + veidemannctl completion powershell | Out-String | Invoke-Expression + +To load completions for every new session, add the output of the above command +to your powershell profile. + + +``` +veidemannctl completion powershell [flags] +``` + +### Options + +``` + -h, --help help for powershell + --no-descriptions disable completion descriptions +``` + +### Options inherited from parent commands + +``` + --api-key string If set, it will be used as the bearer token for authentication + --config string Path to the config file to use (By default configuration file is stored under $HOME/.veidemann/contexts/ + --context string The name of the context to use + --log-caller include information about caller in log output + --log-format string set log format, available formats are: "pretty" or "json" (default "pretty") + --log-level string set log level, available levels are "panic", "fatal", "error", "warn", "info", "debug" and "trace" (default "info") + --server string The address of the Veidemann server to use + --server-name-override string If set, it will override the virtual host name of authority (e.g. :authority header field) in requests +``` + +### SEE ALSO + +* [veidemannctl completion](veidemannctl_completion.md) - Generate the autocompletion script for the specified shell + diff --git a/docs/veidemannctl_completion_zsh.md b/docs/veidemannctl_completion_zsh.md new file mode 100644 index 0000000..e30fe87 --- /dev/null +++ b/docs/veidemannctl_completion_zsh.md @@ -0,0 +1,58 @@ +## veidemannctl completion zsh + +Generate the autocompletion script for zsh + +### Synopsis + +Generate the autocompletion script for the zsh shell. + +If shell completion is not already enabled in your environment you will need +to enable it. You can execute the following once: + + echo "autoload -U compinit; compinit" >> ~/.zshrc + +To load completions in your current shell session: + + source <(veidemannctl completion zsh) + +To load completions for every new session, execute once: + +#### Linux: + + veidemannctl completion zsh > "${fpath[1]}/_veidemannctl" + +#### macOS: + + veidemannctl completion zsh > $(brew --prefix)/share/zsh/site-functions/_veidemannctl + +You will need to start a new shell for this setup to take effect. + + +``` +veidemannctl completion zsh [flags] +``` + +### Options + +``` + -h, --help help for zsh + --no-descriptions disable completion descriptions +``` + +### Options inherited from parent commands + +``` + --api-key string If set, it will be used as the bearer token for authentication + --config string Path to the config file to use (By default configuration file is stored under $HOME/.veidemann/contexts/ + --context string The name of the context to use + --log-caller include information about caller in log output + --log-format string set log format, available formats are: "pretty" or "json" (default "pretty") + --log-level string set log level, available levels are "panic", "fatal", "error", "warn", "info", "debug" and "trace" (default "info") + --server string The address of the Veidemann server to use + --server-name-override string If set, it will override the virtual host name of authority (e.g. :authority header field) in requests +``` + +### SEE ALSO + +* [veidemannctl completion](veidemannctl_completion.md) - Generate the autocompletion script for the specified shell + diff --git a/docs/veidemannctl_delete.md b/docs/veidemannctl_delete.md index a4dc20c..d5798f7 100644 --- a/docs/veidemannctl_delete.md +++ b/docs/veidemannctl_delete.md @@ -23,7 +23,7 @@ Examples: veidemannctl delete seed 407a9600-4f25-4f17-8cff-ee1b8ee950f6 ``` -veidemannctl delete KIND (ID ...) [flags] +veidemannctl delete KIND ID ... [flags] ``` ### Options @@ -32,7 +32,7 @@ veidemannctl delete KIND (ID ...) [flags] --dry-run Set to false to execute delete (default true) -q, --filter stringArray Delete objects by field (i.e. meta.description=foo) -h, --help help for delete - -l, --label string Delete objects by label (: | ) + -l, --label string Delete objects by label {TYPE:VALUE | VALUE} ``` ### Options inherited from parent commands diff --git a/docs/veidemannctl_get.md b/docs/veidemannctl_get.md index 018b5ef..950406d 100644 --- a/docs/veidemannctl_get.md +++ b/docs/veidemannctl_get.md @@ -36,7 +36,7 @@ veidemannctl get KIND [ID ...] [flags] -f, --filename string Filename to write to -q, --filter stringArray Filter objects by field (i.e. meta.description=foo) -h, --help help for get - -l, --label string List objects by label (: | ) + -l, --label string List objects by label {TYPE:VALUE | VALUE} -n, --name string List objects by name (accepts regular expressions) -o, --output string Output format (table|wide|json|yaml|template|template-file) (default "table") -p, --page int32 The page number diff --git a/docs/veidemannctl_update.md b/docs/veidemannctl_update.md index 05aafc9..bb983ff 100644 --- a/docs/veidemannctl_update.md +++ b/docs/veidemannctl_update.md @@ -25,7 +25,7 @@ veidemannctl update seed -n "https://www.gwpda.org/" -u seed.jobRef=crawlJob:e46 ``` -q, --filter stringArray Filter objects by field (i.e. meta.description=foo) -h, --help help for update - -l, --label string Filter objects by label (: | ) + -l, --label string Filter objects by label {TYPE:VALUE | VALUE} -s, --limit int32 Limit the number of objects to update. 0 = no limit -n, --name string Filter objects by name (accepts regular expressions) -u, --update-field string Which field to update (i.e. meta.description=foo)