On Wed, 05 Mar 2014 16:19:46 +0000, Bruno Medeiros wrote:

On 26/02/2014 16:39, Sönke Ludwig wrote:

Regarding the last suggestion, for backwards compatibility reasons and
to keep a single document, I'd opt for

{
   "operations": [
     {"type": "fetch", "package": "tcltk", ...}
   ],
   /* regular dub describe output */
}

Or was your idea to be able to display the operations in real time in
the GUI and it would be easier to parse a single document at a time?

That's exactly my idea, and yes, it would be easier to parse a single
document at a time. But this is very low priority for me, TBH with all
the more important stuff there is to be done, I'd be surprised this will
ever get touched.
Currently DDT parses dub.json and presents a raw (unresolved) import
path and dependencies in the UI and the starts 'dub describe'. When that
finishes, the resolved import path and deps is presented in the UI. The
user can see in the 'dub describe' console that fetch is on-going so I
think the status quo is even better than a "operations" field, as that
is less readable for the user in the console. So it's good, as long as
there is no '{' before the JSON document starts!

Maybe it would be a good idea to add a more interactive mode to handle
fetch operations and the like, or at least to keep it a strictly
separate operation?

Maybe that's a simpler solution. Maybe have 'dub describe --fetchOnly',
which would give a different json document stating the required fetch
operations, and then start the fetch.

Bruno Medeiros
https://twitter.com/brunodomedeiros

Okay, I've created a ticket for this with the plan to implement it for 0.9.22.