Skip to content

Conversation

@wking
Copy link
Contributor

@wking wking commented Jul 5, 2016

This makes it easier to post-process output before writing it to disk. For example, you may want to make adjustments with jq and/or write part of the configuration to a different file for consumption by non-OCI tools.

This makes it easier to post-process output before writing it to disk.
For example, you may want to make adjustments with jq and/or write
part of the configuration to a different file for consumption by
non-OCI tools [1].

[1]: opencontainers#128 (comment)

Signed-off-by: W. Trevor King <[email protected]>
@liangchenye
Copy link
Member

LGTM

@Mashimiao
Copy link

+1

@grantseltzer
Copy link
Contributor

I think having the default output be a file should remain the same. Maybe there should be an option to output to stdout, and an option to to rename the file output? It could be the same flag too, either a path or "STDOUT" possibly.

@wking
Copy link
Contributor Author

wking commented Jul 6, 2016

On Wed, Jul 06, 2016 at 08:48:31AM -0700, Grant Seltzer Richman wrote:

I think having the default output be a file should remain the same.

I like having ‘--output PATH’ always mean “please write to the file at
PATH”, and not having to rely on ‘--output /dev/stdout’ with the
/dev/stdout symlinks, /proc/self/fd/1, or magic paths like ‘-’.
Stdout is a generic Unix/C concept, and shouldn't require magic paths
or Linux-specific knowledge.

On the other hand, with the default-to-stdout approach, folks don't
need any special knowledge to say “I want to write this to
config.json”. Folks who do a lot of this in interactive shells can
always alias ocitools-generate to ‘ocitools generate --output
config.json’, although I expect most ocitools consumers will be
scripts.

@iamanush
Copy link

iamanush commented Jul 6, 2016

+1 I like the idea of defaulting to STDOUT and providing the --output flag for the file.

@mrunalp
Copy link
Contributor

mrunalp commented Jul 6, 2016

LGTM

@mrunalp mrunalp merged commit eb7e1d4 into opencontainers:master Jul 6, 2016
@wking wking deleted the generate-output-file branch July 21, 2016 04:35
wking added a commit to wking/ocitools-v2 that referenced this pull request Jul 22, 2016
The switch to --output in 06d61a3 (generate: Add --output=PATH and
write to stdout by default, 2016-07-05, opencontainers#129) was too narrow.  There's
no need to change directories now that the output path is
configurable.

Signed-off-by: W. Trevor King <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants