summaryrefslogtreecommitdiffstats
path: root/ipfs-api/examples
diff options
context:
space:
mode:
authorFerris Tseng <ferristseng@fastmail.fm>2017-10-09 17:26:57 -0400
committerFerris Tseng <ferristseng@fastmail.fm>2017-10-09 17:26:57 -0400
commit88c11436ee084910f73c9e20867ca86cd5d9faea (patch)
tree21e53d8a59b8731a3b5470a0cf8b3094da9ed6ac /ipfs-api/examples
parent68e3845290e8e6758a3f0f454b34ec28f29f62ed (diff)
cleanup output
Diffstat (limited to 'ipfs-api/examples')
-rw-r--r--ipfs-api/examples/get_commands.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/ipfs-api/examples/get_commands.rs b/ipfs-api/examples/get_commands.rs
index 2ac6bbe..2b4f04d 100644
--- a/ipfs-api/examples/get_commands.rs
+++ b/ipfs-api/examples/get_commands.rs
@@ -6,22 +6,22 @@ use tokio_core::reactor::Core;
fn print_recursive(indent: usize, cmd: &response::CommandsResponse) {
- let cmd_indent = " ".repeat(indent);
- let opt_indent = " ".repeat(indent + 2);
+ let cmd_indent = " ".repeat(indent * 4);
+ let opt_indent = " ".repeat((indent + 1) * 4);
- println!("{}{}", cmd_indent, cmd.name);
+ println!("{}[{}]", cmd_indent, cmd.name);
if cmd.options.len() > 0 {
- println!("{}|options:", cmd_indent);
+ println!("{}* options:", cmd_indent);
for options in cmd.options.iter() {
println!("{}{}", opt_indent, &options.names[..].join(", "));
}
}
if cmd.subcommands.len() > 0 {
- println!("{}|subcommands:", cmd_indent);
+ println!("{}- subcommands:", cmd_indent);
for subcommand in cmd.subcommands.iter() {
- print_recursive(indent + 2, subcommand);
+ print_recursive(indent + 1, subcommand);
}
}
}