mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 09:24:36 +00:00
* Update information about jsondoc/jsondoc2 Manual was missing information about jsondoc2 which made it seem like it didn't exist at all. This commit adds mention of the jsondoc2 command along with an example. * Renamed jsondoc2 similar to doc2 and updated docs doc2 was recently renamed to doc while doc was renamed to doc0. This commits renames jsondoc to jsondoc2 and jsondoc2 to jsondoc0 to behave tha same way. The documentation for doc/jsondoc was also lagging behind this change which has also been fixed. I interpreted this as a soft deprecation of doc and jsondoc and therefore removed them from the auto-complete lists.
48 lines
1.5 KiB
Bash
48 lines
1.5 KiB
Bash
# bash completion for nim -*- shell-script -*-
|
|
|
|
_nim()
|
|
{
|
|
local cur prev words cword split
|
|
_init_completion -s || return
|
|
|
|
COMPREPLY=()
|
|
cur=${COMP_WORDS[COMP_CWORD]}
|
|
|
|
if [ $COMP_CWORD -eq 1 ] ; then
|
|
# first item - suggest commands
|
|
kw="compile c doc compileToC cc compileToCpp cpp compileToOC objc js e rst2html rst2tex jsondoc buildIndex genDepend dump check"
|
|
COMPREPLY=( $( compgen -W "${kw}" -- $cur ) )
|
|
return 0
|
|
fi
|
|
case $prev in
|
|
--stackTrace|--lineTrace|--threads|-x|--checks|--objChecks|--fieldChecks|--rangeChecks|--boundChecks|--overflowChecks|-a|--assertions|--floatChecks|--nanChecks|--infChecks|--deadCodeElim)
|
|
# Options that require on/off
|
|
[[ "$cur" == "=" ]] && cur=""
|
|
COMPREPLY=( $(compgen -W 'on off' -- "$cur") )
|
|
return 0
|
|
;;
|
|
--opt)
|
|
[[ "$cur" == "=" ]] && cur=""
|
|
COMPREPLY=( $(compgen -W 'none speed size' -- "$cur") )
|
|
return 0
|
|
;;
|
|
--app)
|
|
[[ "$cur" == "=" ]] && cur=""
|
|
COMPREPLY=( $(compgen -W 'console gui lib staticlib' -- "$cur") )
|
|
return 0
|
|
;;
|
|
*)
|
|
kw="-r -p= --path= -d= --define= -u= --undef= -f --forceBuild --opt= --app= --stackTrace= --lineTrace= --threads= -x= --checks= --objChecks= --fieldChecks= --rangeChecks= --boundChecks= --overflowChecks= -a= --assertions= --floatChecks= --nanChecks= --infChecks= --deadCodeElim="
|
|
COMPREPLY=( $( compgen -W "${kw}" -- $cur ) )
|
|
_filedir '@(nim)'
|
|
#$split
|
|
return 0
|
|
;;
|
|
esac
|
|
return 0
|
|
|
|
} &&
|
|
complete -onospace -F _nim nim
|
|
|
|
# ex: ts=2 sw=2 et filetypesh
|