forked from redhat-developer/odo
-
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.
Merge pull request redhat-developer#2 from johnmcollier/kdo-config
Mimic odo cli organization, add config command
- Loading branch information
Showing
28 changed files
with
4,751 additions
and
14 deletions.
There are no files selected for viewing
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,75 @@ | ||
# | ||
# ODO SPECIFIC | ||
# | ||
|
||
# Ignore compiled files | ||
kdo | ||
dist | ||
bin | ||
|
||
# Un-ignore odo directories | ||
!kdo/ | ||
|
||
# Ignore coverage report | ||
coverage.txt | ||
|
||
# | ||
# GO SPECIFIC | ||
# | ||
|
||
# Compiled Object files, Static and Dynamic libs (Shared Objects) | ||
*.o | ||
*.a | ||
*.so | ||
|
||
# Folders | ||
_obj | ||
_test | ||
|
||
# Architecture specific extensions/prefixes | ||
*.[568vq] | ||
[568vq].out | ||
|
||
*.cgo1.go | ||
*.cgo2.c | ||
_cgo_defun.c | ||
_cgo_gotypes.go | ||
_cgo_export.* | ||
|
||
_testmain.go | ||
|
||
*.exe | ||
*.test | ||
*.prof | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Site specific | ||
site/_site | ||
site/docs | ||
|
||
# | ||
# VIM SPECIFIC | ||
# | ||
|
||
# swap | ||
[._]*.s[a-w][a-z] | ||
[._]s[a-w][a-z] | ||
|
||
# session | ||
Session.vim | ||
|
||
# temporary | ||
.netrwhist | ||
*~ | ||
|
||
# auto-generated tag files | ||
tags | ||
|
||
# IntelliJ IDE specific | ||
.idea | ||
|
||
# VSCode specific | ||
.vscode | ||
|
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,22 @@ | ||
PROJECT := github.com/redhat-developer/kdo | ||
GITCOMMIT := $(shell git rev-parse --short HEAD 2>/dev/null) | ||
PKGS := $(shell go list ./... | grep -v $(PROJECT)/vendor | grep -v $(PROJECT)/tests ) | ||
COMMON_FLAGS := -X $(PROJECT)/pkg/kdo/cli/version.GITCOMMIT=$(GITCOMMIT) | ||
BUILD_FLAGS := -ldflags="-w $(COMMON_FLAGS)" | ||
DEBUG_BUILD_FLAGS := -ldflags="$(COMMON_FLAGS)" | ||
FILES := odo dist | ||
TIMEOUT ?= 1800s | ||
|
||
default: bin | ||
|
||
.PHONY: bin | ||
bin: | ||
go build ${BUILD_FLAGS} cmd/kdo/kdo.go | ||
|
||
.PHONY: install | ||
install: | ||
go install ${BUILD_FLAGS} ./cmd/kdo/ | ||
|
||
.PHONY: clean | ||
clean: | ||
@rm -rf $(FILES) |
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,29 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"os" | ||
|
||
"github.com/redhat-developer/odo-fork/pkg/kdo/cli" | ||
) | ||
|
||
func main() { | ||
var root = cli.NewCmdKdo(cli.KdoRecommendedName, cli.KdoRecommendedName) | ||
|
||
// override usage so that flag.Parse uses root command's usage instead of default one when invoked with -h | ||
root.Flags().AddGoFlagSet(flag.CommandLine) | ||
flag.Usage = func() { | ||
_ = root.Help() | ||
} | ||
|
||
// parse the flags but hack around to avoid exiting with error code 2 on help | ||
flag.CommandLine.Init(os.Args[0], flag.ContinueOnError) | ||
args := os.Args[1:] | ||
if err := flag.CommandLine.Parse(args); err != nil { | ||
if err == flag.ErrHelp { | ||
os.Exit(0) | ||
} | ||
} | ||
|
||
root.Execute() | ||
} |
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
File renamed without changes.
Oops, something went wrong.