Skip to content

Commit

Permalink
Merge pull request redhat-developer#2 from johnmcollier/kdo-config
Browse files Browse the repository at this point in the history
Mimic odo cli organization, add config command
  • Loading branch information
Rajiv Nathan authored Jul 25, 2019
2 parents 71cb051 + 89e6041 commit c546442
Show file tree
Hide file tree
Showing 28 changed files with 4,751 additions and 14 deletions.
75 changes: 75 additions & 0 deletions .gitignore
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

22 changes: 22 additions & 0 deletions Makefile
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)
29 changes: 29 additions & 0 deletions cmd/kdo/kdo.go
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()
}
23 changes: 22 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,25 @@ module github.com/redhat-developer/odo-fork

go 1.12

require github.com/spf13/cobra v0.0.5
require (
github.com/fatih/color v1.7.0
github.com/gobwas/glob v0.2.3
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/kubernetes-incubator/service-catalog v0.2.1 // indirect
github.com/mattn/go-colorable v0.1.2
github.com/openshift/api v3.9.0+incompatible // indirect
github.com/openshift/client-go v3.9.0+incompatible // indirect
github.com/openshift/odo v0.0.20
github.com/pkg/errors v0.8.1
github.com/posener/complete v1.2.1
github.com/redhat-developer/odo v0.0.20 // indirect
github.com/spf13/cobra v0.0.5
github.com/spf13/pflag v1.0.3
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4
gopkg.in/AlecAivazis/survey.v1 v1.8.5
gopkg.in/yaml.v2 v2.2.2
k8s.io/api v0.0.0-20190718062839-c8a0b81cb10e
k8s.io/apimachinery v0.0.0-20190719140911-bfcf53abc9f8
k8s.io/client-go v0.0.0-20190717023132-0c47f9da0001
k8s.io/kubectl v0.0.0-20190720024926-08c6807d9aef
)
13 changes: 0 additions & 13 deletions main.go

This file was deleted.

File renamed without changes.
Loading

0 comments on commit c546442

Please sign in to comment.