
@('rg', './rg') | %{
    Register-ArgumentCompleter -Native -CommandName $_ -ScriptBlock {
        param($wordToComplete, $commandAst, $cursorPosition)

        $command = '_rg'
        $commandAst.CommandElements |
            Select-Object -Skip 1 |
            %{
                switch ($_.ToString()) {

                }
            }

        $completions = @()

        switch ($command) {

            '_ripgrep' {
                $completions = @('-h', '-V', '-a', '-c', '-F', '-i', '-n', '-N', '-q', '-u', '-v', '-w', '-l', '-H', '-L', '-p', '-s', '-S', '-e', '-E', '-g', '-t', '-T', '-A', '-B', '-C', '-f', '-m', '-r', '-j', '-M', '--help', '--version', '--files', '--type-list', '--text', '--count', '--fixed-strings', '--ignore-case', '--line-number', '--no-line-number', '--quiet', '--unrestricted', '--invert-match', '--word-regexp', '--column', '--debug', '--files-with-matches', '--files-without-match', '--with-filename', '--no-filename', '--heading', '--no-heading', '--hidden', '--follow', '--mmap', '--no-messages', '--no-mmap', '--no-ignore', '--no-ignore-parent', '--no-ignore-vcs', '--null', '--pretty', '--case-sensitive', '--smart-case', '--sort-files', '--vimgrep', '--regexp', '--color', '--colors', '--encoding', '--glob', '--type', '--type-not', '--after-context', '--before-context', '--context', '--context-separator', '--file', '--ignore-file', '--max-count', '--max-filesize', '--maxdepth', '--path-separator', '--replace', '--threads', '--max-columns', '--type-add', '--type-clear')
            }

        }

        $completions |
            ?{ $_ -like "$wordToComplete*" } |
            Sort-Object |
            %{ New-Object System.Management.Automation.CompletionResult $_, $_, 'ParameterValue', $_ }
    }
}
