From c80c8f2297c626dfe500cddc0bfeec764928faa9 Mon Sep 17 00:00:00 2001 From: Tom Wiesing Date: Thu, 8 Dec 2022 11:45:52 +0100 Subject: [PATCH] Reformat documentation messages --- cmd/backup.go | 10 +++++----- cmd/blind_update.go | 8 ++++---- cmd/bootstrap.go | 2 +- cmd/config.go | 2 +- cmd/cron.go | 4 ++-- cmd/drupal_setting.go | 2 +- cmd/drupal_user.go | 4 ++-- cmd/info.go | 4 ++-- cmd/instance_lock.go | 6 +++--- cmd/license.go | 2 +- cmd/ls.go | 4 ++-- cmd/make_mysql_account.go | 2 +- cmd/monday.go | 6 +++--- cmd/mysql.go | 2 +- cmd/pathbuilders.go | 4 ++-- cmd/prefixes.go | 2 +- cmd/provision.go | 4 ++-- cmd/purge.go | 6 +++--- cmd/rebuild.go | 4 ++-- cmd/reserve.go | 4 ++-- cmd/server.go | 2 +- cmd/shell.go | 4 ++-- cmd/snapshot.go | 8 ++++---- cmd/ssh.go | 4 ++-- cmd/status.go | 4 ++-- cmd/system_pause.go | 6 +++--- cmd/system_update.go | 4 ++-- cmd/update_prefix_config.go | 2 +- internal/cli/flags.go | 6 +++--- 29 files changed, 61 insertions(+), 61 deletions(-) diff --git a/cmd/backup.go b/cmd/backup.go index a837e3b..00ea034 100644 --- a/cmd/backup.go +++ b/cmd/backup.go @@ -12,11 +12,11 @@ import ( var Backup wisski_distillery.Command = backup{} type backup struct { - NoPrune bool `short:"n" long:"no-prune" description:"Do not prune older backup archives"` - StagingOnly bool `short:"s" long:"staging-only" description:"Do not package into a backup archive, but only create a staging directory"` - ConcurrentSnapshots int `short:"c" long:"concurrent-snapshots" description:"Maximum number of concurrent snapshots" default:"2"` + NoPrune bool `short:"n" long:"no-prune" description:"do not prune older backup archives"` + StagingOnly bool `short:"s" long:"staging-only" description:"do not package into a backup archive, but only create a staging directory"` + ConcurrentSnapshots int `short:"c" long:"concurrent-snapshots" description:"maximum number of concurrent snapshots" default:"2"` Positionals struct { - Dest string `positional-arg-name:"DEST" description:"Destination path to write backup archive to. Defaults to the snapshots/archives/ directory"` + Dest string "positional-arg-name:\"DEST\" description:\"destination path to write backup archive to. defaults to the `snapshots/archives/` directory\"" } `positional-args:"true"` } @@ -26,7 +26,7 @@ func (backup) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "backup", - Description: "Makes a backup of the entire distillery", + Description: "makes a backup of the entire distillery", } } diff --git a/cmd/blind_update.go b/cmd/blind_update.go index 5d9ef19..481d76d 100644 --- a/cmd/blind_update.go +++ b/cmd/blind_update.go @@ -16,10 +16,10 @@ import ( var BlindUpdate wisski_distillery.Command = blindUpdate{} type blindUpdate struct { - Parallel int `short:"p" long:"parallel" description:"run on (at most) this many instances in parallel. 0 for no limit." default:"1"` - Force bool `short:"f" long:"force" description:"force running blind-update even if AutoBlindUpdate is set to false"` + Parallel int `short:"p" long:"parallel" description:"run on (at most) this many instances in parallel. 0 for no limit" default:"1"` + Force bool "short:\"f\" long:\"force\" description:\"force running blind-update even if `AutoBlindUpdate` is set to false\"" Positionals struct { - Slug []string `positional-arg-name:"SLUG" required:"0" description:"slug of instance(s) to run blind-update in"` + Slug []string `positional-arg-name:"SLUG" required:"0" description:"slug of instances to update"` } `positional-args:"true"` } @@ -29,7 +29,7 @@ func (blindUpdate) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "blind_update", - Description: "Runs the blind update in the provided instances", + Description: "runs the blind update in the provided instances", } } diff --git a/cmd/bootstrap.go b/cmd/bootstrap.go index 43d8000..f8fe085 100644 --- a/cmd/bootstrap.go +++ b/cmd/bootstrap.go @@ -29,7 +29,7 @@ func (cBootstrap) Description() wisski_distillery.Description { NeedsDistillery: false, }, Command: "bootstrap", - Description: "Bootstraps the installation of a Distillery System", + Description: "bootstraps the installation of a distillery system", } } diff --git a/cmd/config.go b/cmd/config.go index 917e6d5..c4e9831 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -16,7 +16,7 @@ func (c cfg) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "config", - Description: "Prints information about configuration", + Description: "prints information about configuration", } } diff --git a/cmd/cron.go b/cmd/cron.go index bc67c10..de70881 100644 --- a/cmd/cron.go +++ b/cmd/cron.go @@ -17,7 +17,7 @@ type cron struct { Parallel int `short:"p" long:"parallel" description:"run on (at most) this many instances in parallel. 0 for no limit." default:"1"` Positionals struct { - Slug []string `positional-arg-name:"SLUG" required:"0" description:"slug of instance(s) to run cron in"` + Slug []string `positional-arg-name:"SLUG" required:"0" description:"slug of instances to run cron in"` } `positional-args:"true"` } @@ -27,7 +27,7 @@ func (cron) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "cron", - Description: "Runs the cron script for several instances", + Description: "runs the cron script for several instances", } } diff --git a/cmd/drupal_setting.go b/cmd/drupal_setting.go index 7b2b702..b924237 100644 --- a/cmd/drupal_setting.go +++ b/cmd/drupal_setting.go @@ -25,7 +25,7 @@ func (setting) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "drupal_setting", - Description: "Get or set a drupal setting", + Description: "get or set a drupal setting", } } diff --git a/cmd/drupal_user.go b/cmd/drupal_user.go index d00aa2e..a4c84a4 100644 --- a/cmd/drupal_user.go +++ b/cmd/drupal_user.go @@ -16,13 +16,13 @@ import ( var DrupalUser wisski_distillery.Command = duser{} type duser struct { - CheckCommonPasswords bool `short:"d" long:"check-common-passwords" description:"check for most common passwords. Operates on all users concurrently."` + CheckCommonPasswords bool `short:"d" long:"check-common-passwords" description:"check for most common passwords. operates on all users concurrently."` CheckPasswdInteractive bool `short:"c" long:"check-password" description:"interactively check user password"` ResetPasswd bool `short:"r" long:"reset-password" description:"reset password for user"` Login bool `short:"l" long:"login" description:"print url to login as"` Positionals struct { Slug string `positional-arg-name:"SLUG" required:"1-1" description:"slug of instance to manage"` - User string `positional-arg-name:"USER" description:"username to manage. May be omitted for some actions"` + User string `positional-arg-name:"USER" description:"username to manage. may be omitted for some actions"` } `positional-args:"true"` } diff --git a/cmd/info.go b/cmd/info.go index a7706f2..ec3963d 100644 --- a/cmd/info.go +++ b/cmd/info.go @@ -12,7 +12,7 @@ import ( var Info wisski_distillery.Command = info{} type info struct { - JSON bool `short:"j" long:"json" description:"Print information as JSON instead of as string"` + JSON bool `short:"j" long:"json" description:"print information as JSON instead of as string"` Positionals struct { Slug string `positional-arg-name:"SLUG" required:"1-1" description:"slug of instance to show info about"` } `positional-args:"true"` @@ -24,7 +24,7 @@ func (info) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "info", - Description: "Provide information about a single instance", + Description: "provide information about a single instance", } } diff --git a/cmd/instance_lock.go b/cmd/instance_lock.go index 31111fe..55bca66 100644 --- a/cmd/instance_lock.go +++ b/cmd/instance_lock.go @@ -11,8 +11,8 @@ import ( var InstanceLock wisski_distillery.Command = instanceLock{} type instanceLock struct { - Lock bool `short:"l" long:"lock" description:"Lock the provided WissKI instance"` - Unlock bool `short:"u" long:"unlock" description:"Unlock the provided WissKI instance"` + Lock bool `short:"l" long:"lock" description:"lock the provided instance"` + Unlock bool `short:"u" long:"unlock" description:"unlock the provided instance"` Positionals struct { Slug string `positional-arg-name:"SLUG" required:"1-1" description:"slug of instance to lock or unlock"` } `positional-args:"true"` @@ -24,7 +24,7 @@ func (instanceLock) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "instance_lock", - Description: "Locks or unlocks a WissKI instance", + Description: "locks or unlocks an instance", } } diff --git a/cmd/license.go b/cmd/license.go index d2c9140..20e6fd5 100644 --- a/cmd/license.go +++ b/cmd/license.go @@ -18,7 +18,7 @@ func (license) Description() wisski_distillery.Description { NeedsDistillery: false, }, Command: "license", - Description: "Print licensing information about wdcli and exit. ", + Description: "print licensing information about wdcli and exit", } } diff --git a/cmd/ls.go b/cmd/ls.go index 665cc45..50e29c0 100644 --- a/cmd/ls.go +++ b/cmd/ls.go @@ -10,7 +10,7 @@ var Ls wisski_distillery.Command = ls{} type ls struct { Positionals struct { - Slug []string `positional-arg-name:"SLUG" required:"0" description:"slug(s) of instance(s) to list"` + Slug []string `positional-arg-name:"SLUG" required:"0" description:"slugs of instances to list. if empty, list all instances"` } `positional-args:"true"` } @@ -20,7 +20,7 @@ func (ls) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "ls", - Description: "Lists WissKI instances", + Description: "lists instances", } } diff --git a/cmd/make_mysql_account.go b/cmd/make_mysql_account.go index f099606..7fa9678 100644 --- a/cmd/make_mysql_account.go +++ b/cmd/make_mysql_account.go @@ -21,7 +21,7 @@ func (makeMysqlAccount) Description() wisski_distillery.Description { IncludeUnknown: true, }, Command: "make_mysql_account", - Description: "Open a shell in the provided instance", + Description: "opens a shell in the provided instance", } } diff --git a/cmd/monday.go b/cmd/monday.go index bcb3010..5f2f500 100644 --- a/cmd/monday.go +++ b/cmd/monday.go @@ -12,9 +12,9 @@ import ( var Monday wisski_distillery.Command = monday{} type monday struct { - UpdateInstances bool `short:"u" long:"update-instances" description:"Fully update instances. May take a long time, and is potentially breaking. "` + UpdateInstances bool `short:"u" long:"update-instances" description:"fully update instances. may take a long time, and is potentially breaking"` Positionals struct { - GraphdbZip string `positional-arg-name:"PATH_TO_GRAPHDB_ZIP" required:"1-1" description:"path to the graphdb.zip file"` + GraphdbZip string "positional-arg-name:\"PATH_TO_GRAPHDB_ZIP\" required:\"1-1\" description:\"path to the `graphdb.zip` file\"" } `positional-args:"true"` } @@ -24,7 +24,7 @@ func (monday) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "monday", - Description: "Runs regular monday tasks", + Description: "runs regular monday tasks", } } diff --git a/cmd/mysql.go b/cmd/mysql.go index f8bc94e..962cd6d 100644 --- a/cmd/mysql.go +++ b/cmd/mysql.go @@ -27,7 +27,7 @@ func (mysql) Description() wisski_distillery.Description { IncludeUnknown: true, }, Command: "mysql", - Description: "Opens a mysql shell", + Description: "opens a mysql shell", } } diff --git a/cmd/pathbuilders.go b/cmd/pathbuilders.go index 9c545b1..9fc4dec 100644 --- a/cmd/pathbuilders.go +++ b/cmd/pathbuilders.go @@ -12,7 +12,7 @@ var Pathbuilders wisski_distillery.Command = pathbuilders{} type pathbuilders struct { Positionals struct { Slug string `positional-arg-name:"SLUG" required:"1-1" description:"slug of instance to export pathbuilders of"` - Name string `positional-arg-name:"NAME" description:"Name of pathbuilder to get. If omitted, show a list of all pathbuilders"` + Name string `positional-arg-name:"NAME" description:"name of pathbuilder to get. if omitted, show a list of all pathbuilders"` } `positional-args:"true"` } @@ -22,7 +22,7 @@ func (pathbuilders) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "pathbuilder", - Description: "Lists of displays pathbuilders of a specific WissKI instance", + Description: "list pathbuilders of a specific instance", } } diff --git a/cmd/prefixes.go b/cmd/prefixes.go index a5b17d4..2bfc150 100644 --- a/cmd/prefixes.go +++ b/cmd/prefixes.go @@ -21,7 +21,7 @@ func (prefixes) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "prefixes", - Description: "List all Prefixes for a specific WissKI", + Description: "list all prefixes for a specific instance", } } diff --git a/cmd/provision.go b/cmd/provision.go index e249c60..16b7659 100644 --- a/cmd/provision.go +++ b/cmd/provision.go @@ -13,7 +13,7 @@ var Provision wisski_distillery.Command = provision{} type provision struct { Positionals struct { - Slug string `positional-arg-name:"slug" required:"1-1" description:"name of WissKI Instance to create"` + Slug string `positional-arg-name:"slug" required:"1-1" description:"slug of instance to create"` } `positional-args:"true"` } @@ -23,7 +23,7 @@ func (provision) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "provision", - Description: "Creates a new WissKI Instance", + Description: "creates a new instance", } } diff --git a/cmd/purge.go b/cmd/purge.go index 1f01151..c94de7a 100644 --- a/cmd/purge.go +++ b/cmd/purge.go @@ -12,9 +12,9 @@ import ( var Purge wisski_distillery.Command = purge{} type purge struct { - Yes bool `short:"y" long:"yes" description:"Skip asking for confirmation"` + Yes bool `short:"y" long:"yes" description:"do not ask for confirmation"` Positionals struct { - Slug string `positional-arg-name:"slug" required:"1-1" description:"name of WissKI Instance to purge"` + Slug string `positional-arg-name:"slug" required:"1-1" description:"name of instance to purge"` } `positional-args:"true"` } @@ -24,7 +24,7 @@ func (purge) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "purge", - Description: "Purges a WissKI Instance", + Description: "purges an instance", } } diff --git a/cmd/rebuild.go b/cmd/rebuild.go index 1b084bb..58a1e8e 100644 --- a/cmd/rebuild.go +++ b/cmd/rebuild.go @@ -17,7 +17,7 @@ var Rebuild wisski_distillery.Command = rebuild{} type rebuild struct { Parallel int `short:"p" long:"parallel" description:"run on (at most) this many instances in parallel. 0 for no limit." default:"1"` Positionals struct { - Slug []string `positional-arg-name:"SLUG" required:"0" description:"slug of instance(s) to run rebuild"` + Slug []string `positional-arg-name:"SLUG" required:"0" description:"slug of instance or instances to run rebuild"` } `positional-args:"true"` } @@ -27,7 +27,7 @@ func (rebuild) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "rebuild", - Description: "Runs the rebuild script for several instances", + Description: "runs the rebuild script for several instances", } } diff --git a/cmd/reserve.go b/cmd/reserve.go index 5c6b8fa..d220105 100644 --- a/cmd/reserve.go +++ b/cmd/reserve.go @@ -14,7 +14,7 @@ var Reserve wisski_distillery.Command = reserve{} type reserve struct { Positionals struct { - Slug string `positional-arg-name:"slug" required:"1-1" description:"name of WissKI Instance to reserve"` + Slug string `positional-arg-name:"slug" required:"1-1" description:"name of instance to reserve"` } `positional-args:"true"` } @@ -24,7 +24,7 @@ func (reserve) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "reserve", - Description: "Reserves a new WissKI Instance", + Description: "reserves a new instance", } } diff --git a/cmd/server.go b/cmd/server.go index 57b66bd..f960044 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -25,7 +25,7 @@ func (s server) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "server", - Description: "Starts a server with information about this distillery", + Description: "starts a server with information about this distillery", } } diff --git a/cmd/shell.go b/cmd/shell.go index 643bfb6..93925bc 100644 --- a/cmd/shell.go +++ b/cmd/shell.go @@ -14,7 +14,7 @@ var Shell wisski_distillery.Command = shell{} type shell struct { Positionals struct { - Slug string `positional-arg-name:"SLUG" required:"1-1" description:"slug of instance to show run shell in"` + Slug string `positional-arg-name:"SLUG" required:"1-1" description:"slug of instance to run shell in"` Args []string `positional-arg-name:"ARGS" description:"arguments to pass to the shell"` } `positional-args:"true"` } @@ -28,7 +28,7 @@ func (shell) Description() wisski_distillery.Description { IncludeUnknown: true, }, Command: "shell", - Description: "Open a shell in the provided instance", + Description: "open a shell in the provided instance", } } diff --git a/cmd/snapshot.go b/cmd/snapshot.go index 4defaf8..0e3b864 100644 --- a/cmd/snapshot.go +++ b/cmd/snapshot.go @@ -11,12 +11,12 @@ import ( var Snapshot wisski_distillery.Command = snapshot{} type snapshot struct { - Keepalive bool `short:"k" long:"keepalive" description:"Keep instance running while taking a backup. Might lead to inconsistent state"` - StagingOnly bool `short:"s" long:"staging-only" description:"Do not package into a snapshot archive, but only create a staging directory"` + Keepalive bool `short:"k" long:"keepalive" description:"keep instance running while taking a backup. might lead to inconsistent state"` + StagingOnly bool `short:"s" long:"staging-only" description:"do not package into a snapshot archive, but only create a staging directory"` Positionals struct { Slug string `positional-arg-name:"SLUG" required:"1-1" description:"slug of instance to take a snapshot of"` - Dest string `positional-arg-name:"DEST" description:"Destination path to write snapshot archive to. Defaults to the snapshots/archives/ directory"` + Dest string "positional-arg-name:\"DEST\" description:\"destination path to write snapshot archive to. defaults to the `snapshots/archives/` directory\"" } `positional-args:"true"` } @@ -26,7 +26,7 @@ func (snapshot) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "snapshot", - Description: "Generates a snapshot archive for the provided archive", + Description: "generates a snapshot archive for the provided instance", } } diff --git a/cmd/ssh.go b/cmd/ssh.go index de15c89..e76f795 100644 --- a/cmd/ssh.go +++ b/cmd/ssh.go @@ -11,7 +11,7 @@ var SSH wisski_distillery.Command = ssh{} type ssh struct { Bind string `short:"b" long:"bind" description:"address to listen on" default:"127.0.0.1:2223"` - PrivateKeyPath string `short:"p" long:"private-key-path" description:"Path to store private host keys in" required:"1"` + PrivateKeyPath string `short:"p" long:"private-key-path" description:"path to store private host keys in" required:"1"` } func (s ssh) Description() wisski_distillery.Description { @@ -20,7 +20,7 @@ func (s ssh) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "ssh", - Description: "Starts the ssh server to allow clients to connect to this distillery", + Description: "starts the ssh server to allow clients to connect to this distillery", } } diff --git a/cmd/status.go b/cmd/status.go index 5e9093c..af94fcb 100644 --- a/cmd/status.go +++ b/cmd/status.go @@ -11,7 +11,7 @@ import ( var Status wisski_distillery.Command = cStatus{} type cStatus struct { - JSON bool `short:"j" long:"json" description:"Print status as JSON instead of as string"` + JSON bool `short:"j" long:"json" description:"print status as JSON instead of as string"` } func (cStatus) Description() wisski_distillery.Description { @@ -20,7 +20,7 @@ func (cStatus) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "status", - Description: "Provide information about the distillery as a whole", + Description: "provide information about the distillery as a whole", } } diff --git a/cmd/system_pause.go b/cmd/system_pause.go index a5c4c15..927df00 100644 --- a/cmd/system_pause.go +++ b/cmd/system_pause.go @@ -18,8 +18,8 @@ import ( var SystemPause wisski_distillery.Command = systempause{} type systempause struct { - Stop bool `short:"d" long:"stop" description:"Stop all the components"` - Start bool `short:"u" long:"start" description:"Start all the components"` + Stop bool `short:"d" long:"stop" description:"stop all the components"` + Start bool `short:"u" long:"start" description:"start all the components"` } func (systempause) Description() wisski_distillery.Description { @@ -28,7 +28,7 @@ func (systempause) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "system_pause", - Description: "Stops or Starts the entire WissKI Distillery system", + Description: "stops or starts the entire distillery system", } } diff --git a/cmd/system_update.go b/cmd/system_update.go index 7ac7ad7..3d54673 100644 --- a/cmd/system_update.go +++ b/cmd/system_update.go @@ -20,7 +20,7 @@ import ( var SystemUpdate wisski_distillery.Command = systemupdate{} type systemupdate struct { - InstallDocker bool `short:"a" long:"install-docker" description:"Try to automatically install docker. Assumes 'apt-get' as a package manager. "` + InstallDocker bool "short:\"a\" long:\"install-docker\" description:\"try to automatically install docker. assumes `apt-get` as a package manager\"" Positionals struct { GraphdbZip string `positional-arg-name:"PATH_TO_GRAPHDB_ZIP" required:"1-1" description:"path to the graphdb.zip file"` } `positional-args:"true"` @@ -35,7 +35,7 @@ func (systemupdate) Description() wisski_distillery.Description { IncludeUnknown: true, }, Command: "system_update", - Description: "Installs and Update Components of the WissKI Distillery System", + Description: "installs and updates components of the distillery system", } } diff --git a/cmd/update_prefix_config.go b/cmd/update_prefix_config.go index c1328c2..f7a571b 100644 --- a/cmd/update_prefix_config.go +++ b/cmd/update_prefix_config.go @@ -26,7 +26,7 @@ func (updateprefixconfig) Description() wisski_distillery.Description { NeedsDistillery: true, }, Command: "update_prefix_config", - Description: "Updates the prefix configuration", + Description: "updates the prefix configuration", } } diff --git a/internal/cli/flags.go b/internal/cli/flags.go index ebf6812..db90ce4 100644 --- a/internal/cli/flags.go +++ b/internal/cli/flags.go @@ -4,10 +4,10 @@ import "github.com/rs/zerolog" // Flags are global flags for the wdcli executable type Flags struct { - LogLevel LogLevelString `short:"l" long:"loglevel" description:"Log level to use for logger" default:"info" choice:"trace" choice:"debug" choice:"info" choice:"warn" choice:"error" choice:"fatal" choice:"panic"` - ConfigPath string `short:"c" long:"config" description:"Path to distillery configuration file"` + LogLevel LogLevelString `short:"l" long:"loglevel" description:"log level" default:"info" choice:"trace" choice:"debug" choice:"info" choice:"warn" choice:"error" choice:"fatal" choice:"panic"` + ConfigPath string `short:"c" long:"config" description:"path to distillery configuration file"` - InternalInDocker bool `long:"internal-in-docker" description:"Internal Flag to signal the shell that it is running inside a docker stack belonging to the distillery"` + InternalInDocker bool `long:"internal-in-docker" description:"internal flag to signal the shell that it is running inside a docker stack belonging to the distillery"` } type LogLevelString string