Skip to content
This repository has been archived by the owner on Jan 24, 2020. It is now read-only.

Commit

Permalink
Merge pull request #19 from Cloud-PG/patch
Browse files Browse the repository at this point in the history
fix autocomplete name and description
  • Loading branch information
dciangot authored Jan 16, 2020
2 parents 7409b5a + 521c672 commit 29c3ea7
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 29 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
VERSION?=`git describe --tags`
DOCBIN?=mkdocs
BUILD_DATE := `date +%Y-%m-%d\ %H:%M`
VERSIONFILE := version.go

Expand Down Expand Up @@ -28,7 +29,7 @@ doc:
BUILD_DOC=true ./$(BINARY_NAME)

publish-doc:
mkdocs gh-deploy
$(DOCBIN) gh-deploy

test: build
$(GOTEST) -v ./...
Expand Down Expand Up @@ -69,7 +70,7 @@ gensrc:
@echo " BUILD_DATE = \"$(BUILD_DATE)\"" >> $(VERSIONFILE)
@echo ")" >> $(VERSIONFILE)

build-release: tidy gensrc build doc publish-doc test windows-build macos-build docker-img-build
build-release: tidy gensrc build doc publish-doc test windows-build macos-build
zip dodas.zip dodas
zip dodas.exe.zip dodas.exe
zip dodas_osx.zip dodas_osx
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Download the binary from the latest release on [github](https://github.com/Cloud-PG/dodas-go-client/releases). For instance:

```bash
wget https://github.com/Cloud-PG/dodas-go-client/releases/download/v0.3.2/dodas.zip
wget https://github.com/Cloud-PG/dodas-go-client/releases/download/v0.3.2-patch1/dodas.zip
unzip dodas.zip
cp dodas /usr/local/bin
```
Expand All @@ -19,8 +19,8 @@ cp dodas /usr/local/bin
>
> Autocompletion for bash and zsh is supported
>
> - **bash** add the following line to ~/.bashrc: `. <(dodas completition)`
> - **zsh** add the following line to ~/.zshrc: `source <(dodas zsh-completition)`
> - **bash** add the following line to ~/.bashrc: `. <(dodas autocomplete)`
> - **zsh** add the following line to ~/.zshrc: `source <(dodas zsh-autocomplete)`
You can find now a template for creating your client configuration file in [config/client_config.yaml](https://raw.githubusercontent.com/Cloud-PG/dodas-go-client/master/config/client_config.yaml). Note that by default the client will look for `$HOME/.dodas.yaml`.

Expand All @@ -42,6 +42,13 @@ To list the Infrastructure ID of all your deployments:
dodas list infIDs
```

You can eventually login into a vm in created cluster that has a public IP address with:

```bash
dodas login <infID> <vmID>
# e.g. dodas login cb585e5c-33b6-11ea-8776-0242ac150003 0
```

## Using docker image

In alternative you can create a docker image with the compiled client inside with:
Expand Down
29 changes: 12 additions & 17 deletions cmd/completition.go → cmd/autocomplete.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,30 @@ import (
"github.com/spf13/cobra"
)

// completitionCmd represents the completition command
var completitionCmd = &cobra.Command{
Use: "completition",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
// autocompleteCmd represents the completion command
var autocompleteCmd = &cobra.Command{
Use: "autocomplete",
Short: "Generate script for bash autocomplete",
Long: `add the following line to ~/.bashrc: . <(dodas autocomplete)`,
Run: func(cmd *cobra.Command, args []string) {
rootCmd.GenBashCompletion(os.Stdout);
//rootCmd.GenZshCompletion(os.Stdout);
},
}

// completitionZshCmd represents the completition command
var completitionZshCmd = &cobra.Command{
Use: "zsh-completition",
Short: "A brief description of your command",
Long: ``,
// autocompleteZshCmd represents the completion command
var autocompleteZshCmd = &cobra.Command{
Use: "zsh-autocomplete",
Short: "Generate script for zsh autocomplete",
Long: `add the following line to ~/.bashrc: source <(dodas zsh-autocomplete)`,
Run: func(cmd *cobra.Command, args []string) {
rootCmd.GenZshCompletion(os.Stdout);
},
}

func init() {
rootCmd.AddCommand(completitionCmd)
rootCmd.AddCommand(completitionZshCmd)
rootCmd.AddCommand(autocompleteCmd)
rootCmd.AddCommand(autocompleteZshCmd)

// Here you will define your flags and configuration settings.

Expand Down
13 changes: 10 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Download the binary from the latest release on [github](https://github.com/Cloud-PG/dodas-go-client/releases). For instance:

```bash
wget https://github.com/Cloud-PG/dodas-go-client/releases/download/v0.3.2/dodas.zip
wget https://github.com/Cloud-PG/dodas-go-client/releases/download/v0.3.2-patch1/dodas.zip
unzip dodas.zip
cp dodas /usr/local/bin
```
Expand All @@ -19,8 +19,8 @@ cp dodas /usr/local/bin
>
> Autocompletion for bash and zsh is supported
>
> - **bash** add the following line to ~/.bashrc: `. <(dodas completition)`
> - **zsh** add the following line to ~/.zshrc: `source <(dodas zsh-completition)`
> - **bash** add the following line to ~/.bashrc: `. <(dodas autocomplete)`
> - **zsh** add the following line to ~/.zshrc: `source <(dodas zsh-autocomplete)`
You can find now a template for creating your client configuration file in [config/client_config.yaml](https://raw.githubusercontent.com/Cloud-PG/dodas-go-client/master/config/client_config.yaml). Note that by default the client will look for `$HOME/.dodas.yaml`.

Expand All @@ -42,6 +42,13 @@ To list the Infrastructure ID of all your deployments:
dodas list infIDs
```

You can eventually login into a vm in created cluster that has a public IP address with:

```bash
dodas login <infID> <vmID>
# e.g. dodas login cb585e5c-33b6-11ea-8776-0242ac150003 0
```

## Using docker image

In alternative you can create a docker image with the compiled client inside with:
Expand Down
4 changes: 2 additions & 2 deletions docs/dodas.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ dodas [flags]

### SEE ALSO

* [dodas completition](dodas_completition.md) - A brief description of your command
* [dodas autocomplete](dodas_autocomplete.md) - Generate script for bash autocomplete
* [dodas create](dodas_create.md) - Create a cluster from a TOSCA template
* [dodas destroy](dodas_destroy.md) - Destroy infrastructure with this InfID
* [dodas get](dodas_get.md) - Wrapper command for get operations
* [dodas list](dodas_list.md) - Wrapper function for list operations
* [dodas login](dodas_login.md) - ssh login into a deployed vm
* [dodas validate](dodas_validate.md) - Validate your tosca template
* [dodas version](dodas_version.md) - Client version
* [dodas zsh-completition](dodas_zsh-completition.md) - A brief description of your command
* [dodas zsh-autocomplete](dodas_zsh-autocomplete.md) - Generate script for zsh autocomplete

###### Auto generated by spf13/cobra on 16-Jan-2020
29 changes: 29 additions & 0 deletions docs/dodas_autocomplete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## dodas autocomplete

Generate script for bash autocomplete

### Synopsis

add the following line to ~/.bashrc: . <(dodas autocomplete)

```
dodas autocomplete [flags]
```

### Options

```
-h, --help help for autocomplete
```

### Options inherited from parent commands

```
--config string DODAS config file (default is $HOME/.dodas.yaml)
```

### SEE ALSO

* [dodas](dodas.md) - A self-sufficient client for DODAS deployments

###### Auto generated by spf13/cobra on 16-Jan-2020
29 changes: 29 additions & 0 deletions docs/dodas_zsh-autocomplete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## dodas zsh-autocomplete

Generate script for zsh autocomplete

### Synopsis

add the following line to ~/.bashrc: source <(dodas zsh-autocomplete)

```
dodas zsh-autocomplete [flags]
```

### Options

```
-h, --help help for zsh-autocomplete
```

### Options inherited from parent commands

```
--config string DODAS config file (default is $HOME/.dodas.yaml)
```

### SEE ALSO

* [dodas](dodas.md) - A self-sufficient client for DODAS deployments

###### Auto generated by spf13/cobra on 16-Jan-2020
4 changes: 2 additions & 2 deletions version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package main
const (
VERSION = "v0.3.2"
BUILD_DATE = "2020-01-16 08:39"
VERSION = "v0.3.2-patch1"
BUILD_DATE = "2020-01-16 09:24"
)

0 comments on commit 29c3ea7

Please sign in to comment.