From 2511c8377f6c924625b10d6e6cc77c5053890b94 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 7 Jan 2014 13:37:23 -0200 Subject: Add help on --deps-mode --- src/luarocks/build.lua | 3 ++- src/luarocks/install.lua | 3 ++- src/luarocks/remove.lua | 3 ++- src/luarocks/util.lua | 20 ++++++++++++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/luarocks/build.lua b/src/luarocks/build.lua index ec269023..72b5649e 100644 --- a/src/luarocks/build.lua +++ b/src/luarocks/build.lua @@ -31,7 +31,8 @@ or the name of a rock to be fetched from a repository. rock after building a new one. This behavior can be made permanent by setting keep_other_versions=true in the configuration file. -]] + +]]..util.deps_mode_help() --- Install files to a given location. -- Takes a table where the array part is a list of filenames to be copied. diff --git a/src/luarocks/install.lua b/src/luarocks/install.lua index b28e6282..7458ec8e 100644 --- a/src/luarocks/install.lua +++ b/src/luarocks/install.lua @@ -25,7 +25,8 @@ or a filename of a locally available rock. rock after installing a new one. This behavior can be made permanent by setting keep_other_versions=true in the configuration file. -]] +]]..util.deps_mode_help() + --- Install a binary rock. -- @param rock_file string: local or remote filename of a rock. diff --git a/src/luarocks/remove.lua b/src/luarocks/remove.lua index f2f6997b..8f751a93 100644 --- a/src/luarocks/remove.lua +++ b/src/luarocks/remove.lua @@ -22,7 +22,8 @@ Will only perform the removal if it does not break dependencies. To override this check and force the removal, use --force. To perform a forced removal without reporting dependency issues, use --force=fast. -]] + +]]..util.deps_mode_help() --- Obtain a list of packages that depend on the given set of packages -- (where all packages of the set are versions of one program). diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua index 1a60fd9c..4b138516 100644 --- a/src/luarocks/util.lua +++ b/src/luarocks/util.lua @@ -8,6 +8,8 @@ local global_env = _G module("luarocks.util", package.seeall) +local cfg = require("luarocks.cfg") + local scheduled_functions = {} local debug = require("debug") @@ -371,6 +373,24 @@ function this_program(default) return last:sub(2) end +function deps_mode_help(program) + return [[ +--deps-mode= How to handle dependencies. Four modes are supported: + * all - use all trees from the rocks_trees list + for finding dependencies + * one - use only the current tree (possibly set + with --tree) + * order - use trees based on order (use the current + tree and all trees below it on the rocks_trees list) + * none - ignore dependencies altogether. + The default mode may be set with the deps_mode entry + in the configuration file. + The current default is "]]..cfg.deps_mode..[[". + Type ']]..this_program(program or "luarocks")..[[' with no arguments to see + your list of rocks trees. +]] +end + function see_help(command, program) return "See '"..this_program(program or "luarocks")..' help '..command.."'." end -- cgit v1.2.3-55-g6feb