fix typos in messages

This commit is contained in:
Tom Wiesing 2022-12-08 10:36:07 +01:00
parent 20448c67a3
commit aefde6eec2
No known key found for this signature in database
29 changed files with 91 additions and 55 deletions

View file

@ -31,7 +31,7 @@ func (backup) Description() wisski_distillery.Description {
}
var errBackupFailed = exit.Error{
Message: "Failed to make a backup",
Message: "failed to make a backup",
ExitCode: exit.ExitGeneric,
}

View file

@ -34,7 +34,7 @@ func (blindUpdate) Description() wisski_distillery.Description {
}
var errBlindUpdateFailed = exit.Error{
Message: "Failed to run blind update script for instance %q: exited with code %s",
Message: "failed to run blind update script for instance %q: exited with code %s",
ExitCode: exit.ExitGeneric,
}

View file

@ -31,12 +31,12 @@ func (setting) Description() wisski_distillery.Description {
var errSettingGet = exit.Error{
ExitCode: exit.ExitGeneric,
Message: "Unable to get setting",
Message: "unable to get setting",
}
var errSettingSet = exit.Error{
ExitCode: exit.ExitGeneric,
Message: "Unable to set setting",
Message: "unable to set setting",
}
func (ds setting) Run(context wisski_distillery.Context) error {

View file

@ -70,7 +70,7 @@ func (du duser) AfterParse() error {
}
var errPasswordsNotIdentical = exit.Error{
Message: "Passwords are not identical",
Message: "passwords are not identical",
ExitCode: exit.ExitGeneric,
}
@ -103,7 +103,7 @@ func (du duser) login(context wisski_distillery.Context, instance *wisski.WissKI
}
var errPasswordFound = exit.Error{
Message: "User had a dictionary password",
Message: "user had a dictionary password",
ExitCode: 5,
}

View file

@ -29,7 +29,7 @@ func (instanceLock) Description() wisski_distillery.Description {
}
var errLockUnlockExcluded = exit.Error{
Message: "Exactly one of `--lock` and `--unlock` must be provied",
Message: "exactly one of `--lock` and `--unlock` must be provied",
ExitCode: exit.ExitCommandArguments,
}
@ -41,7 +41,7 @@ func (l instanceLock) AfterParse() error {
}
var errNotUnlock = exit.Error{
Message: "Unable to unlock instance: Not locked",
Message: "unable to unlock instance: not locked",
ExitCode: exit.ExitCommandArguments,
}

View file

@ -27,12 +27,12 @@ func (pathbuilders) Description() wisski_distillery.Description {
}
var errPathbuilders = exit.Error{
Message: "Unable to export pathbuilder: %s",
Message: "unable to export pathbuilder: %s",
ExitCode: exit.ExitGeneric,
}
var errNoPathbuilder = exit.Error{
Message: "Pathbuilder %q does not exist",
Message: "pathbuilder %q does not exist",
ExitCode: exit.ExitGeneric,
}

View file

@ -27,7 +27,7 @@ func (prefixes) Description() wisski_distillery.Description {
var errPrefixesGeneric = exit.Error{
ExitCode: exit.ExitGeneric,
Message: "Unable to load prefixes",
Message: "unable to load prefixes",
}
func (p prefixes) Run(context wisski_distillery.Context) error {

View file

@ -30,12 +30,12 @@ func (provision) Description() wisski_distillery.Description {
// TODO: AfterParse to check instance!
var errProvisionAlreadyExists = exit.Error{
Message: "Instance %q already exists",
Message: "instance %q already exists",
ExitCode: exit.ExitGeneric,
}
var errProvisionGeneric = exit.Error{
Message: "Unable to provision instance %s: %s",
Message: "unable to provision instance %s: %s",
ExitCode: exit.ExitGeneric,
}

View file

@ -29,17 +29,17 @@ func (purge) Description() wisski_distillery.Description {
}
var errPurgeNoDetails = exit.Error{
Message: "Unable to find instance details for purge: %s",
Message: "unable to find instance details for purge: %s",
ExitCode: exit.ExitGeneric,
}
var errPurgeNoConfirmation = exit.Error{
Message: "Aborting after request was not confirmed. Either type `yes` or pass `--yes` on the command line",
Message: "aborting after request was not confirmed. either type `yes` or pass `--yes` on the command line",
ExitCode: exit.ExitGeneric,
}
var errPurgeGeneric = exit.Error{
Message: "Unable to purge instance %s: %s",
Message: "unable to purge instance %q: %s",
ExitCode: exit.ExitGeneric,
}

View file

@ -32,7 +32,7 @@ func (rebuild) Description() wisski_distillery.Description {
}
var errRebuildFailed = exit.Error{
Message: "Failed to run rebuild script for instance %q: exited with code %s",
Message: "failed to run rebuild script for instance %q: exited with code %s",
ExitCode: exit.ExitGeneric,
}

View file

@ -31,12 +31,12 @@ func (reserve) Description() wisski_distillery.Description {
// TODO: AfterParse to check instance!
var errReserveAlreadyExists = exit.Error{
Message: "Instance %q already exists",
Message: "instance %q already exists",
ExitCode: exit.ExitGeneric,
}
var errReserveGeneric = exit.Error{
Message: "Unable to provision instance %s: %s",
Message: "unable to provision instance %s: %s",
ExitCode: exit.ExitGeneric,
}

View file

@ -31,7 +31,7 @@ func (s server) Description() wisski_distillery.Description {
var errServerListen = exit.Error{
ExitCode: exit.ExitGeneric,
Message: "Unable to listen",
Message: "unable to listen",
}
func (s server) Run(context wisski_distillery.Context) error {

View file

@ -33,7 +33,7 @@ func (shell) Description() wisski_distillery.Description {
}
var errShell = exit.Error{
Message: "Unable to start shell: %s",
Message: "unable to start shell: %s",
ExitCode: exit.ExitGeneric,
}

View file

@ -31,7 +31,7 @@ func (snapshot) Description() wisski_distillery.Description {
}
var errSnapshotFailed = exit.Error{
Message: "Failed to make a snapshot",
Message: "failed to make a snapshot",
ExitCode: exit.ExitGeneric,
}

View file

@ -26,7 +26,7 @@ func (s ssh) Description() wisski_distillery.Description {
var errSSHListen = exit.Error{
ExitCode: exit.ExitGeneric,
Message: "Unable to listen",
Message: "unable to listen",
}
func (s ssh) Run(context wisski_distillery.Context) error {

View file

@ -33,7 +33,7 @@ func (systempause) Description() wisski_distillery.Description {
}
var errStopStartExcluded = exit.Error{
Message: "Exactly one of `--stop` and `--start` must be provied",
Message: "exactly one of `--stop` and `--start` must be provied",
ExitCode: exit.ExitCommandArguments,
}

View file

@ -58,7 +58,7 @@ var errBoostrapFailedToCreateDirectory = exit.Error{
}
var errBootstrapComponent = exit.Error{
Message: "Unable to bootstrap %s: %s",
Message: "unable to bootstrap %s: %s",
ExitCode: exit.ExitGeneric,
}

View file

@ -31,7 +31,7 @@ func (updateprefixconfig) Description() wisski_distillery.Description {
}
var errPrefixUpdateFailed = exit.Error{
Message: "Failed to update the prefix configuration",
Message: "failed to update the prefix configuration",
ExitCode: exit.ExitGeneric,
}

View file

@ -67,7 +67,7 @@ func init() {
// an error when no arguments are provided.
var errNoArgumentsProvided = exit.Error{
ExitCode: exit.ExitGeneralArguments,
Message: "Need at least one argument. Use `wdcli license` to view licensing information. ",
Message: "need at least one argument. use `wdcli license` to view licensing information",
}
func main() {

9
go.mod
View file

@ -13,11 +13,11 @@ require (
github.com/gorilla/websocket v1.5.0
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.28.0
github.com/tkw1536/goprogram v0.2.2
github.com/tkw1536/goprogram v0.2.4
golang.org/x/crypto v0.3.0
golang.org/x/exp v0.0.0-20221126150942-6ab00d035af9
golang.org/x/exp v0.0.0-20221205204356-47842c84f3db
golang.org/x/sync v0.1.0
golang.org/x/term v0.2.0
golang.org/x/term v0.3.0
gorm.io/driver/mysql v1.4.4
gorm.io/gorm v1.24.2
)
@ -30,5 +30,6 @@ require (
github.com/jinzhu/now v1.1.5 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/tools v0.4.0 // indirect
)

18
go.sum
View file

@ -38,13 +38,13 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.28.0 h1:MirSo27VyNi7RJYP3078AA1+Cyzd2GB66qy3aUHvsWY=
github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0=
github.com/tkw1536/goprogram v0.2.2 h1:ivlySfJb154WsVOp5zxREQjBledxVEUOL0sBIkznOOI=
github.com/tkw1536/goprogram v0.2.2/go.mod h1:Jqs0sTMzhrAGCX3JQrlEwQ0WRWQACCvuQQkaBDp65pE=
github.com/tkw1536/goprogram v0.2.4 h1:1l3+j8xjY3E3uf+ba3QRGWm09ucFCKrnNLq6g1Gq8YA=
github.com/tkw1536/goprogram v0.2.4/go.mod h1:3Ngcwy7jtsZ+pINc+JfLdf8TWbvthdSS2T6Vbg44Fy8=
golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.3.0 h1:a06MkbcxBrEFc0w0QIZWXrH/9cCX6KJyWbBOIwAn+7A=
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/exp v0.0.0-20221126150942-6ab00d035af9 h1:yZNXmy+j/JpX19vZkVktWqAo7Gny4PBWYYK3zskGpx4=
golang.org/x/exp v0.0.0-20221126150942-6ab00d035af9/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/exp v0.0.0-20221205204356-47842c84f3db h1:D/cFflL63o2KSLJIwjlcIt8PR064j/xsmdEJL/YvY/o=
golang.org/x/exp v0.0.0-20221205204356-47842c84f3db/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
@ -58,16 +58,18 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.4.0 h1:7mTAgkunk3fr4GAloyyCasadO6h9zSsQZbwvcaIciV4=
golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ=
gorm.io/driver/mysql v1.4.4 h1:MX0K9Qvy0Na4o7qSC/YI7XxqUw5KDw01umqgID+svdQ=
gorm.io/driver/mysql v1.4.4/go.mod h1:BCg8cKI+R0j/rZRQxeKis/forqRwRSYOR8OM3Wo6hOM=
gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=

File diff suppressed because one or more lines are too long

View file

@ -32,7 +32,7 @@ func (instances *Instances) Path() string {
var ErrWissKINotFound = errors.New("WissKI not found")
var errSQL = exit.Error{
Message: "Unknown SQL Error %s",
Message: "unknown SQL error %s",
ExitCode: exit.ExitGeneric,
}

View file

@ -14,7 +14,7 @@ import (
)
var errTripleStoreFailedRepository = exit.Error{
Message: "Failed to create repository: %s",
Message: "failed to create repository: %s",
ExitCode: exit.ExitGeneric,
}
@ -55,7 +55,7 @@ func (ts *Triplestore) CreateRepository(ctx context.Context, name, domain, user,
}
defer res.Body.Close()
if res.StatusCode != http.StatusCreated {
return errTripleStoreFailedRepository.WithMessageF("Repo create did not return status code 201")
return errTripleStoreFailedRepository.WithMessageF("repo create did not return status code 201")
}
}
@ -81,7 +81,7 @@ func (ts *Triplestore) CreateRepository(ctx context.Context, name, domain, user,
}
defer res.Body.Close()
if res.StatusCode != http.StatusCreated {
return errTripleStoreFailedRepository.WithMessageF("User create did not return status code 201")
return errTripleStoreFailedRepository.WithMessageF("user create did not return status code 201")
}
}

View file

@ -10,7 +10,7 @@ import (
var errNoConfigFile = exit.Error{
ExitCode: exit.ExitGeneralArguments,
Message: "Configuration File does not exist",
Message: "configuration file does not exist",
}
var errOpenConfig = exit.Error{

View file

@ -15,7 +15,7 @@ import (
)
var errCronFailed = exit.Error{
Message: "Failed to run cron script for instance %q: exited with code %s",
Message: "failed to run cron script for instance %q: exited with code %s",
ExitCode: exit.ExitGeneric,
}

View file

@ -15,7 +15,7 @@ import (
)
var errBlindUpdateFailed = exit.Error{
Message: "Failed to run blind update script for instance %q: exited with code %s",
Message: "failed to run blind update script for instance %q: exited with code %s",
ExitCode: exit.ExitGeneric,
}

View file

@ -20,7 +20,7 @@ var (
)
var Locked = exit.Error{
Message: "WissKI Instance is locked for administrative operations",
Message: "instance is locked for administrative operations",
ExitCode: exit.ExitGeneric,
}

View file

@ -56,10 +56,10 @@ var GetContext = goprogram.GetContext[wdcliEnv, wdcliParameters, wdCliFlags, wdc
// an error when nor arguments are provided.
var errUserIsNotRoot = exit.Error{
ExitCode: exit.ExitGeneralArguments,
Message: "This command has to be executed as root. The current user is not root.",
Message: "this command has to be executed as root. the current user is not root",
}
var warnNoDeployWdcli = "Warning: Not using %q executable at %q. This might leave the distillery in an inconsistent state. \n"
const warnNoDeployWdcli = "Warning: Not using %q executable at %q. This might leave the distillery in an inconsistent state. \n"
func NewProgram() Program {
return Program{