forked from zsh-users/zsh-completions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_jekyll
145 lines (127 loc) · 3.49 KB
/
_jekyll
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#compdef jekyll
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for jekyll(http://jekyllrb.com)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * farseer90718 (https://github.com/farseer90718)
#
# ------------------------------------------------------------------------------
local ret=1 state
local -a common_ops
common_ops=(
{-v,--version}"[Display version information]"
{-h,--help}"[Display help documentation]"
{-p,--plugins}"[Plugins directory (defautls to ./_plugins)]: :_directories"
{-s,--source}"[Source directory (defaults to ./)]: :_directories"
{-d,--destination}"[Destination directory (defautls to ./_site)]: :_directories"
"--layouts=[Layouts directory (defaults to ./_layouts)]: :_directories"
"--safe=[Safe mode (defaults to false)]"
)
typeset -A opt_args
_arguments \
':subcommand:->subcommand' \
$common_ops \
'*::options:->options' && ret=0
case $state in
subcommand)
local -a subcommands
subcommands=(
"build:Build your site"
"docs:Launch local server with docs for jekyll"
"doctor:Search site and print specific deprecation warnings"
"help:Display global or [command] help documentation"
"import:Import your old blog to Jekyll"
"new:Creates a new Jekyll site scaffold in PATH"
"serve:Serve your site locally"
)
_describe -t subcommands 'jekyll subcommand' subcommands && ret=0
;;
options)
local -a args
args=(
$common_ops
)
local -a config
config=(
"--config[Custom configuration file]: :_files"
)
local -a help
help=(
{-h,--help}"[Display help information]"
)
local -a build
build=(
{-w,--watch}"[Watch for changes and rebuild]"
"--limit_posts[Limits the number of posts to parse and publish]"
"--future[Publishes posts with a future date]"
"--lsi[Use LSI for improved related posts]"
"--drafts[Render posts in the _drafts folder]"
)
case $words[1] in
help)
args=()
compadd "$@" build docs doctor help import new serve
;;
build)
args+=(
$build
$config
)
;;
docs)
args=(
{-p,--port}"[Port to listen on]: :_ports"
{-u,--host}"[Host to bind to]: :_hosts"
$help
)
;;
doctor)
args+=(
$config
)
;;
import)
args=(
"--source[Source file or URL to migrate from]:url"
"--file[File to migrate from]: :_files"
"--dbname[Database name to migrate from]:database"
"--user[Username to use when migrating]:user"
"--pass[Password to use when migrating]:password"
"--host[Host address to use when migrating]:url"
$help
)
;;
new)
args=(
": :_directories"
"--force[Force creation even if PATH already exists]"
"--blank[Creates scaffolding but with empty files]"
$help
)
;;
serve)
args+=(
$build
$config
{-P,--port}"[Port to listen on]: :_posts"
{-H,--host}"[Host to bind to]: :_hosts"
{-b,--baseurl}"[Base URL]:url"
)
esac
_arguments $args && ret=0
;;
esac
return ret
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et