Problem/Motivation
`drush dce node 1` prints json to the console.
`drush dcer node 1` quietly prints to current location.
Proposed resolution
Rectify behavior so that the two commands act the same.
Remaining tasks
Find consensus, patch, commit
I see three of ways to bring the two commands into alignment. I personally like the way `dce` prints to the console, so I wrote a patch that does the same for `dcer` instead of printing to the current location.
Perhaps the more sensible option, which keeps behavior in line with current behavior, is to make all the arguments required.
Comments
Comment #2
icicleking commentedComment #3
icicleking commentedComment #4
mariodan commentedI have tested patch #1 and it works as described.
Comment #5
mariodan commentedComment #6
andypostany reason for that?
Comment #7
kalpaitch commentedI suspect because as rightly pointed out there is still some inconsistency with the drush commands (also found when adding the import commands).
The 'file' option on the 'default-content-export' command will 'Write out the exported content to a file instead of stdout'. Therefore the default behaviour of this command is to write to stout, however none of the other commands follow this behaviour. I guess the suggestion is that either all the export commands should write to stout if not given a file system to write to, or they should all do nothing. Same goes for 'default-content-export-module' command potentially.
Either way the descriptions of the 'file' or 'folder' flags needs to be more explicit.
Comment #8
kalpaitch commentedRe-rolled based on #2614644: Split DefaultContentManager into Exporter and Importer
Made the 'default-content-export' command use the new 'writeDefaultContent' method on the exporter service, and removed the stdout to console.
Comment #9
kalpaitch commentedComment #10
berdirI've been thinking about switching drush dce in 2.0.x to a folder argument instead of this, so I like the direction and I'm also OK with API/drush command changes there at the moment. I think we could also use this issue to address #2870993: Make location for exported content more useful when folder option is ommited and ensure we export into the real current folder and not drupal root.
This also needs to implement this for drush 9+.
Comment #11
kevinfunkI have a need to only export nodes and not references. I added this feature while working on this issue. Please let me know if you think it doesn't belong as part of this issue.
Export all nodes (does not export references)
drush dce node --folder=modules/custom/my_custom_module/contentExport only node 1
drush dce node 1 --folder=modules/custom/my_custom_module/contentComment #12
kevinfunkComment #14
kevinfunk