This repository has been archived by the owner on Jun 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
259 additions
and
197 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package cmd | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
var CompletionCmd = &cobra.Command{ | ||
Use: "completion", | ||
Aliases: []string{"completions"}, | ||
Short: "Generate completion helpers for your terminal", | ||
Long: "Generate completion helpers for your terminal", | ||
} | ||
|
||
var BashCompletionLong = `Generate Bash completions | ||
To load completion run | ||
. <(mvs completion bash) | ||
To configure your bash shell to load completions for each session add to your bashrc | ||
# ~/.bashrc or ~/.profile | ||
. <(mvs completion bash) | ||
` | ||
|
||
var BashCompletionCmd = &cobra.Command{ | ||
Use: "bash", | ||
Short: "Generate Bash completions", | ||
Long: BashCompletionLong, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
RootCmd.GenBashCompletion(os.Stdout) | ||
}, | ||
} | ||
|
||
var ZshCompletionCmd = &cobra.Command{ | ||
Use: "zsh", | ||
Short: "Generate Zsh completions", | ||
Long: "Generate Zsh completions", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
RootCmd.GenZshCompletion(os.Stdout) | ||
}, | ||
} | ||
|
||
var FishCompletionCmd = &cobra.Command{ | ||
Use: "fish", | ||
Short: "Generate Fish completions", | ||
Long: "Generate Fish completions", | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
RootCmd.GenZshCompletion(os.Stdout) | ||
}, | ||
} | ||
|
||
var PowerShellCompletionCmd = &cobra.Command{ | ||
Use: "power-shell", | ||
Aliases: []string{"windows", "win", "power", "ps"}, | ||
Short: "Generate PowerShell completions", | ||
Long: "Generate PowerShell completions", | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
RootCmd.GenPowerShellCompletion(os.Stdout) | ||
}, | ||
} | ||
|
||
func init() { | ||
CompletionCmd.AddCommand(BashCompletionCmd) | ||
CompletionCmd.AddCommand(ZshCompletionCmd) | ||
CompletionCmd.AddCommand(FishCompletionCmd) | ||
CompletionCmd.AddCommand(PowerShellCompletionCmd) | ||
|
||
RootCmd.AddCommand(CompletionCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
project_name: "mvs" | ||
|
||
before: | ||
hooks: | ||
- go mod vendor | ||
|
||
builds: | ||
- binary: "mvs" | ||
main: main.go | ||
|
||
ldflags: | ||
- -s -w | ||
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.Version={{.Version}} | ||
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.Commit={{.FullCommit}} | ||
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.BuildDate={{.Date}} | ||
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.GoVersion=go1.14 | ||
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.BuildOS={{.Os}} | ||
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.BuildArch={{.Arch}} | ||
- -X github.com/hofstadter-io/mvs/cmd/mvs/cmd.BuildArm={{.Arm}} | ||
|
||
env: | ||
- CGO_ENABLED=0 | ||
|
||
goos: | ||
- darwin | ||
- linux | ||
- windows | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
- arm | ||
|
||
ignore: | ||
- goos: linux | ||
goarch: arm | ||
|
||
|
||
snapshot: | ||
name_template: "{{ .Tag }}-SNAPSHOT-{{.ShortCommit}}" | ||
|
||
archives: | ||
- format: binary | ||
replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
amd64: x86_64 | ||
# Needed hack for binary only uploads | ||
# For more information, check #602 | ||
files: | ||
- "thisfiledoesnotexist*" | ||
|
||
|
||
checksum: | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
|
||
|
||
release: | ||
disable: true | ||
draft: true | ||
github: | ||
owner: hofstadter-io | ||
name: mvs | ||
|
||
dockers: | ||
- binaries: | ||
- mvs | ||
skip_push: true | ||
dockerfile: ci/docker/Dockerfile.jessie | ||
image_templates: | ||
- "hofstadter/{{.ProjectName}}:{{.Tag}}" | ||
- "hofstadter/{{.ProjectName}}:v{{ .Major }}.{{ .Minor }}" | ||
- "hofstadter/{{.ProjectName}}:v{{ .Major }}" | ||
- "hofstadter/{{.ProjectName}}:latest" | ||
|
||
- "hofstadter/{{.ProjectName}}:{{.Tag}}-debian" | ||
- "hofstadter/{{.ProjectName}}:v{{ .Major }}.{{ .Minor }}-debian" | ||
- "hofstadter/{{.ProjectName}}:v{{ .Major }}-debian" | ||
- "hofstadter/{{.ProjectName}}:latest-debian" | ||
|
||
|
||
- binaries: | ||
- mvs | ||
skip_push: true | ||
dockerfile: ci/docker/Dockerfile.scratch | ||
image_templates: | ||
- "hofstadter/{{.ProjectName}}:{{.Tag}}-scratch" | ||
- "hofstadter/{{.ProjectName}}:v{{ .Major }}.{{ .Minor }}-scratch" | ||
- "hofstadter/{{.ProjectName}}:v{{ .Major }}-scratch" | ||
- "hofstadter/{{.ProjectName}}:latest-scratch" |
Oops, something went wrong.