Skip to content
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
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,63 @@ npx skills add https://github.com/Demogorgon314/mat-cli --skill mat-cli-heapdump
2. Unzip it.
3. Run `./mat-cli --help` from the extracted directory.

### Shell Completion

`mat-cli` ships first-party `bash` and `zsh` completion scripts in the release archive:

- `completion/bash/mat-cli`
- `completion/zsh/_mat-cli`

You can also generate the same scripts at runtime:

```bash
./mat-cli completion bash
./mat-cli completion zsh
```

Temporary activation in the current shell:

```bash
source <(./mat-cli completion bash)
source <(./mat-cli completion zsh)
```

Persistent `bash` installation:

```bash
mkdir -p ~/.local/share/bash-completion/completions
cp ./completion/bash/mat-cli ~/.local/share/bash-completion/completions/mat-cli
```

Or generate it directly:

```bash
mkdir -p ~/.local/share/bash-completion/completions
./mat-cli completion bash > ~/.local/share/bash-completion/completions/mat-cli
```

Persistent `zsh` installation:

```bash
mkdir -p ~/.zfunc
cp ./completion/zsh/_mat-cli ~/.zfunc/_mat-cli
```

Or generate it directly:

```bash
mkdir -p ~/.zfunc
./mat-cli completion zsh > ~/.zfunc/_mat-cli
```

If your `zsh` setup does not already load `~/.zfunc`, add this once to your shell startup file before `compinit`:

```zsh
fpath=(~/.zfunc $fpath)
autoload -Uz compinit
compinit
```

## Requirements

- Java 17 or newer to run the standalone release
Expand All @@ -68,6 +125,7 @@ Useful discovery commands:
- `mat-cli schema <command> --format json`
- `mat-cli list-queries --format json`
- `mat-cli describe-query <query-id> --format json`
- `mat-cli completion <bash|zsh>`

## Example Workflows

Expand Down
4 changes: 3 additions & 1 deletion features/org.eclipse.mat.cli.feature/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ bin.includes = feature.xml,\
build.properties

root=file:rootfiles/notice.html,\
file:rootfiles/.eclipseproduct
file:rootfiles/.eclipseproduct,\
file:rootfiles/completion/bash/mat-cli,\
file:rootfiles/completion/zsh/_mat-cli

root.win32.win32.x86_64=file:rootfiles/win32/mat-cli.bat

Expand Down
Loading
Loading