-
Notifications
You must be signed in to change notification settings - Fork 135
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 #3 from menuka94/master
[3.0.0] Import Export CLI - PR 3
- Loading branch information
Showing
55 changed files
with
1,778 additions
and
631 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
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
# product-apim-tooling | ||
# product-apim-tooling | ||
|
||
|
||
### 1. [Import Export CLI](https://github.com/wso2/product-apim-tooling/tree/master/import-export-cli) |
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,16 @@ | ||
# Contributing | ||
|
||
Follow the following steps to make a contribution to this tool. | ||
|
||
* [Install Go (1.8.x) locally](https://golang.org/doc/install) | ||
* [Setup `$GOPATH` and `$GOROOT`](https://www.goinggo.net/2016/05/installing-go-and-your-workspace.html) | ||
* [Install Glide - Go Dependency Manager](https://github.com/Masterminds/glide#install) | ||
* Fork the respository: [wso2/product-apim-tooling](https://github.com/wso2/product-apim-tooling) | ||
* Do `git clone https://github.com/<your-username>/product-apim-tooling` | ||
|
||
NOTE: Project should be cloned such that the location would be `$GOPATH/src/github.com/wso2/product-apim-tooling` (This is mandatory for Go's dependencies to identity each other) | ||
* `cd` into `product-apim-tooling/import-export-cli` | ||
* Execute `glide install` inside `product-apim-tooling/import-export-cli` to download all dependencies | ||
* Make changes to the code | ||
* Commit to your fork | ||
* Send a pull request to [wso2/product-apim-tooling](https://github.com/wso2/product-apim-tooling) |
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,27 @@ | ||
/* | ||
* Copyright (c) WSO2 Inc. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* WSO2 Inc. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/wso2/product-apim-tooling/import-export-cli/cmd" | ||
) | ||
|
||
func main() { | ||
cmd.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# copy this file to /etc/bash_completion.d/ and source it to enable bash completion | ||
_apimcli() | ||
{ | ||
local current previous options base | ||
COMPREPLY=() | ||
current="${COMP_WORDS[COMP_CWORD]}" | ||
previous="${COMP_WORDS[COMP_CWORD-1]}" | ||
|
||
options="export-api import-api list add-env remove-env reset-user version author" | ||
|
||
case "${previous}" in | ||
export-api) | ||
local flags="--name -n --version -v --environment -e --help -h" | ||
COMPREPLY=( $(compgen -W "${flags}" -- ${current}) ) | ||
return 0 | ||
;; | ||
import-api) | ||
local flags="--name -n --environment -e --help -h" | ||
COMPREPLY=( $(compgen -W "${flags}" -- ${current}) ) | ||
return 0 | ||
;; | ||
list) | ||
local flags="apis envs" | ||
COMPREPLY=( $(compgen -W "${flags}" -- ${current}) ) | ||
return 0 | ||
;; | ||
add-env) | ||
local flags="--name -n --publisher --registration --token --help -h" | ||
COMPREPLY=( $(compgen -W "${flags}" -- ${current}) ) | ||
return 0 | ||
;; | ||
remove-env) | ||
local flags="--name -n --help -h" | ||
COMPREPLY=( $(compgen -W "${flags}" -- ${current}) ) | ||
return 0 | ||
;; | ||
reset-user) | ||
local flags="--environment -e --help -h" | ||
COMPREPLY=( $(compgen -W "${flags}" -- ${current}) ) | ||
return 0 | ||
;; | ||
set) | ||
local flags="--export-directory --http-request-timeout" | ||
COMPREPLY=( $(compgen -W "${flags}" -- ${current}) ) | ||
return 0 | ||
;; | ||
version) | ||
return 0 | ||
;; | ||
author) | ||
return 0 | ||
;; | ||
*) | ||
;; | ||
|
||
esac | ||
|
||
COMPREPLY=($(compgen -W "${options}" -- ${current})) | ||
return 0 | ||
} | ||
|
||
complete -F _apimcli apimcli | ||
complete -F _apimcli ./apimcli | ||
complete -F _apimcli import-export-cli | ||
complete -F _apimcli ./import-export-cli |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.