Feature: Command-Line Tools
Purpose
The project must expose both readers through command-line tools, so a human or a later integration phase can inspect an AppImage and a desktop entry without writing code.
Requirements
COMMAND-LINE-TOOLS-R001— The project must provide anappimage-inspectexecutable.COMMAND-LINE-TOOLS-R002— The project must provide adesktop-inspectexecutable.COMMAND-LINE-TOOLS-R003—appimage-inspect <path>must print the detection outcome, the ELF facts, the payload offset and size, the embedded metadata sections, and the SquashFS superblock.COMMAND-LINE-TOOLS-R004—appimage-inspect <path>must list the payload root entries.COMMAND-LINE-TOOLS-R005—appimage-inspect <path>must print the embedded desktop entry resolved through the Desktop Entry Reader.COMMAND-LINE-TOOLS-R006—appimage-inspect --desktop <path>must print only the embedded desktop entry.COMMAND-LINE-TOOLS-R007—appimage-inspect --list <path>must print only the payload entry listing.COMMAND-LINE-TOOLS-R008—appimage-inspect --json <path>must print the same information as a JSON object.COMMAND-LINE-TOOLS-R009—desktop-inspect <path>must print the parsed groups, keys, and values of one file.COMMAND-LINE-TOOLS-R010—desktop-inspect --allmust enumerate the entries found on the application search path.COMMAND-LINE-TOOLS-R011—desktop-inspect --locate <identifier>must resolve one desktop file identifier.COMMAND-LINE-TOOLS-R012—desktop-inspect --pathmust print the application search path in priority order.COMMAND-LINE-TOOLS-R013—desktop-inspect --autostart-pathmust print the autostart search path in priority order.COMMAND-LINE-TOOLS-R014— Both tools must accept--locale <locale>and use it for localized value selection.COMMAND-LINE-TOOLS-R015— Both tools must accept--helpand print usage.COMMAND-LINE-TOOLS-R016— Both tools must accept--versionand print a build-time version string.COMMAND-LINE-TOOLS-R017— Both tools must write normal output to standard output and diagnostics to standard error.COMMAND-LINE-TOOLS-R018— Both tools must exit 0 on success and non-zero on error.COMMAND-LINE-TOOLS-R019— Both tools must exit 2 on a usage error.COMMAND-LINE-TOOLS-R020— Both tools must not access the network.COMMAND-LINE-TOOLS-R021— Both tools must not execute the payload of an AppImage.COMMAND-LINE-TOOLS-R022—appimage-inspectmust not modify the inspected file.COMMAND-LINE-TOOLS-R023—desktop-inspect --alland--locatemust only read files.COMMAND-LINE-TOOLS-R024— Output must be deterministic for the same input.
Behavior
appimage-inspecton a valid type 2 AppImage prints the type, the payload offset, and the embedded entry’sName.appimage-inspecton a text file prints an error to standard error and exits non-zero.desktop-inspecton the specification example prints the[Desktop Entry]group and both action groups.desktop-inspect --pathprints at least one directory and never fails on a machine with no desktop files.--helpprints usage and exits 0.
Dependencies
03-appimage-reader.md04-desktop-entry-reader.md05-desktop-entry-locator.md