Document image save and load stdout/stdin fallbacks.#1905
Open
anxkhn wants to merge 1 commit into
Open
Conversation
The image save --output and image load --input options are optional: when omitted, save writes the OCI archive to stdout and load reads it from stdin. The command reference still presented both flags as required, which hid the piping workflow. Bracket the options in the synopsis, note the stdout/stdin defaults, and add piping examples, matching the container export entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Motivation and Context
The command reference documented
container image save --outputandcontainer image load --inputas required flags, which hid the piping workflow.Both options are optional: when
--outputis omitted,image savewrites the OCIarchive to stdout, and when
--inputis omitted,image loadreads the archivefrom stdin. This is what the code already does:
ImageSave.swiftdeclaresvar output: FilePath?(optional) and, when it isabsent, streams the archive to
FileHandle.standardOutput.ImageLoad.swiftdeclaresvar input: FilePath?(optional) and, when it isabsent, reads the archive from
FileHandle.standardInput.The docs were never updated after that stdin/stdout support landed, so the
synopsis and prose still marked the flags as required. This change brings the
reference in line with the behavior and matches how the sibling
container exportentry already documents its stdout fallback.
Specifically, for both
image saveandimage loadit:[--output <output>]/[--input <input>]in the synopsis so they readas optional,
inaccurate "on disk" for save and "The tar file must be specified via
--input."for load),
No code changes; documentation only.
Testing
Verified the documented behavior against the source in
Sources/ContainerCommands/Image/: the optionaloutput/inputoptions andthe stdout / stdin fallback branches. Reviewed the rendered Markdown for the
image saveandimage loadsections;git diff --checkis clean. No automatedtest applies to a documentation-only change (the file is hand-maintained, not
generated).