2023-12-26 21:29:58 -06:00
gradle/wrapper Renaming app projects. 2022-01-03 18:52:58 -06:00
src Settings fields need to be static in the shell. 2023-12-26 21:29:58 -06:00
build.gradle Adding dump command to acx. #77 2022-03-21 21:59:38 -05:00 Update 2023-01-23 17:13:10 +00:00

ac, extended

This is a revamp of the venerable ac command-line utility with a more modern command-line interface.

Sample Run

All of the commands use -d to designate the disk. If there are many commands, setting the environment variable ACX_DISK_NAME can be used to simplify commands.

For example, this sequence:

  1. Creates a ProDOS disk image (pulling ProDOS from the 2.4.2 system master).
  2. Imports and tokenizes the sample startup.bas program and places it on the disk as STARTUP.
  3. Lists the resulting disk.
$ cat > startup.bas
20 FOR Y=0 TO 3
30 FOR X=0 TO 3
40 COLOR=Y*4+X
50 FOR A=0 TO 9  
60 HLIN X*10,X*10+9 AT Y*10+A
80 END

$ export ACX_DISK_NAME=sample.po
$ acx create --format=ProDOS_2_4_2.dsk --name=SAMPLES --size=140k --type=prodos
$ acx import --basic startup.bas --name=STARTUP

$ acx list --native
File: sample.po
* PRODOS          SYS      035 01/02/2022 01/13/2018     17,128          
* BASIC.SYSTEM    SYS      021 01/02/2022 01/13/2018     10,240 A=$2000  
  STARTUP         BAS      001 01/02/2022 01/02/2022         97 A=$0801  
ProDOS format; 110592 bytes free; 32768 bytes used.


$ acx --help                                                                    
Usage: acx [-hVv] [--debug] [--quiet] [COMMAND]

'acx' experimental utility

      --debug     Show detailed stack traces.
  -h, --help      Show this help message and exit.
      --quiet     Turn off all logging.
  -v, --verbose   Be verbose. Multiple occurrences increase logging.
  -V, --version   Print version information and exit.

  compare          Compare two disk images.
  convert          Uncompress a ShrinkIt or Binary II file; or convert a
                     DiskCopy 4.2 image into a ProDOS disk image.
  copy, cp         Copy files between disks.
  create, mkdisk   Create a disk image.
  delete, del, rm  Delete file(s) from a disk image.
  diskmap, map     Show disk usage map.
  dump             Dump a block or sector.
  export, x, get   Export file(s) from a disk image.
  dups             Find duplicate files.
  help             Displays help information about the specified command
  import, put      Import file onto disk.
  info, i          Show information on a disk image(s).
  list, ls         List directory of disk image(s).
  lock             Lock file(s) on a disk image.
  mkdir, md        Create a directory on disk.
  read             Read a block or sector.
  rename, ren      Rename file on a disk image.
  rename-disk      Rename volume of a disk image.
  rmdir, rd        Remove a directory on disk.
  unlock           Unlock file(s) on a disk image.
  write            Write a block or sector.


$ acx info --help
Usage: acx info [-h] -d=<disk>

Show information on a disk image(s).

  -d, --disk=<disk>   Image to process [$ACX_DISK_NAME].
  -h, --help          Show help for subcommand.
$ acx info "Beagle Graphics.dsk" 
File Name: Beagle Graphics.dsk
Disk Name: DISK VOLUME #254
Physical Size (bytes): 143360
Free Space (bytes): 20480
Used Space (bytes): 122880
Physical Size (KB): 140
Free Space (KB): 20
Used Space (KB): 120
Archive Order: DOS
Disk Format: DOS 3.3
Total Sectors: 560
Free Sectors: 80
Used Sectors: 480
Tracks On Disk: 35
Sectors On Disk: 16


$ acx list --help
Usage: acx list [-hr] [--[no-]column] [--deleted] [--[no-]footer] [--[no-]
                header] -d=<disk> [--globs=<globs>[,<globs>...]]... [-n | -s |
                -l] [--file | --directory] [--text | --json | --csv]

List directory of disk image(s).

      --[no-]column         Show column headers.
  -d, --disk=<disk>         Image to process [$ACX_DISK_NAME].
      --deleted             Show deleted files.
      --directory           Only include directories.
      --file                Only include files.
      --[no-]footer         Show footer.
                            File glob(s) to match.
  -h, --help                Show help for subcommand.
      --[no-]header         Show header.
  -r, --[no-]recursive      Display directory recursively.

File display formatting:
  -l, --long, --detail      Use long/detailed directory format.
  -n, --native              Use native directory format (default).
  -s, --short, --standard   Use brief directory format.

Output format:
      --csv                 CSV output.
      --json                JSON output.
      --text                Formatted text (default).
$ acx list --no-recursive DEVCD.HDV 
Name: /DEV.CD/
  TOOLS           DIR      002 06/25/1990 04/13/1989      1,024          
  II.DISK.CENTRAL DIR      001 06/25/1990 04/13/1989        512          
  UTILITIES       DIR      002 06/25/1990 04/13/1989      1,024          
  READ.ME.FIRST   DIR      001 06/25/1990 04/21/1989        512          
  GUIDED.TOURS    DIR      001 06/25/1990 04/13/1989        512          
  FINDER.DATA     FND      001 06/25/1990 10/12/1989        172          
  DEVELOP         DIR      001 07/05/1990 06/25/1990        512          
ProDOS format; 1701376 bytes free; 19270144 bytes used.