]>
git.proxmox.com Git - rustc.git/blob - src/rustbook/help.rs
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 //! Implementation of the `help` subcommand. Currently just prints basic usage info.
13 use subcommand
::Subcommand
;
15 use error
::CommandResult
;
20 pub fn parse_cmd(name
: &str) -> Option
<Box
<Subcommand
>> {
22 "help" | "--help" | "-h" | "-?" => Some(Box
::new(Help
)),
27 impl Subcommand
for Help
{
28 fn parse_args(&mut self, _
: &[String
]) -> CliResult
<()> {
32 fn execute(&mut self, _
: &mut Term
) -> CommandResult
<()> {
39 println
!("Usage: rustbook <command> [<args>]");
41 println
!("The <command> must be one of:");
42 println
!(" help Print this message.");
43 println
!(" build Build the book in subdirectory _book");
44 println
!(" serve --NOT YET IMPLEMENTED--");
45 println
!(" test --NOT YET IMPLEMENTED--");