commit | e8e674611d41fcac8cd510aad4786a6fb104b92f | [log] [tgz] |
---|---|---|
author | Todd Wang <toddw@google.com> | Mon May 11 22:38:16 2015 -0700 |
committer | Todd Wang <toddw@google.com> | Mon May 11 22:38:18 2015 -0700 |
tree | c9915581603ff98146f4a412f0624cd759e8a34c | |
parent | cef93575ecb021e7733b255f5600997e3f98457b [diff] |
ref: Reimplement v23cmd without a global map. Bogdan pointed out that there's no need for a global map in v23cmd - we can simply attach the run(ctx, env, args) function to the runner that we're returning from RunnerFunc. That's a nice simplification. We can also attach the init function to the runner as well. I objected to the init function in a previous approach because it was a global variable in the v23cmd package, but there's no downside if we attach it to the runner itself. Note that there's no way to change the init function after a runner has been created. This is on purpose; RunnerFuncWithInit is meant to be called in non-testing code, where there is no need to change the init function. It's a bit weird if we allowed the init function to be changed, even if only in tests, since we'd be changing the actual runner, which might impact other tests. Also renamed v23cmd.ParseAndRun to ParseAndRunForTest, to make it more obvious that it shouldn't be called in non-testing code, and also so that it looks more different from cmdline.ParseAndRun. Change-Id: Ifb59ca0300b670e2ab24554f880000478e5320b7
This repository contains a reference implementation of the Vanadium APIs.
Unlike the APIs in https://github.com/vanadium/go.v23, which promises to provide backward compatibility this repository makes no such promises.