From e286ed23ae3cabfb75327d8512dc937b2ecf9be1 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 14 Nov 2025 04:22:39 -0500 Subject: Add command-line options. --- src/unalf.rst | 100 +++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 81 insertions(+), 19 deletions(-) (limited to 'src/unalf.rst') diff --git a/src/unalf.rst b/src/unalf.rst index 774ddf2..9eaa0ad 100644 --- a/src/unalf.rst +++ b/src/unalf.rst @@ -20,7 +20,7 @@ extract Atari 8-bit ALF archives SYNOPSIS ======== -unalf [**-l**] **alf-file** +unalf [**-aetklLopqv**] [**-d** *dir*] [**-x** *wildcard*] *alf-file* [*wildcard* ...] DESCRIPTION =========== @@ -31,29 +31,93 @@ DESCRIPTION not compatible with it. It was used on the Atari 8-bit platform beginning in the late 1980s. -Extracted files are written to the current directory. Existing files -are overwritten without warning. +Extracted files are written to the current directory by +default. Existing files are backed up by default (by adding a **~** +suffix to the filename). + +If one or more **wildcard** arguments are provided, files will only be +listed or extracted if they match one of the wildcards. See **WILDCARDS** +below for details. OPTIONS ======= -For compatibility with **arc**\(1) usage, the **-** in front of -option letters is optional. +-a + Convert text file line endings from Atari EOL to UNIX newline. Text + files are detected by name: **\*.txt**, **\*.doc**, **\*.lst** files + are considered text. --l - List contents of archive, but do not extract. The output format - is similar to that of **arc -v**, minus the *Stowage* column, since - *ALF* doesn't support multiple compression types. The date and time - are displayed, but in most .alf files these are the default values - of "8 Jan 82 12:24a". +-aa + Convert line endings in all extracted files. This will corrupt any + executables or non-text data files, so use with caution. --v - Same as **-l**. +-d output-dir + Write extracted files to this directory, which will be created if it + does not exist. The default is the current directory. -**-e**, **-x** +-e Extract files. This is actually a no-op, as extraction is the default action. +-k + Keep trailing periods. In most (all?) ALF files, filenames that have no + extension are stored with a trailing period, e.g. '**FOO**' would + be stored as '**FOO.**'. By default, **unalf** removes the trailing + period; use **-k** to keep it. + +-l + List filenames in archive, one per line, but do not extract. Use + **-v** for more information (file size, etc). + +-L + Lowercase filesnames. Example: **FOO.TXT** will extract to **foo.txt**. + +-o + Overwrite files, if they already exist. The default is to rename + existing files, adding a **~** suffix. Note that renaming **file** + to **file~** *will* overwrite **file~** if it already exists. + +-p + Extract to standard output. All the files that get extracted will be + printed to stdout with no delimiters, so this is most useful when + only extracting one file. **-q** is automatically enabled by this option. + +-q + Quiet extraction: do not print "Uncrunching *file*" messages. Errors + and warnings will still be printed. This is the default when **-p** + is used. + +-v + Verbose listing of archive contents, with compressed and original + sizes, compression ration, date/time stamps, and checksum. The + output format is similar to that of **arc -v**, minus the *Stowage* + column, since *ALF* doesn't support multiple compression types. The + date and time are displayed, but in most .alf files these are the + default values of "8 Jan 82 12:24a". + + +-x wildcard + Exclude (do not list or extract) files matching *wildcard*. See + **WILDCARDS** below. This option can be given multiple times + to exclude multiple patterns. + +WILDCARDS +========= + +Wildcard (aka glob) matching works like it does on the Atari: *\*.\** +matches any filename (whether or not it has an extension), and *\** +or *\*.* only match filenames with no extension. + +A *\** matches any number of characters (including zero). A *?* +matches a single character. + +Like the Atari, anything in the name or extension following a *\** is +ignored: **FOO\*BAR.TXT** is equivalent to **FOO\*.TXT**, and +**FOO.T\*T** is equivalent to **FOO.T\***. **FOO\*TXT** is +equivalent to **FOO\***, and *will not* match the file **FOO.TXT**. + +Unlike the Atari, matching is case-insensitive. + EXIT STATUS =========== @@ -93,12 +157,10 @@ This **unalf** is 100% compatible with the original Atari **UNALF.COM** aka **DZ.COM**, with the following differences: - There is no interactive mode. The file to extract must be given as - a command-line argument. - -- Files are always extracted to the current directory. The original - **UNALF.COM** accepted a 2nd argument or prompted for the output directory. + a command-line argument, and the output directory must be given + with the **-d** option. -- This **unalf** is capable of listing the contents of an archive +- This **unalf** is capable of listing or testing the contents of an archive without extracting it. - Turning the screen off for speed makes no sense on modern operating -- cgit v1.2.3