# Arc Bash/Zsh Completion Scripts

This directory contains shell completion scripts for the `arc` package manager.

## Installation

### Bash Completion

**System-wide installation:**
```bash
sudo cp arc.bash /etc/bash_completion.d/arc
# or
sudo cp arc.bash /usr/share/bash-completion/completions/arc
```

**User-local installation:**
```bash
mkdir -p ~/.bash_completion.d
cp arc.bash ~/.bash_completion.d/arc
```

Then add to your `~/.bashrc`:
```bash
if [ -d ~/.bash_completion.d ]; then
    for completion in ~/.bash_completion.d/*; do
        source "$completion"
    done
fi
```

### Zsh Completion

**System-wide installation:**
```bash
sudo cp _arc /usr/share/zsh/site-functions/
# or
sudo cp _arc /usr/local/share/zsh/site-functions/
```

**User-local installation:**
```bash
mkdir -p ~/.zsh/completions
cp _arc ~/.zsh/completions/
```

Then ensure your `~/.zshrc` includes the completions directory:
```bash
fpath=(~/.zsh/completions $fpath)
autoload -U compinit && compinit
```

## Features

- **Command completion**: Tab-complete subcommands (search, install, uninstall, etc.)
- **Option completion**: Complete global and command-specific flags
- **Package completion**: Suggests installed packages for install/uninstall/info commands
- **Filtering**: Bash completion includes `--pacman-only` and `--flatpak-only` options

## Usage Examples

```bash
arc i<TAB>           # Completes to "install"
arc install st<TAB>  # Suggests steam (if installed)
arc --v<TAB>         # Completes to "--verbose"
arc search --<TAB>   # Shows --pacman-only and --flatpak-only options
```
