Skip to content

Various utils (at least dos33fs-utils and prodos-utils): documentation of options placement is wrong on BSD-ish platforms. #18

@micahcowan

Description

@micahcowan

The problem is that BSD/traditional Unixes (including Darwin/Mac OS, which impacts me), use a getopt() that, by default, demands that all the options be specified before any non-option arguments.

So, while e.g. dos33 -h gives:
Usage: dos33 [-h] [-y] [-x] disk_image COMMAND [options]
the reality is that, on my Mac, all of the options to COMMAND must be placed before the disk_image argument in order to be recognized by getopt().

That is, I may not portably type:
dos33 -y MY-DISK.DSK BSAVE -a 0x6000 MYBIN
but instead:
dos33 -y -a 0x6000 MY-DISK.DSK BSAVE MYBIN

Suggested solutions:

  1. you could run getopt() once for 'hyx', and then run it again after moving the argv pointer past the disk_image and COMMAND arguments, so that getopt() "sees" the following options as coming first.
  2. probably easier - I believe most modern BSDish systems can be more relaxed about where options are placed on the command line, either with an appropriate macro #defined, or by calling a differently-named getopt() routine?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions