- moves terminal into currentprocess abstraction, because termcolor
doesn't accept a file handle, rather it takes an enum indirectly referencing the global state of stdout/stderr.
- provides write/fg/bg/locked etc as before
- abstracts over TestWriter, or termcolor's own concrete types
- still permits completely terminal-free operation where desired (e.g.
future JSON RPC on stdin/stdout)
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Signed-off-by: Robert Collins <robertc@robertcollins.net>
In order to do in-process tests the CLI code must be (mostly) a library.
Thus:
- rustup-init should moves to the usual place to make this visually
distinct
- cli.rs as a mod to define the import
- 2018 edition changes to the cli code which had not been updated
- export the needed parts of the cli code such that rustup-init can
import them
`list-target <toolchain>` lists all the rust-std components available
for an installed toolchain.
`add-target <toolchain> <target>` adds the rust-std component
for a given target to an installed toolchain.
`remove-target` does the opposite.