UNPKG

643 BPlain TextView Raw
1#!/bin/bash
2
3# Borrowed from grunt-cli
4# http://gruntjs.com/
5#
6# Copyright (c) 2012 Tyler Kellen, contributors
7# Licensed under the MIT license.
8# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
9
10# Usage:
11#
12# To enable bash <tab> completion for hexo, add the following line (minus the
13# leading #, which is the bash comment character) to your ~/.bashrc file:
14#
15# eval "$(hexo --completion=bash)"
16
17# Enable bash autocompletion.
18function _hexo_completions() {
19 local cur="${COMP_WORDS[COMP_CWORD]}"
20 local compls=$(hexo --console-list)
21
22 COMPREPLY=($(compgen -W "$compls" -- "$cur"))
23}
24
25complete -o default -F _hexo_completions hexo