diff scripts/pkg/pkg.m @ 21954:6da01de4dd8a

pkg: drop special usage of 'all' in load, unload, and describe (bug #40674) * pkg.m: special use of the word 'all' in place of package name creates an an arbitrary limit on package names. So remove the use of the word 'all' instead of package names when choosing all packages. Update documentation. * pkg/private/load_packages.m, pkg/private/unload_packages.m: remove support to load and unload all packages. Loading all packages unconditionally is a bad idea. This type of action should be done selectively and explicit. * scripts/pkg/private/describe.m: default to describe all packages in the absence of a named package, i.e., 'pkg describe' now describes all packages while 'pkg describe all' will describe a package named all.
author Carnë Draug <carandraug@octave.org>
date Thu, 14 Apr 2016 22:57:24 +0100
parents 96518f623c91
children cf5db742f552
line wrap: on
line diff
--- a/scripts/pkg/pkg.m	Sun Jun 19 18:04:07 2016 -0700
+++ b/scripts/pkg/pkg.m	Thu Apr 14 22:57:24 2016 +0100
@@ -101,22 +101,11 @@
 ## @end example
 ##
 ## @noindent
-## adds the @code{image} package to the path.  It is possible to load all
-## installed packages at once with the keyword @samp{all}.  Usage:
-##
-## @example
-## pkg load all
-## @end example
+## adds the @code{image} package to the path.
 ##
 ## @item unload
 ## Remove named packages from the path.  After unloading a package it is
-## no longer possible to use the functions provided by the package.  It is
-## possible to unload all installed packages at once with the keyword
-## @samp{all}.  Usage:
-##
-## @example
-## pkg unload all
-## @end example
+## no longer possible to use the functions provided by the package.
 ##
 ## @item list
 ## Show the list of currently installed packages.  For example,
@@ -159,16 +148,22 @@
 ## @end example
 ##
 ## @item describe
-## Show a short description of the named installed packages, with the option
+## Show a short description of installed packages.  With the option
 ## @qcode{"-verbose"} also list functions provided by the package.  For
 ## example,
 ##
 ## @example
-## pkg describe -verbose all
+## pkg describe -verbose
 ## @end example
 ##
 ## @noindent
 ## will describe all installed packages and the functions they provide.
+## Display can be limited to a set of packages:
+##
+## @example
+## pkg describe control signal # describe control and signal packages
+## @end example
+##
 ## If one output is requested a cell of structure containing the
 ## description and list of functions of each package is returned as
 ## output rather than printed on screen:
@@ -409,13 +404,13 @@
 
     case "load"
       if (isempty (files))
-        error ("pkg: load action requires at least one package or 'all'");
+        error ("pkg: load action requires at least one package name");
       endif
       load_packages (files, deps, local_list, global_list);
 
     case "unload"
       if (isempty (files))
-        error ("pkg: unload action requires at least one package or 'all'");
+        error ("pkg: unload action requires at least one package name");
       endif
       unload_packages (files, deps, local_list, global_list);
 
@@ -518,9 +513,6 @@
       build (files{1}, files(2:end), verbose);
 
     case "describe"
-      if (isempty (files))
-        error ("pkg: describe action requires at least one package or 'all'");
-      endif
       ## FIXME: name of the output variables is inconsistent with their content
       if (nargout)
         [local_packages, global_packages] = describe (files, verbose,