Skip to content

Commit bf3151e

Browse files
authored
Merge pull request #11 from liquidweb/validate-list-flag-args
Implement a validation system
2 parents 77cbf11 + 7391ce9 commit bf3151e

File tree

63 files changed

+1253
-256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1253
-256
lines changed

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SHELL=/bin/bash
33
GO_LINKER_SYMBOL := "main.version"
44

55
default:
6-
$(MAKE) build
6+
$(MAKE) install
77

88
%:
99
@:
@@ -21,6 +21,17 @@ static:
2121
build:
2222
go build -ldflags="-s -w" -o _exe/liquidweb-cli github.com/liquidweb/liquidweb-cli
2323

24+
install:
25+
go install
26+
@echo ""
27+
@echo "liquidweb-cli has been installed, and it should now be in your PATH."
28+
@echo ""
29+
@echo "Executables are installed in the directory named by the GOBIN environment"
30+
@echo "variable, which defaults to GOPATH/bin or HOME/go/bin if the GOPATH"
31+
@echo "environment variable is not set. Executables in GOROOT"
32+
@echo "are installed in GOROOT/bin or GOTOOLDIR instead of GOBIN."
33+
@echo ""
34+
2435
run:
2536
go run main.go $(call args,)
2637

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ Flags:
3333
3434
Use "liquidweb-cli [command] --help" for more information about a command.
3535
```
36-
## Prebuilt binaries
37-
You can obtain prebuilt binaries on the [releases page](https://github.com/liquidweb/liquidweb-cli/releases)
36+
## Obtaining prebuilt binaries
37+
38+
Head on over to the [releases page](https://github.com/liquidweb/liquidweb-cli/releases) to get prebuilt binaries for your platform.
3839

3940
## Building from source
4041

4142
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`.
43+
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,
44+
or `make install`. If you run `make` with no arguments, this will be the default action.
4245

4346
## First Time Setup
4447
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.

cmd/authAddContext.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ func init() {
8585
authAddContextCmd.Flags().String("api-url", "https://api.liquidweb.com", "API URL to use")
8686
authAddContextCmd.Flags().Int("timeout", 30, "timeout value when communicating with api-url")
8787

88-
authAddContextCmd.MarkFlagRequired("uniq_id")
8988
authAddContextCmd.MarkFlagRequired("username")
9089
authAddContextCmd.MarkFlagRequired("password")
9190
}

cmd/authGetContexts.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ If you've never setup any contexts, check "auth init".`,
4545
fmt.Printf("\tInsecure: %t\n", context.Insecure)
4646
fmt.Printf("\tTimeout: %d\n", context.Timeout)
4747
}
48+
49+
currentContext := lwCliInst.Viper.GetString("liquidweb.api.current_context")
50+
fmt.Printf("Current context: [%s]\n", currentContext)
4851
},
4952
}
5053

0 commit comments

Comments
 (0)