Skip to content

Commit

Permalink
fix: check for doc deviations (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
lechnerc77 authored Sep 13, 2024
1 parent 42994b1 commit 1d42f56
Show file tree
Hide file tree
Showing 25 changed files with 135 additions and 135 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ body:
Describe the steps to reproduce the observed behavior.
placeholder: |
1. Execute the command `btptfexporter --help`
1. Execute the command `btptfexport --help`
2. Execute the command ...
validations:
required: false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ jobs:
- run: go run main.go gendoc
- name: git diff
run: |
git diff --compact-summary --exit-code || \
git add .
git diff --staged --compact-summary --no-color --exit-code || \
(echo; echo "Unexpected difference docu generation. Run 'make docs' command and commit."; exit 1)
test:
if: github.event.pull_request.draft == false
name: Unit Tests
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{
"id": "cliArgs",
"type": "promptString",
"description": "Args for launching btptfexporter CLI. Use --cwd to set the working directory.",
"description": "Args for launching btptfexport CLI. Use --cwd to set the working directory.",
"default": "resource all -s"
}
]
Expand Down
2 changes: 1 addition & 1 deletion .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ autocompletion
breakpoint
BTP
btp
btptfexporter
btptfexport
CLA
CLI
config
Expand Down
4 changes: 2 additions & 2 deletions DEVELOPER-GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ TBD

## Debug the CLI

We provide a configuration for debugging the btptfexporter commands in VS Code. The configuration is available in the `.vscode` directory as `launch.json`
We provide a configuration for debugging the btptfexport commands in VS Code. The configuration is available in the `.vscode` directory as `launch.json`

Here is an example on how to debug the command `btptfexporter resource all`:
Here is an example on how to debug the command `btptfexport resource all`:

1. Set a breakpoint in the file `cmd/exportAll.go` in the run section of the command:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ How to set the parameters depends on your setup and is OS-specific:
## Commands
The CLI offers several commands for the export of Terraform configurations of SAP BTP. You find a comprehensive overview of the commands and the options in the [documentation](./docs/btptfexporter.md).
The CLI offers several commands for the export of Terraform configurations of SAP BTP. You find a comprehensive overview of the commands and the options in the [documentation](./docs/btptfexport.md).
## Developer Guide
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
var rootCmd = &cobra.Command{
Use: "btptfexport",
Short: "Terraform exporter for BTP",
Long: `btptfexport is a utility to generate configuration for existing btp resources that are created manually and not managed by terraform. btptfexporter help to generate configuration which then can be used by Terraform to bring that resource under terraform state.
Long: `btptfexport is a utility to generate configuration for existing btp resources that are created manually and not managed by terraform. The CLI helps to generate configuration which then can be used by Terraform to bring that resource under terraform state.
`,
DisableAutoGenTag: true,
}
Expand Down
22 changes: 22 additions & 0 deletions docs/btptfexport.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## btptfexport

Terraform exporter for BTP

### Synopsis

btptfexport is a utility to generate configuration for existing btp resources that are created manually and not managed by terraform. The CLI helps to generate configuration which then can be used by Terraform to bring that resource under terraform state.


### Options

```
-h, --help help for btptfexport
-t, --toggle Help message for toggle
```

### SEE ALSO

* [btptfexport completion](btptfexport_completion.md) - Generate the autocompletion script for the specified shell
* [btptfexport generate-resources-list](btptfexport_generate-resources-list.md) - Store the list of resources in a subaccount into a json file
* [btptfexport resource](btptfexport_resource.md) - Export specific btp resources from a subaccount

24 changes: 24 additions & 0 deletions docs/btptfexport_completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## btptfexport completion

Generate the autocompletion script for the specified shell

### Synopsis

Generate the autocompletion script for btptfexport for the specified shell.
See each sub-command's help for details on how to use the generated script.


### Options

```
-h, --help help for completion
```

### SEE ALSO

* [btptfexport](btptfexport.md) - Terraform exporter for BTP
* [btptfexport completion bash](btptfexport_completion_bash.md) - Generate the autocompletion script for bash
* [btptfexport completion fish](btptfexport_completion_fish.md) - Generate the autocompletion script for fish
* [btptfexport completion powershell](btptfexport_completion_powershell.md) - Generate the autocompletion script for powershell
* [btptfexport completion zsh](btptfexport_completion_zsh.md) - Generate the autocompletion script for zsh

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## btptfexporter completion bash
## btptfexport completion bash

Generate the autocompletion script for bash

Expand All @@ -11,23 +11,23 @@ If it is not installed already, you can install it via your OS's package manager

To load completions in your current shell session:

source <(btptfexporter completion bash)
source <(btptfexport completion bash)

To load completions for every new session, execute once:

#### Linux:

btptfexporter completion bash > /etc/bash_completion.d/btptfexporter
btptfexport completion bash > /etc/bash_completion.d/btptfexport

#### macOS:

btptfexporter completion bash > $(brew --prefix)/etc/bash_completion.d/btptfexporter
btptfexport completion bash > $(brew --prefix)/etc/bash_completion.d/btptfexport

You will need to start a new shell for this setup to take effect.


```
btptfexporter completion bash
btptfexport completion bash
```

### Options
Expand All @@ -39,5 +39,5 @@ btptfexporter completion bash

### SEE ALSO

* [btptfexporter completion](btptfexporter_completion.md) - Generate the autocompletion script for the specified shell
* [btptfexport completion](btptfexport_completion.md) - Generate the autocompletion script for the specified shell

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## btptfexporter completion fish
## btptfexport completion fish

Generate the autocompletion script for fish

Expand All @@ -8,17 +8,17 @@ Generate the autocompletion script for the fish shell.

To load completions in your current shell session:

btptfexporter completion fish | source
btptfexport completion fish | source

To load completions for every new session, execute once:

btptfexporter completion fish > ~/.config/fish/completions/btptfexporter.fish
btptfexport completion fish > ~/.config/fish/completions/btptfexport.fish

You will need to start a new shell for this setup to take effect.


```
btptfexporter completion fish [flags]
btptfexport completion fish [flags]
```

### Options
Expand All @@ -30,5 +30,5 @@ btptfexporter completion fish [flags]

### SEE ALSO

* [btptfexporter completion](btptfexporter_completion.md) - Generate the autocompletion script for the specified shell
* [btptfexport completion](btptfexport_completion.md) - Generate the autocompletion script for the specified shell

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## btptfexporter completion powershell
## btptfexport completion powershell

Generate the autocompletion script for powershell

Expand All @@ -8,14 +8,14 @@ Generate the autocompletion script for powershell.

To load completions in your current shell session:

btptfexporter completion powershell | Out-String | Invoke-Expression
btptfexport completion powershell | Out-String | Invoke-Expression

To load completions for every new session, add the output of the above command
to your powershell profile.


```
btptfexporter completion powershell [flags]
btptfexport completion powershell [flags]
```

### Options
Expand All @@ -27,5 +27,5 @@ btptfexporter completion powershell [flags]

### SEE ALSO

* [btptfexporter completion](btptfexporter_completion.md) - Generate the autocompletion script for the specified shell
* [btptfexport completion](btptfexport_completion.md) - Generate the autocompletion script for the specified shell

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## btptfexporter completion zsh
## btptfexport completion zsh

Generate the autocompletion script for zsh

Expand All @@ -13,23 +13,23 @@ to enable it. You can execute the following once:

To load completions in your current shell session:

source <(btptfexporter completion zsh)
source <(btptfexport completion zsh)

To load completions for every new session, execute once:

#### Linux:

btptfexporter completion zsh > "${fpath[1]}/_btptfexporter"
btptfexport completion zsh > "${fpath[1]}/_btptfexport"

#### macOS:

btptfexporter completion zsh > $(brew --prefix)/share/zsh/site-functions/_btptfexporter
btptfexport completion zsh > $(brew --prefix)/share/zsh/site-functions/_btptfexport

You will need to start a new shell for this setup to take effect.


```
btptfexporter completion zsh [flags]
btptfexport completion zsh [flags]
```

### Options
Expand All @@ -41,5 +41,5 @@ btptfexporter completion zsh [flags]

### SEE ALSO

* [btptfexporter completion](btptfexporter_completion.md) - Generate the autocompletion script for the specified shell
* [btptfexport completion](btptfexport_completion.md) - Generate the autocompletion script for the specified shell

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## btptfexporter generate-resources-list
## btptfexport generate-resources-list

Store the list of resources in a subaccount into a json file

Expand All @@ -9,8 +9,8 @@ It will then store this list into a file.

For example:

btptfexporter generate-resources-list --resources=subaccount,entitlements -s <subaccount-id>
btptfexporter generate-resources-list --resources=all -s <subaccount-id> -j <file-name.json>
btptfexport generate-resources-list --resources=subaccount,entitlements -s <subaccount-id>
btptfexport generate-resources-list --resources=all -s <subaccount-id> -j <file-name.json>

Valid resources are:
- subaccount
Expand All @@ -27,7 +27,7 @@ Mixing "all" with other resources will throw an error.


```
btptfexporter generate-resources-list [flags]
btptfexport generate-resources-list [flags]
```

### Options
Expand All @@ -41,5 +41,5 @@ btptfexporter generate-resources-list [flags]

### SEE ALSO

* [btptfexporter](btptfexporter.md) - Terraform exporter for BTP
* [btptfexport](btptfexport.md) - Terraform exporter for BTP

33 changes: 33 additions & 0 deletions docs/btptfexport_resource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## btptfexport resource

Export specific btp resources from a subaccount

### Synopsis


This command is used when you need to export specific resources.
By default, it will generate the <resource_name>_import.tf (import file) and resources.tf (resource file) files.
The resources.tf file can be renamed by using the flag --resourceFileName.
The command will fail if a resource file already exists

```
btptfexport resource [flags]
```

### Options

```
-h, --help help for resource
```

### SEE ALSO

* [btptfexport](btptfexport.md) - Terraform exporter for BTP
* [btptfexport resource all](btptfexport_resource_all.md) - export all resources of a subaccount
* [btptfexport resource entitlements](btptfexport_resource_entitlements.md) - export entitlements of a subaccount
* [btptfexport resource environment-instances](btptfexport_resource_environment-instances.md) - export environment instance of a subaccount
* [btptfexport resource from-file](btptfexport_resource_from-file.md) - export resources from a json file.
* [btptfexport resource subaccount](btptfexport_resource_subaccount.md) - export subaccount
* [btptfexport resource subscriptions](btptfexport_resource_subscriptions.md) - export subscriptions of a subaccount
* [btptfexport resource trust-configurations](btptfexport_resource_trust-configurations.md) - export trust configurations of a subaccount

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## btptfexporter resource all
## btptfexport resource all

export all resources of a subaccount

Expand All @@ -10,7 +10,7 @@ export all is a single command to export btp_subaccount, btp_subaccount_entitlem
btp_subaccount_trust_configurations

```
btptfexporter resource all [flags]
btptfexport resource all [flags]
```

### Options
Expand All @@ -24,5 +24,5 @@ btptfexporter resource all [flags]

### SEE ALSO

* [btptfexporter resource](btptfexporter_resource.md) - Export specific btp resources from a subaccount
* [btptfexport resource](btptfexport_resource.md) - Export specific btp resources from a subaccount

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## btptfexporter resource entitlements
## btptfexport resource entitlements

export entitlements of a subaccount

Expand All @@ -7,7 +7,7 @@ export entitlements of a subaccount
export entitlements will export all the entitlements of the given subaccount and generate resource configuration for it

```
btptfexporter resource entitlements [flags]
btptfexport resource entitlements [flags]
```

### Options
Expand All @@ -21,5 +21,5 @@ btptfexporter resource entitlements [flags]

### SEE ALSO

* [btptfexporter resource](btptfexporter_resource.md) - Export specific btp resources from a subaccount
* [btptfexport resource](btptfexport_resource.md) - Export specific btp resources from a subaccount

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## btptfexporter resource environment-instances
## btptfexport resource environment-instances

export environment instance of a subaccount

Expand All @@ -7,7 +7,7 @@ export environment instance of a subaccount
export environment-instance will export all the environment instance of the given subaccount and generate resource configuration for it

```
btptfexporter resource environment-instances [flags]
btptfexport resource environment-instances [flags]
```

### Options
Expand All @@ -21,5 +21,5 @@ btptfexporter resource environment-instances [flags]

### SEE ALSO

* [btptfexporter resource](btptfexporter_resource.md) - Export specific btp resources from a subaccount
* [btptfexport resource](btptfexport_resource.md) - Export specific btp resources from a subaccount

Loading

0 comments on commit 1d42f56

Please sign in to comment.