Long options
autoremove -- long options

audit -- lets sort the options too
Long options

-- convert to the normal getopt_long() style of options processing.
Long options
Long options
Long options

Stylize
Long options
Add a new function: pkg_create_from_manifest()

This is a simplified version of pkg_create_staged() which only reads a
manifest file (named as an argument) to find all of the required pkg
metadata.  None of the legacy bits inherited from pkg_tools (plist
+DESC, +DISPLAY, +MTREE_DIRS, PKG_DESC).

You need a pretty much complete manifest eg. as derived from 'pkg info
-R' -- you don't need to supply file checksums as those will be
recomputed, and you don't need to supply provided/required shlibs as
those will be autodiscovered too.
Add -M manifest option -- specify just the manifest file and build a
package out of that alone.
Long options
Long options
Long options.

Zap 'q' from the getopt options string -- it was never handled in the
associated switch statement.
pkg info: long options

Actually add necessary the NULL canary at the end of the longopts
arrays.
Long options
Grrr.... getopt_long permutes the arg list, making eg. 'pkg lock -l
foo' equivalent to 'pkg -l lock foo' with hilarious results.

Fortunately we can specify POSIXLY_CORRECT and restore compliance with
our preferred world-view.
Roto-till the recently added -l stuff.  Mostly because I don't see any
reason why asking for a list of locked packages (and what exactly is
wrong with 'pkg info -ak' or 'pkg query -e "%k == 1" "%n-%v"' for that
matter?) should preclude locking or unlocking stuff as pkg lock is
intended to do.  Nor why pkg unlock should be antithetical to getting
a list of what is locked.
Long options
Long options, for what it's worth.  The only available option has
precisely no effect...
Long opts.
Long options