From 21d3fe77d44caf1deb92605aabe469b54b3248e1 Mon Sep 17 00:00:00 2001 From: jruaux Date: Thu, 8 Jul 2021 01:11:13 +0200 Subject: [PATCH] Added usage help details to documentation --- .../main/java/com/redislabs/riot/RiotApp.java | 2 +- docs/guide/guide.gradle | 13 ------ .../src/docs/asciidoc/getting-started.adoc | 44 +++++++++++++------ docs/guide/src/docs/asciidoc/index.adoc | 14 +++--- 4 files changed, 40 insertions(+), 33 deletions(-) diff --git a/core/riot-core/src/main/java/com/redislabs/riot/RiotApp.java b/core/riot-core/src/main/java/com/redislabs/riot/RiotApp.java index dee6580e2..73e5ac9b2 100644 --- a/core/riot-core/src/main/java/com/redislabs/riot/RiotApp.java +++ b/core/riot-core/src/main/java/com/redislabs/riot/RiotApp.java @@ -38,7 +38,7 @@ public class RiotApp extends HelpCommand { private boolean info; @Option(names = {"-d", "--debug"}, description = "Log in debug mode (includes normal stacktrace).") private boolean debug; - @Option(names = "--stacktrace", description = "Print out the stacktrace for all exceptions..") + @Option(names = "--stacktrace", description = "Print out the stacktrace for all exceptions.") private boolean stacktrace; private int executionStrategy(ParseResult parseResult) { diff --git a/docs/guide/guide.gradle b/docs/guide/guide.gradle index 4af7a0455..033b3cce5 100644 --- a/docs/guide/guide.gradle +++ b/docs/guide/guide.gradle @@ -1,17 +1,4 @@ -configurations { - asciidoctorExtensions -} - -dependencies { - asciidoctorExtensions 'com.bmuschko:asciidoctorj-tabbed-code-extension:0.3' -} - -guide { - groovydocApiDir = 'api' -} - asciidoctor { - configurations 'asciidoctorExtensions' attributes = [ 'source-highlighter': 'prettify' ] diff --git a/docs/guide/src/docs/asciidoc/getting-started.adoc b/docs/guide/src/docs/asciidoc/getting-started.adoc index 91753bb7f..1b81bd5d2 100644 --- a/docs/guide/src/docs/asciidoc/getting-started.adoc +++ b/docs/guide/src/docs/asciidoc/getting-started.adoc @@ -36,13 +36,42 @@ cd riot/bin == Usage -To display usage help run the following command: +To display usage help, run the following command: -[subs="attributes,+quotes"] +[subs="specialcharacters,attributes,+quotes",source,bash] .... [green]#{connector}# --help +Usage: **{connector}** [OPTIONS] [COMMAND] + [olive]#-H#, [olive]#--help# Show this help message and exit + [olive]#-V#, [olive]#--version# Print version information and exit. + [olive]#-q#, [olive]#--quiet# Log errors only. + [olive]#-w#, [olive]#--warn# Set log level to warn. + [olive]#-i#, [olive]#--info# Set log level to info. + [olive]#-d#, [olive]#--debug# Log in debug mode (includes normal stacktrace). + [olive]#--stacktrace# Print out the stacktrace for all exceptions. +Redis connection options + [olive]#-h#, [olive]#--hostname#= Server hostname (default: localhost). + [olive]#-p#, [olive]#--port#= Server port (default: 6379). + [olive]#-s#, [olive]#--socket#= Server socket (overrides hostname and port). + [olive]#--user#= Used to send ACL style 'AUTH username pass'. Needs password. + [olive]#-a#, [olive]#--pass#[=] Password to use when connecting to the server. + [olive]#-u#, [olive]#--uri#=... Server URI. + --timeout= Redis command timeout (default: 60). + [olive]#-n#, [olive]#--db#= Database number (default: 0). + [olive]#-c#, [olive]#--cluster# Enable cluster mode. + [olive]#--tls# Establish a secure TLS connection. + [olive]#--[no-]verify-peer# Verify peers when using TLS. True by default. + [olive]#--latency# Show latency metrics. + [olive]#--pool-max#= Max pool connections (default: 8). + [olive]#--client#= Client name used to connect to Redis. +Commands: + ... .... +Redis connection options are the same as `redis-cli`. + +For Redis URI syntax see https://github.com/lettuce-io/lettuce-core/wiki/Redis-URI-and-connection-details#uri-syntax[here]. + [TIP,subs="attributes"] ==== You can use `--help` on any subcommand: @@ -53,14 +82,3 @@ You can use `--help` on any subcommand: [green]#{connector}# import hset --help .... ==== - -.Redis connection options -[subs="attributes,+quotes"] -.... -[green]#{connector}# -h myredis.com -p 6380 ... -.... - -[TIP,subs="attributes"] -==== -Redis connection options are the same as `redis-cli`. URI syntax is described https://github.com/lettuce-io/lettuce-core/wiki/Redis-URI-and-connection-details#uri-syntax[here]. -==== diff --git a/docs/guide/src/docs/asciidoc/index.adoc b/docs/guide/src/docs/asciidoc/index.adoc index 25b50438d..f8b5430e3 100644 --- a/docs/guide/src/docs/asciidoc/index.adoc +++ b/docs/guide/src/docs/asciidoc/index.adoc @@ -4,9 +4,11 @@ :toclevels: 3 :docinfo1: -include::{includedir}/introduction.adoc[leveloffset=+1] -include::{includedir}/riot-db.adoc[leveloffset=+1] -include::{includedir}/riot-file.adoc[leveloffset=+1] -include::{includedir}/riot-gen.adoc[leveloffset=+1] -include::{includedir}/riot-redis.adoc[leveloffset=+1] -include::{includedir}/riot-stream.adoc[leveloffset=+1] +:leveloffset: 1 +include::{includedir}/introduction.adoc[] + +include::{includedir}/riot-db.adoc[] +include::{includedir}/riot-file.adoc[] +include::{includedir}/riot-gen.adoc[] +include::{includedir}/riot-redis.adoc[] +include::{includedir}/riot-stream.adoc[]