For now, we're going to use the operations as a library. We have some
work to do before they can transparently be used as commands, but we're
keeping an eye on making sure they remain conceptually usable over the
shell.
Yehuda Katz [Fri, 21 Mar 2014 00:55:33 +0000 (17:55 -0700)]
Encoding and decoding now in libcargo
Commands can now call a simple function (execute_main) with some type
params, and get flags and stdin converted into their expected structs
automatically. Commands that return a json-serializable struct will also
get that struct automatically serialized into the output.
Additionally, error handling is now handled in a central location. If a
command returns a CargoError, its message will be printed (soon in
color!) and its exit code will be used to exit the process.
Yehuda Katz [Thu, 20 Mar 2014 21:02:51 +0000 (14:02 -0700)]
Lots of cleanup and more generic commands
Started to extract some of the generic behavior across all commands into
`execute_main` so that the commands themselves just need to operate
against structs (for JSON in and Flags)
Carl Lerche [Wed, 19 Mar 2014 01:10:48 +0000 (18:10 -0700)]
Initial stab at integration tests
At the same time, we started adding a generic error handling concept to
Cargo.
The idea is that every Result gets converted to a CargoError, which
includes all the information that Cargo needs to print out a friendly
human error message and exit gracefully.
Carl Lerche [Wed, 19 Mar 2014 01:10:48 +0000 (18:10 -0700)]
Initial stab at integration tests
At the same time, we started adding a generic error handling concept to
Cargo.
The idea is that every Result gets converted to a CargoError, which
includes all the information that Cargo needs to print out a friendly
human error message and exit gracefully.