Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

Added version flag#169

Merged
ammario merged 16 commits intocoder:masterfrom
teddy-codes:version-flag
May 23, 2019
Merged

Added version flag#169
ammario merged 16 commits intocoder:masterfrom
teddy-codes:version-flag

Conversation

@teddy-codes
Copy link
Copy Markdown
Contributor

Resolves #163

Comment thread versionmd.go Outdated
}

func (v *versioncmd) Run(fl *flag.FlagSet) {
fmt.Printf("Sail version: %s", version)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should just print the version so sail version can be more easily used in scripts.

Comment thread versionmd.go Outdated
func (v *versioncmd) Spec() cli.CommandSpec {
return cli.CommandSpec{
Name: "version",
Desc: fmt.Sprintf("Retrieve the current version"),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should end with a period

Comment thread versionmd.go Outdated
}

func (v *versioncmd) RegisterFlags(fl *flag.FlagSet) {
fl.BoolVar(&v.print, "print", false, "Print the current version of Sail")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fl.BoolVar(&v.print, "print", false, "Print the current version of Sail")
fl.BoolVar(&v.print, "print", false, "Print the current version")

Comment thread versionmd.go Outdated
var version string

type versioncmd struct {
print bool
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this variable is used

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that I was going to use it but did not. Will remove it.

Comment thread versionmd.go
"go.coder.com/cli"
)

var version string
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this populated?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ci/build.sh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, duh

@teddy-codes
Copy link
Copy Markdown
Contributor Author

@ammario All should be good now.

Comment thread versionmd.go Outdated
@teddy-codes
Copy link
Copy Markdown
Contributor Author

@ammario should be good to merge

@ammario ammario merged commit a01aa56 into coder:master May 23, 2019
@teddy-codes teddy-codes deleted the version-flag branch May 23, 2019 18:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add version flag

2 participants