Mercurial > hg > octave-lyh
annotate scripts/miscellaneous/untar.m @ 12500:8f2056646dba
Improve docstrings for archive functions (gzip, bzip2, etc.)
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Thu, 03 Mar 2011 13:05:50 -0800 |
parents | c792872f8942 |
children | 72c96de7a403 |
rev | line source |
---|---|
11523 | 1 ## Copyright (C) 2005-2011 S�ren Hauberg |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
2 ## |
6049 | 3 ## This file is part of Octave. |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
6049 | 9 ## |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
5807 | 15 ## You should have received a copy of the GNU General Public License |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
5807 | 18 |
19 ## -*- texinfo -*- | |
12500
8f2056646dba
Improve docstrings for archive functions (gzip, bzip2, etc.)
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
20 ## @deftypefn {Function File} {} untar (@var{tarfile}) |
8f2056646dba
Improve docstrings for archive functions (gzip, bzip2, etc.)
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
21 ## @deftypefnx {Function File} {} untar (@var{tarfile}, @var{dir}) |
5808 | 22 ## Unpack the TAR archive @var{tarfile} to the directory @var{dir}. |
23 ## If @var{dir} is not specified, it defaults to the current directory. | |
12500
8f2056646dba
Improve docstrings for archive functions (gzip, bzip2, etc.)
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
24 ## @seealso{tar, unpack, bunzip2, gunzip, unzip} |
5807 | 25 ## @end deftypefn |
26 | |
5808 | 27 ## Author: S�ren Hauberg <hauberg@gmail.com> |
6081 | 28 ## Adapted-By: jwe, Bill Denney |
5808 | 29 |
11469
c776f063fefe
Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents:
8920
diff
changeset
|
30 function varargout = untar (tarfile, dir = ".") |
5808 | 31 |
11469
c776f063fefe
Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents:
8920
diff
changeset
|
32 if (nargin != 1 && nargin != 2) |
6081 | 33 print_usage (); |
5808 | 34 endif |
35 | |
6599 | 36 if (nargout > 0) |
37 varargout = cell (1, nargout); | |
11469
c776f063fefe
Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents:
8920
diff
changeset
|
38 [varargout{:}] = unpack (tarfile, dir, mfilename ()); |
6599 | 39 else |
11469
c776f063fefe
Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents:
8920
diff
changeset
|
40 unpack (tarfile, dir, mfilename ()); |
6599 | 41 endif |
6081 | 42 |
5807 | 43 endfunction |