Skip to content

Commit

Permalink
Merge pull request #23 from stuartleeks/sl/docs
Browse files Browse the repository at this point in the history
Add Windows Terminal and completion info
  • Loading branch information
stuartleeks committed Jul 10, 2020
2 parents e8b29f8 + a22d11d commit 8534e00
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ sudo -E ./install.sh
To enable bash completion, add the following to you `~/.bashrc` file:

```bash
. <(devcontainer completion bash)
source <(devcontainer completion bash)
```

Or to alias `devcontainer` (to `dc` in this example):

```bash
alias dc=devcontainer
source <(devcontainer completion bash | sed s/devcontainer/dc/g)
```

## Usage
Expand Down Expand Up @@ -60,6 +67,16 @@ Specify the devcontainer to use:
0
```

You can use this with Windows Terminal profiles:

```json
{
"guid": "{4b304185-99d2-493c-940c-ae74e0f14bba}",
"hidden": false,
"name": "devcontainer exec",
"commandline": "wsl bash -c \"path/to/devcontainer exec ? bash\"",
},
```

### Working with devcontainer templates

Expand Down
7 changes: 6 additions & 1 deletion cmd/devcontainer/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ func createCompleteCommand(rootCmd *cobra.Command) *cobra.Command {
For example, to configure your bash shell to load completions for each session add to your bashrc
# ~/.bashrc or ~/.profile
. <(devcontainer completion)
source <(devcontainer completion)
# if you want to alias the CLI:
alias dc=devcontainer
source <(devcontainer completion bash | sed s/devcontainer/dc/g)
`,
RunE: func(cmd *cobra.Command, args []string) error {
if len(args) != 1 {
Expand Down

0 comments on commit 8534e00

Please sign in to comment.