Skip to content

Commit

Permalink
Merge pull request #40 from safesoftware/add-completion-doc
Browse files Browse the repository at this point in the history
Update docgen to include completion commands. Regen doc with updates.
  • Loading branch information
garnold54 authored Apr 28, 2023
2 parents 0b63643 + b8836cd commit ff8ff5d
Show file tree
Hide file tree
Showing 12 changed files with 246 additions and 17 deletions.
4 changes: 3 additions & 1 deletion docgen/docgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import (
)

func main() {
err := doc.GenMarkdownTree(cmd.NewRootCommand(), "../docs")
cmdRoot := cmd.NewRootCommand()
cmdRoot.InitDefaultCompletionCmd()
err := doc.GenMarkdownTree(cmdRoot, "../docs")
if err != nil {
log.Fatal(err)
}
Expand Down
1 change: 1 addition & 0 deletions docs/fmeserver.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ A command line interface for interacting with FME Server. See available commands

* [fmeserver backup](fmeserver_backup.md) - Backs up the FME Server configuration
* [fmeserver cancel](fmeserver_cancel.md) - Cancel a running job on FME Server
* [fmeserver completion](fmeserver_completion.md) - Generate the autocompletion script for the specified shell
* [fmeserver deploymentparameters](fmeserver_deploymentparameters.md) - List Deployment Parameters
* [fmeserver engines](fmeserver_engines.md) - Get information about the FME Engines
* [fmeserver healthcheck](fmeserver_healthcheck.md) - Retrieves the health status of FME Server
Expand Down
31 changes: 31 additions & 0 deletions docs/fmeserver_completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## fmeserver completion

Generate the autocompletion script for the specified shell

### Synopsis

Generate the autocompletion script for fmeserver 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
```

### Options inherited from parent commands

```
--config string config file (default is $HOME/.config/.fmeserver-cli.yaml)
--json Output JSON
```

### SEE ALSO

* [fmeserver](fmeserver.md) - A command line interface for interacting with FME Server.
* [fmeserver completion bash](fmeserver_completion_bash.md) - Generate the autocompletion script for bash
* [fmeserver completion fish](fmeserver_completion_fish.md) - Generate the autocompletion script for fish
* [fmeserver completion powershell](fmeserver_completion_powershell.md) - Generate the autocompletion script for powershell
* [fmeserver completion zsh](fmeserver_completion_zsh.md) - Generate the autocompletion script for zsh

50 changes: 50 additions & 0 deletions docs/fmeserver_completion_bash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
## fmeserver completion bash

Generate the autocompletion script for bash

### Synopsis

Generate the autocompletion script for the bash shell.

This script depends on the 'bash-completion' package.
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 <(fmeserver completion bash)

To load completions for every new session, execute once:

#### Linux:

fmeserver completion bash > /etc/bash_completion.d/fmeserver

#### macOS:

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

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


```
fmeserver completion bash
```

### Options

```
-h, --help help for bash
--no-descriptions disable completion descriptions
```

### Options inherited from parent commands

```
--config string config file (default is $HOME/.config/.fmeserver-cli.yaml)
--json Output JSON
```

### SEE ALSO

* [fmeserver completion](fmeserver_completion.md) - Generate the autocompletion script for the specified shell

41 changes: 41 additions & 0 deletions docs/fmeserver_completion_fish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## fmeserver completion fish

Generate the autocompletion script for fish

### Synopsis

Generate the autocompletion script for the fish shell.

To load completions in your current shell session:

fmeserver completion fish | source

To load completions for every new session, execute once:

fmeserver completion fish > ~/.config/fish/completions/fmeserver.fish

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


```
fmeserver completion fish [flags]
```

### Options

```
-h, --help help for fish
--no-descriptions disable completion descriptions
```

### Options inherited from parent commands

```
--config string config file (default is $HOME/.config/.fmeserver-cli.yaml)
--json Output JSON
```

### SEE ALSO

* [fmeserver completion](fmeserver_completion.md) - Generate the autocompletion script for the specified shell

38 changes: 38 additions & 0 deletions docs/fmeserver_completion_powershell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## fmeserver completion powershell

Generate the autocompletion script for powershell

### Synopsis

Generate the autocompletion script for powershell.

To load completions in your current shell session:

fmeserver completion powershell | Out-String | Invoke-Expression

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


```
fmeserver completion powershell [flags]
```

### Options

```
-h, --help help for powershell
--no-descriptions disable completion descriptions
```

### Options inherited from parent commands

```
--config string config file (default is $HOME/.config/.fmeserver-cli.yaml)
--json Output JSON
```

### SEE ALSO

* [fmeserver completion](fmeserver_completion.md) - Generate the autocompletion script for the specified shell

52 changes: 52 additions & 0 deletions docs/fmeserver_completion_zsh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
## fmeserver completion zsh

Generate the autocompletion script for zsh

### Synopsis

Generate the autocompletion script for the zsh shell.

If shell completion is not already enabled in your environment you will need
to enable it. You can execute the following once:

echo "autoload -U compinit; compinit" >> ~/.zshrc

To load completions in your current shell session:

source <(fmeserver completion zsh); compdef _fmeserver fmeserver

To load completions for every new session, execute once:

#### Linux:

fmeserver completion zsh > "${fpath[1]}/_fmeserver"

#### macOS:

fmeserver completion zsh > $(brew --prefix)/share/zsh/site-functions/_fmeserver

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


```
fmeserver completion zsh [flags]
```

### Options

```
-h, --help help for zsh
--no-descriptions disable completion descriptions
```

### Options inherited from parent commands

```
--config string config file (default is $HOME/.config/.fmeserver-cli.yaml)
--json Output JSON
```

### SEE ALSO

* [fmeserver completion](fmeserver_completion.md) - Generate the autocompletion script for the specified shell

2 changes: 1 addition & 1 deletion docs/fmeserver_deploymentparameters_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fmeserver deploymentparameters create [flags]
Examples:
# Create a deployment parameter with the name "myParam" and the value "myValue"
fmeserver deploymentparameter create --name myParam --value myValue
fmeserver deploymentparameters create --name myParam --value myValue
```

Expand Down
4 changes: 2 additions & 2 deletions docs/fmeserver_deploymentparameters_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ fmeserver deploymentparameters delete [flags]
Examples:
# Delete adeployment parameter with the name "myParam"
fmeserver deploymentparameter delete --name myParam
fmeserver deploymentparameters delete --name myParam
# Delete a repository with the name "myRepository" and no confirmation
fmeserver deploymentparameter delete --name myParam --no-prompt
fmeserver deploymentparameters delete --name myParam --no-prompt
```

Expand Down
2 changes: 1 addition & 1 deletion docs/fmeserver_deploymentparameters_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fmeserver deploymentparameters update [flags]
Examples:
# Update a deployment parameter with the name "myParam" and the value "myValue"
fmeserver deploymentparameter update --name myParam --value myValue
fmeserver deploymentparameters update --name myParam --value myValue
```

Expand Down
13 changes: 12 additions & 1 deletion docs/fmeserver_healthcheck.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Retrieves the health status of FME Server

### Synopsis

Retrieves the health status of FME Server. The health status is normal if the FME Server REST API is responsive. Note that this endpoint does not require authentication. Load balancer or other systems can monitor FME Server using this endpoint without supplying token or password credentials.
Retrieves the health status of FME Server. The health status is normal if the FME Server REST API is responsive. Note that this endpoint does not require authentication. This command can be used without calling the login command first. The FME Server url can be passed in using the --url flag without needing a config file. A config file without a token can also be used.

```
fmeserver healthcheck [flags]
Expand All @@ -25,6 +25,16 @@ fmeserver healthcheck [flags]
# Check that the FME Server is healthy and output just the status
fmeserver healthcheck --output=custom-columns=STATUS:.status
# Check the FME Server is healthy without needing a config file
fmeserver healthcheck --url https://my-fmeserver.internal
# Check the FME Server is healthy with a manually created config file
cat << EOF >fmeserver-cli.yaml
build: 23235
url: https://my-fmeserver.internal
EOF
fmeserver healthcheck --config fmeserver-cli.yaml
```

### Options
Expand All @@ -34,6 +44,7 @@ fmeserver healthcheck [flags]
--no-headers Don't print column headers
-o, --output string Specify the output type. Should be one of table, json, or custom-columns (default "table")
--ready The health check will report the status of FME Server if it is ready to process jobs.
--url string The base URL of the FME Server to check the health of. Pass this in if checking the health of an FME Server that you haven't called the login command for.
```

### Options inherited from parent commands
Expand Down
25 changes: 14 additions & 11 deletions docs/fmeserver_login.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,25 @@ Save credentials for an FME Server
Update the config file with the credentials to connect to FME Server. If just a URL is passed in, you will be prompted for a user and password for the FME Server. This will be used to generate an API token that will be saved to the config file for use connecting to FME Server.
Use the --token flag to pass in an existing API token. To log in with a password on the command line without being prompted, place the password in a text file and pass that in using the --password-file flag.
This will overwrite any existing credentials saved.

Examples:

# Prompt for user and password for the given FME Server URL
fmeserver login https://my-fmeserver.internal

# Login to an FME Server using a pre-generated token
fmeserver login https://my-fmeserver.internal --token 5937391ad3a87f19ba14dc6082867373087d031b

# Login to an FME Server using a passed in user and password file
fmeserver login https://my-fmeserver.internal --user admin --password passw0rd

```
fmeserver login [URL] [flags]
```

### Examples

```
# Prompt for user and password for the given FME Server URL
fmeserver login https://my-fmeserver.internal
# Login to an FME Server using a pre-generated token
fmeserver login https://my-fmeserver.internal --token 5937391ad3a87f19ba14dc6082867373087d031b
# Login to an FME Server using a passed in user and password file (The password is contained in a file at the path /path/to/password-file)
fmeserver login https://my-fmeserver.internal --user admin --password-file /path/to/password-file
```

### Options

```
Expand Down

0 comments on commit ff8ff5d

Please sign in to comment.