Skip to content

Commit

Permalink
Merge pull request #11 from liquidweb/validate-list-flag-args
Browse files Browse the repository at this point in the history
Implement a validation system
  • Loading branch information
sgsullivan committed Jan 28, 2020
2 parents 77cbf11 + 7391ce9 commit bf3151e
Show file tree
Hide file tree
Showing 63 changed files with 1,253 additions and 256 deletions.
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SHELL=/bin/bash
GO_LINKER_SYMBOL := "main.version"

default:
$(MAKE) build
$(MAKE) install

%:
@:
Expand All @@ -21,6 +21,17 @@ static:
build:
go build -ldflags="-s -w" -o _exe/liquidweb-cli github.com/liquidweb/liquidweb-cli

install:
go install
@echo ""
@echo "liquidweb-cli has been installed, and it should now be in your PATH."
@echo ""
@echo "Executables are installed in the directory named by the GOBIN environment"
@echo "variable, which defaults to GOPATH/bin or HOME/go/bin if the GOPATH"
@echo "environment variable is not set. Executables in GOROOT"
@echo "are installed in GOROOT/bin or GOTOOLDIR instead of GOBIN."
@echo ""

run:
go run main.go $(call args,)

Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ Flags:
Use "liquidweb-cli [command] --help" for more information about a command.
```
## Prebuilt binaries
You can obtain prebuilt binaries on the [releases page](https://github.com/liquidweb/liquidweb-cli/releases)
## Obtaining prebuilt binaries

Head on over to the [releases page](https://github.com/liquidweb/liquidweb-cli/releases) to get prebuilt binaries for your platform.

## Building from source

You can build liquidweb-cli from source by running `make build` from the root of this repository. The resulting program will be located at `./_exe/liquidweb-cli`.
You can also build+install liquidweb-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 liquidweb-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 liquidweb-cli. By default contexts are stored in `~/.liquidweb-cli.yaml` or `%APPDATA%/.liquidweb-cli.yaml` on Windows.
Expand Down
1 change: 0 additions & 1 deletion cmd/authAddContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func init() {
authAddContextCmd.Flags().String("api-url", "https://api.liquidweb.com", "API URL to use")
authAddContextCmd.Flags().Int("timeout", 30, "timeout value when communicating with api-url")

authAddContextCmd.MarkFlagRequired("uniq_id")
authAddContextCmd.MarkFlagRequired("username")
authAddContextCmd.MarkFlagRequired("password")
}
3 changes: 3 additions & 0 deletions cmd/authGetContexts.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ If you've never setup any contexts, check "auth init".`,
fmt.Printf("\tInsecure: %t\n", context.Insecure)
fmt.Printf("\tTimeout: %d\n", context.Timeout)
}

currentContext := lwCliInst.Viper.GetString("liquidweb.api.current_context")
fmt.Printf("Current context: [%s]\n", currentContext)
},
}

Expand Down
Loading

0 comments on commit bf3151e

Please sign in to comment.