From a9821d9cc1f02037d1a9c82eec9822adb4a3fac3 Mon Sep 17 00:00:00 2001 From: Jeff VanDellen Date: Fri, 13 Oct 2023 10:12:19 -0400 Subject: [PATCH 1/3] Updated readme to for new binary name. --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4115fde..0737ccd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lw (liquidweb-cli) +# lw-cli (liquidweb-cli) Official command line interface for the LiquidWeb API ``` CLI interface for LiquidWeb. @@ -19,7 +19,7 @@ As always, consult the various subcommands for specific features and capabilities. Usage: - lw [command] + lw-cli [command] Available Commands: asset All things assets @@ -36,10 +36,10 @@ Available Commands: Flags: --config string config file (default is $HOME/.liquidweb-cli.yaml) - -h, --help help for lw + -h, --help help for lw-cli` --use-context string forces current context, without persisting the context change -Use "lw [command] --help" for more information about a command. +Use "lw-cli [command] --help" for more information about a command. ``` ## Obtaining prebuilt binaries @@ -47,12 +47,12 @@ Head on over to the [releases page](https://github.com/liquidweb/liquidweb-cli/r ## Building from source -You can build lw from source by running `make build` from the root of this repository. The resulting program will be located at `./_exe/lw`. -You can also build+install lw onto your system in the ordinary `go install` way. To do this, either just run `go install` from the root of this repository, +You can build lw-cli from source by running `make build` from the root of this repository. The resulting program will be located at `./_exe/lw-cli`. +You can also build+install lw-cli onto your system in the ordinary `go install` way. To do this, either just run `go install` from the root of this repository, or `make install`. If you run `make` with no arguments, this will be the default action. ## First Time Setup -The first time you use lw, you will need to setup an auth context. An auth context holds authentication related data for a specific LiquidWeb account. You can follow a guided questionnaire to add your auth contexts if you pass arguments `auth init` to lw. By default contexts are stored in `~/.liquidweb-cli.yaml` or `%APPDATA%/.liquidweb-cli.yaml` on Windows. +The first time you use lw-cli, you will need to setup an auth context. An auth context holds authentication related data for a specific LiquidWeb account. You can follow a guided questionnaire to add your auth contexts if you pass arguments `auth init` to lw-cli. By default contexts are stored in `~/.liquidweb-cli.yaml` or `%APPDATA%/.liquidweb-cli.yaml` on Windows. ## Adding auth contexts later If you end up wanting to add an auth context later on, you can do so with `auth add-context`. You can find the usage documentation in `help auth add-context`. @@ -76,7 +76,7 @@ For current commands supported via plans, take a look in the `examples/plans` di Example: -`lw plan --file plan.yaml` +`lw-cli plan --file plan.yaml` ``` --- @@ -110,7 +110,7 @@ If you wanted to pass user defined variables on the command line you would use t (multiple `--var` flags can be passed). For example, if you wanted to generate the hostname of `web3.somehost.org` you would use the following command and yaml: -`lw plan --file play.yaml --var node=3 --var role=web` +`lw-cli plan --file play.yaml --var node=3 --var role=web` ``` hostname: "{{- .Var.role -}}{{- .Var.node -}}.somehost.org" From d63ffe5ed1955dca127265d8134461030110d9f9 Mon Sep 17 00:00:00 2001 From: Jeff VanDellen Date: Fri, 13 Oct 2023 10:44:00 -0400 Subject: [PATCH 2/3] Fixed some help docs --- cmd/assetList.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/assetList.go b/cmd/assetList.go index 4db9ec4..7e1ace0 100644 --- a/cmd/assetList.go +++ b/cmd/assetList.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -21,7 +21,7 @@ import ( "github.com/spf13/cobra" "github.com/liquidweb/liquidweb-cli/instance" - "github.com/liquidweb/liquidweb-cli/types/api" + apiTypes "github.com/liquidweb/liquidweb-cli/types/api" ) var assetListCmdCategoriesFlag []string @@ -36,10 +36,10 @@ An asset is an individual component on an account. Assets have categories. Examples: * List all assets in the Provisioned and DNS categories: -- lw asset list --categories Provisioned,DNS +- lw-cli asset list --categories Provisioned,DNS * List all dedicated servers: -- lw asset list --categories StrictDedicated +- lw-cli asset list --categories StrictDedicated `, Run: func(cmd *cobra.Command, args []string) { jsonFlag, _ := cmd.Flags().GetBool("json") @@ -57,15 +57,15 @@ Examples: ResultsPerPage: 100, MethodArgs: apiArgs, } - results, err := lwCliInst.AllPaginatedResults(&methodArgs) + results, err := lw - cliCliInst.AllPaginatedResults(&methodArgs) if err != nil { - lwCliInst.Die(err) + lw - cliCliInst.Die(err) } if jsonFlag { - pretty, err := lwCliInst.JsonEncodeAndPrettyPrint(results) + pretty, err := lw - cliCliInst.JsonEncodeAndPrettyPrint(results) if err != nil { - lwCliInst.Die(err) + lw - cliCliInst.Die(err) } fmt.Print(pretty) } else { @@ -74,7 +74,7 @@ Examples: var details apiTypes.Subaccnt if err := instance.CastFieldTypes(item, &details); err != nil { - lwCliInst.Die(err) + lw - cliCliInst.Die(err) } fmt.Printf("%d.) ", cnt) From e8388da60cc6af1148cb9af79d5471fd9cb1fa34 Mon Sep 17 00:00:00 2001 From: Jack Hayhurst Date: Fri, 13 Oct 2023 14:21:56 -0400 Subject: [PATCH 3/3] fixed up some mistakes from earlier Signed-off-by: Jack Hayhurst --- cmd/assetList.go | 10 +++++----- cmd/authInit.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/assetList.go b/cmd/assetList.go index 7e1ace0..4ee7f00 100644 --- a/cmd/assetList.go +++ b/cmd/assetList.go @@ -57,15 +57,15 @@ Examples: ResultsPerPage: 100, MethodArgs: apiArgs, } - results, err := lw - cliCliInst.AllPaginatedResults(&methodArgs) + results, err := lwCliInst.AllPaginatedResults(&methodArgs) if err != nil { - lw - cliCliInst.Die(err) + lwCliInst.Die(err) } if jsonFlag { - pretty, err := lw - cliCliInst.JsonEncodeAndPrettyPrint(results) + pretty, err := lwCliInst.JsonEncodeAndPrettyPrint(results) if err != nil { - lw - cliCliInst.Die(err) + lwCliInst.Die(err) } fmt.Print(pretty) } else { @@ -74,7 +74,7 @@ Examples: var details apiTypes.Subaccnt if err := instance.CastFieldTypes(item, &details); err != nil { - lw - cliCliInst.Die(err) + lwCliInst.Die(err) } fmt.Printf("%d.) ", cnt) diff --git a/cmd/authInit.go b/cmd/authInit.go index a2891da..2292b21 100644 --- a/cmd/authInit.go +++ b/cmd/authInit.go @@ -100,7 +100,7 @@ func fetchAuthDataInteractively() (writeConfig bool, err error) { userInputExitEarly := make(chan bool) userInputContext := make(chan cmdTypes.AuthContext) - fmt.Println("\nTo exit early, type 'exit'\n") + fmt.Printf("\nTo exit early, type 'exit'\n\n") go func() { WHILEMOREADDS: