Mercurial > octave-nkf
view scripts/miscellaneous/version.m @ 19221:b54093acb8fe
ver.m: Overhaul function.
Add ability to call "ver PKG_NAME". Add ability to call "pkg list PKG_NAME".
* ver.m: Redo docstring. Rename output variable to retval rather than
unnecessary use of varargout. Add ability to call "ver PKG_NAME" by passing
PKG_NAME to 'pkg list' command.
* pkg.m: Redo docstring for 'list' to explain new ability to supply a PKG_NAME.
Use numel() rather than length() for clarity. Use isempty() rather than
length() == 0 for clarity.
* installed_packages.m: Add additional input argument pkgname. Use unique()
rather than double for loop to uniquify package list. Add code to report
only on package pkgname if given. Use numel() rather than length() for
clarity. Replace for loops with cellfun calls to determine max length of
string entries.
* version.m: Add seealso reference to ver in docstring.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 30 Sep 2014 08:29:16 -0700 |
parents | d63878346099 |
children | 4197fc428c7d |
line wrap: on
line source
## Copyright (C) 1994-2013 John W. Eaton ## ## This file is part of Octave. ## ## Octave is free software; you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 3 of the License, or (at ## your option) any later version. ## ## Octave is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, see ## <http://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {Function File} {} version () ## Return the version number of Octave as a string. ## ## This is an alias for the function @w{@env{OCTAVE_VERSION}} provided for ## compatibility. ## @seealso{OCTAVE_VERSION, ver} ## @end deftypefn ## Author: jwe function vs = version () if (nargin != 0) warning ("version: ignoring extra arguments"); endif vs = OCTAVE_VERSION; endfunction %!assert (ischar (version ())) %!assert (version (), OCTAVE_VERSION) %!warning version (1);