From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 945 invoked by alias); 26 May 2018 15:07:16 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42829 Received: (qmail 14864 invoked by uid 1010); 26 May 2018 15:07:16 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr0-f193.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.128.193):SA:0(-3.7/5.0):. Processed in 1.625656 secs); 26 May 2018 15:07:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: doron.behar@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=Vs8iL7ojCA1+nMJqlZKl5eBzVJlj29NXALbia+CKEMM=; b=EGWvS0RRRGSqESNYuXwvYLcS71KUVw6NIK7jIaLAM/qDkHPmn3sQZGt62yf/x8bT8B gmrqHi9dZ9DFwJbUv5n8m3cij1KcpuDgJh7ns2hnYufnFjgWi8IBCf+nO1T9gZ8VjesV jUcYLP/PxFoZ1e/Usnun+5Tcmz0MKGOlJwT+2rip/G8j7nUfTLdDaJkh7EbRn4PM+kHv mLPIkdxDPKvx/2UtgQJ/wJk3duMOYx9tsdklxDS0zTZ6FnbSmSDft8FOCmpZ/LUbvKb9 m3Kn4NGZ+MrdSqFbRP5fBrTQJIZBjlFkQ5hGQQRks08xPrKfoKnV26aMoFs/6wxIYBVU e28Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Vs8iL7ojCA1+nMJqlZKl5eBzVJlj29NXALbia+CKEMM=; b=YtKlpdgmoVKTpgohkkUCQWgi3BrmxCozPGOfLb6bchb8pP6+4LviaYpt8XIVwnpnLx GARo8bcA2QC7uMGS5IJ4GRmtGrSxlhGizp/CVeCV4vyEZ2hjQa5dlDrtEWFvH+7YP3lW +Hd4RjRA8/H8XFROKj8m3Vmp4S0bvc7xebo66cw1RpKXUvueu4UPHG4EnzX7mwaiuLh+ cQ3AmZrBRuutf4y3DkWFayUrJxQiyuqFufUDjuGHQxe7+bhmsg0cN3bQ7V6QW+0xVBZZ q0F0VQEiLqcZHKDFKYu/8jp516jdvUJzTWvnxeHQuGDLJFB0C6mN5RqRVMvGNG9DhUYa 4+sQ== X-Gm-Message-State: ALKqPwfg6XZHjDFddf+1JMCYi26u8n3y4vvfSVNFjH1HtYAAPK7Oh7B9 ezut5xrULu7MJnJoki9WO6bG6Oh/ X-Google-Smtp-Source: AB8JxZridQ+xieqd1QWlqAZnP+XS8uSRrbtq/smh914+jl4JyLW4vYCmfN86EzFjAlzRvN+q12g6Yw== X-Received: by 2002:adf:de82:: with SMTP id w2-v6mr5959918wrl.88.1527347230435; Sat, 26 May 2018 08:07:10 -0700 (PDT) From: doron.behar@gmail.com To: zsh-workers@zsh.org Subject: [PATCH 03/25] Add marker style comments. Date: Sat, 26 May 2018 18:06:12 +0300 Message-Id: <20180526150634.15683-4-doron.behar@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180526150634.15683-1-doron.behar@gmail.com> References: <20180526150634.15683-1-doron.behar@gmail.com> From: Doron Behar --- Completion/Unix/Command/_luarocks | 92 +++++++++++++++++-------------- 1 file changed, 51 insertions(+), 41 deletions(-) diff --git a/Completion/Unix/Command/_luarocks b/Completion/Unix/Command/_luarocks index 6d5cb35bd..bb5588251 100644 --- a/Completion/Unix/Command/_luarocks +++ b/Completion/Unix/Command/_luarocks @@ -1,5 +1,6 @@ #compdef luarocks +# {{{ General options local general_options=( '(--server --only-server)--server=[Fetch rocks/rockspecs from this server]:HOST:_hosts' '(--server --only-server)--only-server=[Fetch rocks/rockspecs from this server only]:HOST:_hosts' @@ -9,7 +10,8 @@ local general_options=( '--verbose[Display verbose output of commands executed]' '--timeout=[Timeout on network operations]:SECONDS:{_message "timeout (seconds)"}' ) -# SYNOPSIS: /usr/bin/luarocks [--server= | --only-server=] [--tree=] [VAR=VALUE]... [] +# }}} +# {{{ All commands local commands=( 'build[Build/compile a rock]' 'config[Query information about the LuaRocks configuration]' @@ -31,8 +33,8 @@ local commands=( 'upload[Upload a rockspec to the public rocks repository]' 'write_rockspect[Write a template for a rockspec file]' ) - -# `build` command receives as an argument a .rockspec file, or external rock and afterwards a version +# }}} +# {{{ `build` command receives as an argument a .rockspec file, or external rock and afterwards a version local make_command_options=( '--pack-binary-rock[Produce a .rock file with the contents of compilation inside the current directory instead of installing it]' '--keep[Do not remove previously installed versions of the rock after building a new one]' @@ -53,8 +55,8 @@ _luarocks_build_deps_mode(){ ) _describe 'dependencies mode' modes } - -# `config` command sets a flag in the format VAR=VALUE +# }}} +# {{{ `config` command sets a flag in the format VAR=VALUE local config_command_options=( '--lua-incdir[Path to Lua header files]' '--lua-libdir[Path to Lua library files]' @@ -63,44 +65,44 @@ local config_command_options=( '--user-config[Location of the user config file]' '--rock-trees[Rocks trees in useFirst the user tree, then the system tree]' ) - -# `doc` command ... TODO: what kind of argument it receives +# }}} +# {{{ `doc` command ... TODO: what kind of argument it receives local doc_command_options=( '--home[Open the home page of project]' '--list[List documentation files only]' ) - -# `download` command receives an argument of an external only rockspec +# }}} +# {{{ `download` command receives an argument of an external only rockspec local download_command_options=( '--all[Download all files if there are multiple matches]' '--source[Download .src.rock if available]' '--rockspec[Download .rockspec if available]' '--arch=[Download rock for a specific architecture]:ARCH:' ) - -# `help` command receives an argument of an internal command - -# `install` command receives the same argument as the build command and it accepts the same options as well - -# `lint` command receives an argument of a rockspec file - -# `list` command receives only options +# }}} +# {{{ `help` command receives an argument of an internal command +# }}} +# {{{ `install` command receives the same argument as the build command and it accepts the same options as well +# }}} +# {{{ `lint` command receives an argument of a rockspec file +# }}} +# {{{ `list` command receives only options local list_command_options=( '--outdated[List only rocks for which there is a higher version available in the rocks server]' '--porcelain[Produce machine-friendly output]' ) - -# `make` command receives an argument of a rockspec file +# }}} +# {{{ `make` command receives an argument of a rockspec file # it's options were already described above. - -# `new_version` command receives an argument a .rockspec file, or external rock and afterwards a version and optionally afterwards a URL +# }}} +# {{{ `new_version` command receives an argument a .rockspec file, or external rock and afterwards a version and optionally afterwards a URL local new_version_command_options=( '--tag=[if no version is specified, this option'"'"'s argument is used instead]:TAG:__git_tag' ) - -# `pack` command receives as an argument a .rockspec file, or external rock and afterwards a version - -# `path` command receives only options +# }}} +# {{{ `pack` command receives as an argument a .rockspec file, or external rock and afterwards a version +# }}} +# {{{ `path` command receives only options local path_command_options=( '--bin[Adds the system path to the output]' '--append[Appends the paths to the existing paths]' @@ -108,31 +110,30 @@ local path_command_options=( '--lr-cpath[Exports the Lua cpath (not formatted as shell command)]' '--lr-bin[Exports the system path (not formatted as shell command)]' ) - -# `purge` command receives only options, --tree is mandatory, --force can be used only in conjunction with --old-versions +# }}} +# {{{ `purge` command receives only options, --tree is mandatory, --force can be used only in conjunction with --old-versions local option_force='--force[Force removing old versions when]' local purge_command_options=( '--old-versions[Keep the highest-numbered version of each rock and remove the other ones]' $option_force ) - - -# `remove` command receives as an argument a name of a locally installed rock +# }}} +# {{{ `remove` command receives as an argument a name of a locally installed rock local option_force_fast='--force-fast[works like --force but doesn'"'"'t reports forced removals]' local remove_command_options=( $option_deps_mode $option_force $option_force_fast ) - -# `search` command receives as an argument only a string as a search query +# }}} +# {{{ `search` command receives as an argument only a string as a search query local search_command_options=( '--source[Return only rockspecs and source rocks]' '--binary[Return only pure Lua and binary rocks (rocks that can be used with the "install" command without requiring a C toolchain)]' '--all[List all contents of the server that are suitable to this platform, do not filter by name]' ) - -# `show` command receives as an argument only an installed rock +# }}} +# {{{ `show` command receives as an argument only an installed rock local show_command_options=( '--home[home page of project]' '--modules[all modules provided by this package as used by require()]' @@ -142,21 +143,20 @@ local show_command_options=( '--rock-tree[local tree where rock is installed]' '--rock-dir[data directory of the installed rock]' ) - -# `unpack` command receives as an argument a rock package or an external rock and afterwards a version +# }}} +# {{{ `unpack` command receives as an argument a rock package or an external rock and afterwards a version local unpack_command_options=( '--force[Unpack files even if the output directory already exists]' ) - -# `upload` command receives as an argument a rockspec file with .src.rock extension +# }}} +# {{{ `upload` command receives as an argument a rockspec file with .src.rock extension local upload_command_options=( '--skip-pack[Do not pack and send source rock]' '--api-key=[Give it an API key]:KEY:{_message "api key"}' '--force[Replace existing rockspec if the same revision of a module already exists]' ) - -# `write_rockspec` command receives as an argument a name and a version with optionally a URL/PATH - +# }}} +# {{{ `write_rockspec` command receives as an argument a name and a version with optionally a URL/PATH local write_rockspec_command_options=( '--output=[Write the rockspec with the given filename]:FILE:_files' '--license=[A license string, ]:LICENSE:{_message -e "write a license string such as "MIT/X11" or "GNU GPL v3"}' @@ -174,3 +174,13 @@ _luarocks_write_rockspec_lib(){ _luarocks_version(){ _values -s , } +# }}} + +# {{{ Helpers +_luarocks_commands(){ + _describe 'command' commands +} +# }}} + +# The real thing +_arguments "${general_options[@]}" '*:COMMAND:_luarocks_commands' -- 2.17.0