Feature: Command-Line Tools
Purpose
Everything the desktop does must also be available on the command line, so a card can be read, drawn, and registered from a script.
Requirements
COMMAND-LINE-TOOLS-R001—vcard-inspect FILEmust print a human-readable report of the file, the cards, each contact’s facts, the photo, and every warning.COMMAND-LINE-TOOLS-R002—vcard-inspect --json FILEmust print the same facts as one JSON document.COMMAND-LINE-TOOLS-R003—vcard-inspect --properties FILEmust also list every property with its group, its parameters, and its decoded value.COMMAND-LINE-TOOLS-R004—vcard-inspectmust report a card with warnings in its output and still exit zero, so a caller can read the report; the JSON memberwarningsis the machine-readable signal.COMMAND-LINE-TOOLS-R005—vcard-render FILEmust write an SVG card to standard output, and--output FILEmust write it to a file.COMMAND-LINE-TOOLS-R006—vcard-render --index Nmust select the contact, and--no-photomust omit the photograph.COMMAND-LINE-TOOLS-R007—vcard-integrate handler status|install|uninstallmust drive the handler integration and print the result of each action.COMMAND-LINE-TOOLS-R008—vcard-integrate handle FILEmust be the desktop entry point.COMMAND-LINE-TOOLS-R009— Every tool must print<name> <version> (build <counter>)for--version, where the version is the build-time version.COMMAND-LINE-TOOLS-R010— Every tool must print usage for--helpand exit zero.COMMAND-LINE-TOOLS-R011— An unknown option, an unknown command, an unknown handler subcommand, or a missing required argument must print usage and exit with status 2.COMMAND-LINE-TOOLS-R012— A file that cannot be read must print<program>: <message>on standard error and exit with status 1.COMMAND-LINE-TOOLS-R013—vcard-inspectandvcard-rendermust accept exactly one file.COMMAND-LINE-TOOLS-R014—vcard-rendermust print a warning on standard error, and still write the card, when the photograph could not be embedded.COMMAND-LINE-TOOLS-R015—vcard-viewer FILE.vcfmust open a window titled with the contact’s name and carrying thevcard-viewerWM class, and must open an explanatory window rather than exiting silently when the file is not a readable card.COMMAND-LINE-TOOLS-R016—vcard-viewermust present a tabbed panel whose tabs are namedvCard,Discovered, andAbout.COMMAND-LINE-TOOLS-R017— TheDiscoveredtab must show the exactvcard-inspectcommand that was run and its combined standard output and standard error, so the graphical view and the command line can be compared.COMMAND-LINE-TOOLS-R018— TheAbouttab must show the project name, the build-time version, and the GitHub repository link.COMMAND-LINE-TOOLS-R019— ThevCardtab must show the same contact information the viewer showed before the tabbed panel.COMMAND-LINE-TOOLS-R020— Selecting a tab must not focus or select that tab’s first element; a selectable title must not arrive selected merely because its tab was opened.
Behavior
vcard-inspect FILEon the fixture printscards: 1and names the contact.vcard-inspect --json FILEparses as JSON and reportscards[0].formattedName.- On a card with no
FN, the report names the warning and the JSONwarningsarray is not empty, and the command exits zero. vcard-render --output card.svg FILEleaves a non-empty SVG carrying the display name.vcard-inspectwith no file argument exits 2; with a path that does not exist it exits 1.vcard-vieweron the fixture leaves a window named for the contact on the display, andvcard-integrate handleputs the same window up.- The viewer opens on the
vCardtab, and itsDiscoveredtab names the inspector and the file and shows the report. - The
Abouttab showsGNOME VCARD Integration, the build-time version, and the repository URL. - For a file the inspector refuses, the
vCardtab shows the error and theDiscoveredtab shows the inspector’s exact command and error output. - Switching to the
vCardorAbouttab leaves no text selected.
Dependencies
03-vcard-reader.md04-contact-renderer.md05-vcard-handler.md