fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
a9618477e
master
1# Completions for Hugo (https://gohugo.io) 2 3# Functions 4 5function __fish_hugo_command 6set -l tokens( commandline -xpc) 7test ( count $tokens ) -le 1 ;and return 1 8set -l command"" 9set -l skip1 10for tokenin $tokens [ 2 .. -1 ] 11if test $skip -eq 0 12set skip1 13else 14switch $token 15case --config --logFile 16set skip0 17case "-*" 18case "*" 19set command( string trim -l" $command $token " ) 20end 21end 22end 23test ( count $command ) -eq 0 ;and return 1 24echo $command 25end 26 27function __fish_hugo_using_command 28set -l command( __fish_hugo_command ) 29test " $command " = " $argv " 30end 31 32function __fish_hugo_using_main_like_command 33set -l command( __fish_hugo_command ) 34switch " $command " 35case "" benchmark server 36return 0 37end 38return 1 39end 40 41# Global options 42 43complete -c hugo -l config -f -d"Configuration file" 44complete -c hugo -l debug -f -d"Debug output" 45complete -c hugo -l log -f -d"Enable logging" 46complete -c hugo -l logFile -r -d"Log file" 47complete -c hugo -l quiet -f -d"Quiet mode" 48complete -c hugo -s v -l verbose -f -d"Verbose output" 49complete -c hugo -l verboseLog -f -d"Verbose logging" 50 51# Main-like commands 52 53complete -c hugo -n __fish_hugo_using_main_like_command -s b -l baseURL -r -d"Hostname and path to the root" 54complete -c hugo -n __fish_hugo_using_main_like_command -s B -l buildDrafts -f -d"Include content marked as draft" 55complete -c hugo -n __fish_hugo_using_main_like_command -s E -l buildExpired -f -d"Include expired content" 56complete -c hugo -n __fish_hugo_using_main_like_command -s F -l buildFuture -f -d"Include content with publishdate in the future" 57complete -c hugo -n __fish_hugo_using_main_like_command -l cacheDir -f -a"(__fish_complete_directories (commandline -ct) 'Cache directory')" -d"Cache directory" 58complete -c hugo -n __fish_hugo_using_main_like_command -l canonifyURLs -f -d"Canonicalize all relative URLs using baseurl" 59complete -c hugo -n __fish_hugo_using_main_like_command -l cleanDestinationDir -f -d"Remove files from destination not found in static directories" 60complete -c hugo -n __fish_hugo_using_main_like_command -s c -l contentDir -f -a"(__fish_complete_directories (commandline -ct) 'Content directory')" -d"Content directory" 61complete -c hugo -n __fish_hugo_using_main_like_command -s d -l destination -f -a"(__fish_complete_directories (commandline -ct) 'Destination directory')" -d"Destination directory" 62complete -c hugo -n __fish_hugo_using_main_like_command -l disable404 -f -d"Do not build 404 page" 63complete -c hugo -n __fish_hugo_using_main_like_command -l disableKinds -r -d"Disable different kinds of pages" 64complete -c hugo -n __fish_hugo_using_main_like_command -l disableRSS -f -d"Do not build RSS files" 65complete -c hugo -n __fish_hugo_using_main_like_command -l disableSitemap -f -d"Do not build sitemap files" 66complete -c hugo -n __fish_hugo_using_main_like_command -l enableGitInfo -f -d"Add Git revision, date and author info to the pages" 67complete -c hugo -n __fish_hugo_using_main_like_command -l forceSyncStatic -f -d"Copy all files when static is changed" 68complete -c hugo -n __fish_hugo_using_main_like_command -s h -l help -f -d"Help for hugo" 69complete -c hugo -n __fish_hugo_using_main_like_command -l i18n-warnings -f -d"Print missing translations" 70complete -c hugo -n __fish_hugo_using_main_like_command -l ignoreCache -f -d"Ignore the cache directory" 71complete -c hugo -n __fish_hugo_using_main_like_command -s l -l layoutDir -f -a"(__fish_complete_directories (commandline -ct) 'Layout directory')" -d"Layout directory" 72complete -c hugo -n __fish_hugo_using_main_like_command -l noChmod -f -d"Do not sync permission mode of files" 73complete -c hugo -n __fish_hugo_using_main_like_command -l noTimes -f -d"Do not sync modification time of files" 74complete -c hugo -n __fish_hugo_using_main_like_command -l pluralizeListTitles -f -d"Pluralize titles in lists using inflect" 75complete -c hugo -n __fish_hugo_using_main_like_command -l preserveTaxonomyNames -f -d"Preserve taxonomy names as written" 76complete -c hugo -n __fish_hugo_using_main_like_command -l renderToMemory -f -d"Render to memory" 77complete -c hugo -n __fish_hugo_using_main_like_command -s s -l source -f -a"(__fish_complete_directories (commandline -ct) 'Source directory')" -d"Source directory" 78complete -c hugo -n __fish_hugo_using_main_like_command -l stepAnalysis -f -d"Display memory and timing of different steps of the program" 79complete -c hugo -n __fish_hugo_using_main_like_command -l templateMetrics -f -d"Display metrics about template executions" 80complete -c hugo -n __fish_hugo_using_main_like_command -l templateMetricsHints -f -d"Calculate some improvement hints when combined with --templateMetrics" 81complete -c hugo -n __fish_hugo_using_main_like_command -s t -l theme -r -d"Theme to use" 82complete -c hugo -n __fish_hugo_using_main_like_command -l themesDir -f -a"(__fish_complete_directories (commandline -ct) 'Themes directory')" -d"Themes directory" 83complete -c hugo -n __fish_hugo_using_main_like_command -l uglyURLs -f -d"Use /filename.html instead of /filename/" 84complete -c hugo -n __fish_hugo_using_main_like_command -s w -l watch -f -d"Watch filesystem for changes and recreate as needed" 85 86# Commands 87 88# benchmark 89complete -c hugo -n"not __fish_hugo_command" -f -a benchmark -d"Benchmark Hugo by building the site a number of times" 90complete -c hugo -n"__fish_hugo_using_command benchmark" -s n -l count -f -d"Number of times to build the site" 91complete -c hugo -n"__fish_hugo_using_command benchmark" -l cpuprofile -r -d"CPU profile file" 92complete -c hugo -n"__fish_hugo_using_command benchmark" -s h -l help -f -d"Help for benchmark" 93complete -c hugo -n"__fish_hugo_using_command benchmark" -l memprofile -r -d"Memory profile file" 94complete -c hugo -n"__fish_hugo_using_command benchmark" -l renderToMemory -f -d"Render to memory" 95complete -c hugo -n"__fish_hugo_using_command benchmark" -l stepAnalysis -f -d"Display memory and timing of different steps of the program" 96complete -c hugo -n"__fish_hugo_using_command benchmark" -l templateMetrics -f -d"Display metrics about template executions" 97complete -c hugo -n"__fish_hugo_using_command benchmark" -l templateMetricsHints -f -d"Calculate some improvement hints when combined with --templateMetrics" 98 99# check 100complete -c hugo -n"not __fish_hugo_command" -f -a check -d"Perform some verification checks" 101complete -c hugo -n"__fish_hugo_using_command check" -s h -l help -f -d"Help for check" 102 103# check ulimit 104complete -c hugo -n"__fish_hugo_using_command check" -f -a ulimit -d"Check system ulimit settings" 105complete -c hugo -n"__fish_hugo_using_command check ulimit" -s h -l help -f -d"Help for ulimit" 106 107# config 108complete -c hugo -n"not __fish_hugo_command" -f -a config -d"Print the site configuration" 109complete -c hugo -n"__fish_hugo_using_command config" -s h -l help -f -d"Help for config" 110 111# convert 112complete -c hugo -n"not __fish_hugo_command" -f -a convert -d"Convert the content to different formats" 113complete -c hugo -n"__fish_hugo_using_command convert" -s h -l help -f -d"Help for convert" 114complete -c hugo -n"__fish_hugo_using_command convert" -s o -l output -f -a"(__fish_complete_directories (commandline -ct) 'Output directory')" -d"Output directory" 115complete -c hugo -n"__fish_hugo_using_command convert" -s s -l source -f -a"(__fish_complete_directories (commandline -ct) 'Source directory')" -d"Source directory" 116complete -c hugo -n"__fish_hugo_using_command convert" -l unsafe -f -d"Enable less safe operations" 117 118# convert toJSON 119complete -c hugo -n"__fish_hugo_using_command convert" -f -a toJSON -d"Convert front matter to JSON" 120complete -c hugo -n"__fish_hugo_using_command convert toJSON" -s h -l help -f -d"Help for toJSON" 121 122# convert toTOML 123complete -c hugo -n"__fish_hugo_using_command convert" -f -a toTOML -d"Convert front matter to TOML" 124complete -c hugo -n"__fish_hugo_using_command convert toTOML" -s h -l help -f -d"Help for toTOML" 125 126# convert toYAML 127complete -c hugo -n"__fish_hugo_using_command convert" -f -a toYAML -d"Convert front matter to YAML" 128complete -c hugo -n"__fish_hugo_using_command convert toYAML" -s h -l help -f -d"Help for toYAML" 129 130# env 131complete -c hugo -n"not __fish_hugo_command" -f -a env -d"Print Hugo version and environment info" 132complete -c hugo -n"__fish_hugo_using_command env" -s h -l help -f -d"Help for env" 133 134# gen 135complete -c hugo -n"not __fish_hugo_command" -f -a gen -d"Collection of several useful generators" 136complete -c hugo -n"__fish_hugo_using_command gen" -s h -l help -f -d"Help for gen" 137 138# gen autocomplete 139complete -c hugo -n"__fish_hugo_using_command gen" -f -a autocomplete -d"Generate shell autocompletion script for Hugo" 140complete -c hugo -n"__fish_hugo_using_command gen autocomplete" -l completionfile -r -d"Autocompletion file" 141complete -c hugo -n"__fish_hugo_using_command gen autocomplete" -s h -l help -f -d"Help for autocomplete" 142complete -c hugo -n"__fish_hugo_using_command gen autocomplete" -l type -f -a bash -d"Autocompletion type" 143 144# gen chromastyles 145complete -c hugo -n"__fish_hugo_using_command gen" -f -a chromastyles -d"Generate CSS stylesheet for the Chroma code highlighter" 146complete -c hugo -n"__fish_hugo_using_command gen chromastyles" -s h -l help -f -d"Help for chromastyles" 147complete -c hugo -n"__fish_hugo_using_command gen chromastyles" -l highlightStyle -r -d"Style used for highlighting lines" 148complete -c hugo -n"__fish_hugo_using_command gen chromastyles" -l lineStyle -r -d"Style used for line numbers" 149complete -c hugo -n"__fish_hugo_using_command gen chromastyles" -l style -r -d"Highlighter style" 150 151# gen doc 152complete -c hugo -n"__fish_hugo_using_command gen" -f -a doc -d"Generate Markdown documentation for the Hugo CLI" 153complete -c hugo -n"__fish_hugo_using_command gen doc" -l dir -f -a"(__fish_complete_directories (commandline -ct) 'Doc directory')" -d"Doc directory" 154complete -c hugo -n"__fish_hugo_using_command gen doc" -s h -l help -f -d"Help for doc" 155 156# gen man 157complete -c hugo -n"__fish_hugo_using_command gen" -f -a man -d"Generate man pages for the Hugo CLI" 158complete -c hugo -n"__fish_hugo_using_command gen man" -l dir -f -a"(__fish_complete_directories (commandline -ct) 'Man pages directory')" -d"Man pages directory" 159complete -c hugo -n"__fish_hugo_using_command gen man" -s h -l help -f -d"Help for man" 160 161# import 162complete -c hugo -n"not __fish_hugo_command" -f -a import -d"Import your site from others" 163complete -c hugo -n"__fish_hugo_using_command import" -s h -l help -f -d"Help for import" 164 165# import jekyll 166complete -c hugo -n"__fish_hugo_using_command import" -f -a jekyll -d"Import from Jekyll" 167complete -c hugo -n"__fish_hugo_using_command import jekyll" -l force -f -d"Allow import into non-empty target directory" 168complete -c hugo -n"__fish_hugo_using_command import jekyll" -s h -l help -f -d"Help for jekyll" 169 170# list 171complete -c hugo -n"not __fish_hugo_command" -f -a list -d"List various types of content" 172complete -c hugo -n"__fish_hugo_using_command list" -s h -l help -f -d"Help for list" 173complete -c hugo -n"__fish_hugo_using_command list" -s s -l source -f -a"(__fish_complete_directories (commandline -ct) 'Source directory')" -d"Source directory" 174 175# list drafts 176complete -c hugo -n"__fish_hugo_using_command list" -f -a drafts -d"List all drafts" 177complete -c hugo -n"__fish_hugo_using_command list drafts" -s h -l help -f -d"Help for drafts" 178 179# list expired 180complete -c hugo -n"__fish_hugo_using_command list" -f -a expired -d"List all expired posts" 181complete -c hugo -n"__fish_hugo_using_command list expired" -s h -l help -f -d"Help for expired" 182 183# list future 184complete -c hugo -n"__fish_hugo_using_command list" -f -a future -d"List all posts dated in the future" 185complete -c hugo -n"__fish_hugo_using_command list future" -s h -l help -f -d"Help for future" 186 187# new 188complete -c hugo -n"not __fish_hugo_command" -f -a new -d"Create new content" 189complete -c hugo -n"__fish_hugo_using_command new" -l editor -r -d"Editor to use" 190complete -c hugo -n"__fish_hugo_using_command new" -s h -l help -f -d"Help for new" 191complete -c hugo -n"__fish_hugo_using_command new" -s k -l kind -r -d"Content type to create" 192complete -c hugo -n"__fish_hugo_using_command new" -s s -l source -f -a"(__fish_complete_directories (commandline -ct) 'Source directory')" -d"Source directory" 193 194# new site 195complete -c hugo -n"__fish_hugo_using_command new" -f -a site -d"Create a new site" 196complete -c hugo -n"__fish_hugo_using_command new site" -l force -f -d"Create site inside non-empty directory" 197complete -c hugo -n"__fish_hugo_using_command new site" -s f -l format -r -d"Config and front matter format" 198complete -c hugo -n"__fish_hugo_using_command new site" -s h -l help -f -d"Help for site" 199 200# new theme 201complete -c hugo -n"__fish_hugo_using_command new" -f -a theme -d"Create a new theme" 202complete -c hugo -n"__fish_hugo_using_command new theme" -s h -l help -f -d"Help for theme" 203 204# server 205complete -c hugo -n"not __fish_hugo_command" -f -a server -d"Start high performance web server" 206complete -c hugo -n"__fish_hugo_using_command server" -l appendPort -f -d"Append port to baseurl" 207complete -c hugo -n"__fish_hugo_using_command server" -l bind -r -d"Interface to which the server will bind" 208complete -c hugo -n"__fish_hugo_using_command server" -l disableFastRender -f -d"Enable full re-renders on changes" 209complete -c hugo -n"__fish_hugo_using_command server" -l disableLiveReload -f -d"Watch without enabling live browser reload on rebuild" 210complete -c hugo -n"__fish_hugo_using_command server" -s h -l help -f -d"Help for server" 211complete -c hugo -n"__fish_hugo_using_command server" -l liveReloadPort -r -d"Port for live reloading" 212complete -c hugo -n"__fish_hugo_using_command server" -l meminterval -f -d"Interval to poll memory usage" 213complete -c hugo -n"__fish_hugo_using_command server" -l memstats -f -d"Memory usage log file" 214complete -c hugo -n"__fish_hugo_using_command server" -l navigateToChanged -f -d"Navigate to changed content file on live browser reload" 215complete -c hugo -n"__fish_hugo_using_command server" -l noHTTPCache -f -d"Prevent HTTP caching" 216complete -c hugo -n"__fish_hugo_using_command server" -s p -l port -r -d"Port on which the server will listen" 217complete -c hugo -n"__fish_hugo_using_command server" -l renderToDisk -r -d"Render to destination directory" 218 219# undraft 220complete -c hugo -n"not __fish_hugo_command" -f -a undraft -d"Reset the content draft status" 221complete -c hugo -n"__fish_hugo_using_command undraft" -s h -l help -f -d"Help for undraft" 222 223# version 224complete -c hugo -n"not __fish_hugo_command" -f -a version -d"Print the version number of Hugo" 225complete -c hugo -n"__fish_hugo_using_command version" -s h -l help -f -d"Help for version"