Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor docs fixes to completion feature #59

Merged
merged 1 commit into from
Aug 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,25 +330,12 @@ example to display a full name in the format `Lastname Firstname` instead of

# Completion

`fakedata` supports shell tab completion for bash and zsh shells. To enable
completion execute one of the following commands to append the completion
function to your `.bashrc` or `.zshrc` file.
`fakedata` supports shell tab completion for bash and zsh shells:

```sh
$ fakedata --completion bash >> $HOME/.bashrc
$ fakedata --completion zsh >> $HOME/.zshrc
$ eval "$(fakedata --completion zsh)" # or bash
```

Alternatively for bash you can also add a file to `/etc/bash_completion.d/`
named `fakedata`:

```sh
$ fakedata --completion bash >> /etc/bash_completion.d/fakedata
```

As of now you'll need to update the `/etc/bash_completion.d/fakedata` file or
the function inside `.bashrc` / `.zshrc` when you update fakedata.

# How to install

## Homebrew
Expand Down
2 changes: 1 addition & 1 deletion pkg/fakedata/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func GetCompletionFunc(shell string) (string, error) {
}

pflag.VisitAll(func(f *pflag.Flag) {
fmt.Fprintf(allCliArgs, "-%s --%s ", f.Shorthand, f.Name)
fmt.Fprintf(allCliArgs, "--%s ", f.Name)
})

cmdList := gens.String() + " " + allCliArgs.String()
Expand Down