From 0b33b56546c74d6e580547f8d46057cd7bbb2543 Mon Sep 17 00:00:00 2001 From: npamudika Date: Fri, 3 Apr 2020 12:21:06 +0530 Subject: [PATCH] Modify add-env help command examples --- import-export-cli/README.md | 6 ++--- import-export-cli/cmd/addEnv.go | 25 ++++++++--------- import-export-cli/docs/apictl_add-env.md | 25 ++++++++--------- import-export-cli/docs/apictl_set.md | 2 +- import-export-cli/resources/README.html | 27 +++++++++---------- .../apictl_zsh_completions.sh | 6 ++--- 6 files changed, 41 insertions(+), 50 deletions(-) diff --git a/import-export-cli/README.md b/import-export-cli/README.md index 9a7ddd704..ad2b53af2 100644 --- a/import-export-cli/README.md +++ b/import-export-cli/README.md @@ -52,9 +52,9 @@ Command Line tool for importing and exporting APIs/Applications between differen > NOTE: Directory structure for configuration files (`$HOME/.wso2apictl`) will be created upon execution of `apictl` Execute `apictl add-env --help` for detailed instructions - > The flag `--environment` (-e) is mandatory - You can either provide only the 2 tags `--apim` and `--token`, or all the other 5 tags (`--registration` `--publisher` `--devportal` `--admin` `--token`) without providing `--apim` tag, - or all the 6 tags to add an environment. + > The flags `--environment` (-e) and --token are mandatory + You can either provide only the 2 flags `--apim` and `--token`, or all the other 5 flags (`--registration` `--publisher` `--devportal` `--admin` `--token`) without providing `--apim` flag. + If you are omitting any of --registration --publisher --devportal --admin flags, you need to specify --apim flag with the API Manager endpoint. - ### Command Autocomplete Copy the file `shell-completions/apictl_bash_completion.sh` to `/etc/bash_completion.d/` and source it with diff --git a/import-export-cli/cmd/addEnv.go b/import-export-cli/cmd/addEnv.go index 959993411..72170f0ee 100644 --- a/import-export-cli/cmd/addEnv.go +++ b/import-export-cli/cmd/addEnv.go @@ -43,23 +43,20 @@ const addEnvCmdExamples = utils.ProjectName + ` ` + addEnvCmdLiteral + ` -e prod --token https://localhost:8243/token ` + utils.ProjectName + ` ` + addEnvCmdLiteral + ` -e test \ ---registration https://localhost:9443/client-registration/v0.16/register \ ---publisher https://localhost:9443/api/am/publisher/v1/apis \ ---devportal https://localhost:9443 \ ---admin https://localhost:9443 \ ---token https://localhost:8243/token +--registration https://idp.com:9443 \ +--publisher https://apim.com:9443 \ +--devportal https://apps.com:9443 \ +--admin https://apim.com:9443 \ +--token https://gw.com:8243/token ` + utils.ProjectName + ` ` + addEnvCmdLiteral + ` -e dev \ ---apim https://localhost:9443 \ ---registration https://localhost:9443/client-registration/v0.16/register \ ---publisher https://localhost:9443/api/am/publisher/v1/apis \ ---devportal https://localhost:9443 \ ---admin https://localhost:9443 \ ---token https://localhost:8243/token +--apim https://apim.com:9443 \ +--registration https://idp.com:9443 \ +--token https://gw.com:8243/token -NOTE: The flag --environment (-e) is mandatory -You can either provide only the 2 tags --apim and --token, or all the other 5 tags (--registration --publisher --devportal --admin --token) without providing --apim tag, -or all the 6 tags to add an environment.` +NOTE: The flags --environment (-e) and --token are mandatory +You can either provide only the 2 flags --apim and --token, or all the other 5 flags (--registration --publisher --devportal --admin --token) without providing --apim flag. +If you are omitting any of --registration --publisher --devportal --admin flags, you need to specify --apim flag with the API Manager endpoint.` // addEnvCmd represents the addEnv command var addEnvCmd = &cobra.Command{ diff --git a/import-export-cli/docs/apictl_add-env.md b/import-export-cli/docs/apictl_add-env.md index f5af01282..a022bd1d3 100644 --- a/import-export-cli/docs/apictl_add-env.md +++ b/import-export-cli/docs/apictl_add-env.md @@ -18,23 +18,20 @@ apictl add-env -e production \ --token https://localhost:8243/token apictl add-env -e test \ ---registration https://localhost:9443/client-registration/v0.16/register \ ---publisher https://localhost:9443/api/am/publisher/v1/apis \ ---devportal https://localhost:9443 \ ---admin https://localhost:9443 \ ---token https://localhost:8243/token +--registration https://idp.com:9443 \ +--publisher https://apim.com:9443 \ +--devportal https://apps.com:9443 \ +--admin https://apim.com:9443 \ +--token https://gw.com:8243/token apictl add-env -e dev \ ---apim https://localhost:9443 \ ---registration https://localhost:9443/client-registration/v0.16/register \ ---publisher https://localhost:9443/api/am/publisher/v1/apis \ ---devportal https://localhost:9443 \ ---admin https://localhost:9443 \ ---token https://localhost:8243/token +--apim https://apim.com:9443 \ +--registration https://idp.com:9443 \ +--token https://gw.com:8243/token -NOTE: The flag --environment (-e) is mandatory -You can either provide only the 2 tags --apim and --token, or all the other 5 tags (--registration --publisher --devportal --admin --token) without providing --apim tag, -or all the 6 tags to add an environment. +NOTE: The flags --environment (-e) and --token are mandatory +You can either provide only the 2 flags --apim and --token, or all the other 5 flags (--registration --publisher --devportal --admin --token) without providing --apim flag. +If you are omitting any of --registration --publisher --devportal --admin flags, you need to specify --apim flag with the API Manager endpoint. ``` ### Options diff --git a/import-export-cli/docs/apictl_set.md b/import-export-cli/docs/apictl_set.md index 2b92befb2..50361b3ef 100644 --- a/import-export-cli/docs/apictl_set.md +++ b/import-export-cli/docs/apictl_set.md @@ -28,7 +28,7 @@ apictl set --mode default ### Options ``` - --export-directory string Path to directory where APIs should be saved (default "/home/wasura/.wso2apictl/exported") + --export-directory string Path to directory where APIs should be saved (default "/home/naduni/.wso2apictl/exported") -h, --help help for set --http-request-timeout int Timeout for HTTP Client (default 10000) -m, --mode string mode of apictl diff --git a/import-export-cli/resources/README.html b/import-export-cli/resources/README.html index d32aa5a0c..e2a2e12a9 100644 --- a/import-export-cli/resources/README.html +++ b/import-export-cli/resources/README.html @@ -23,9 +23,9 @@

Getting Started

Execute apictl add-env --help for detailed instructions

-

The flag --environment (-e) is mandatory - You can either provide only the 2 tags --apim and --token, or all the other 5 tags (--registration, --publisher, --devportal, --admin, --token) without providing --apim tag, - or all the 6 tags to add an environment.

+

The flags --environment (-e) and --token are mandatory. + You can either provide only the 2 flags --apim and --token, or all the other 5 flags (--registration, --publisher, --devportal, --admin, --token) without providing --apim flag. + If you are omitting any of --registration --publisher --devportal --admin flags, you need to specify --apim flag with the API Manager endpoint.

  • Command Autocompletion (For Bash Only)

    @@ -199,22 +199,19 @@

    Commands

    Examples: apictl add-env -e dev \ --apim https://localhost:9443 \ - --token https://localhost:9443/oauth2/token + --token https://localhost:8243/token apictl add-env -e staging \ - --registration https://localhost:9443 \ - --publisher https://localhost:9443 \ - --devportal https://localhost:9443 \ - --admin https://localhost:9443 \ - --token https://localhost:9443/oauth2/token + --registration https://idp.com:9443 \ + --publisher https://apim.com:9443 \ + --devportal https://apps.com:9443 \ + --admin https://apim.com:9443 \ + --token https://gw.com:8243/token apictl add-env -e prod \ - --apim https://localhost:9443 \ - --registration https://localhost:9443 \ - --publisher https://localhost:9443 \ - --devportal https://localhost:9443 \ - --admin https://localhost:9443 \ - --token https://localhost:9443/oauth2/token + --apim https://apim.com:9443 \ + --registration https://idp.com:9443 \ + --token https://gw.com:8243/token
  • remove-env

    diff --git a/import-export-cli/shell-completions/apictl_zsh_completions.sh b/import-export-cli/shell-completions/apictl_zsh_completions.sh index fa54a2ab7..2fdb47f26 100644 --- a/import-export-cli/shell-completions/apictl_zsh_completions.sh +++ b/import-export-cli/shell-completions/apictl_zsh_completions.sh @@ -17,6 +17,9 @@ case $state in ;; level2) case $words[2] in + add) + _arguments '2: :(api help)' + ;; change) _arguments '2: :(help registry)' ;; @@ -32,9 +35,6 @@ case $state in update) _arguments '2: :(api help)' ;; - add) - _arguments '2: :(api help)' - ;; *) _arguments '*: :_files' ;;