|
2 | 2 | <%! |
3 | 3 | import os |
4 | 4 |
|
5 | | - from util import (put_and, supports_scopes, api_index, indent_by, enclose_in) |
| 5 | + from util import (put_and, supports_scopes, api_index, indent_by, enclose_in, put_and) |
6 | 6 | from cli import (mangle_subcommand, new_method_context, PARAM_FLAG, STRUCT_FLAG, UPLOAD_FLAG, OUTPUT_FLAG, VALUE_ARG, |
7 | 7 | CONFIG_DIR, SCOPE_FLAG, is_request_value_property, FIELD_SEP, docopt_mode, FILE_ARG, MIME_ARG, OUT_ARG, |
8 | 8 | CONFIG_DIR_FLAG, KEY_VALUE_ARG, to_docopt_arg, DEBUG_FLAG, DEBUG_AUTH_FLAG, MODE_ARG, SCOPE_ARG, |
@@ -132,9 +132,12 @@ Configuration: |
132 | 132 | %>\ |
133 | 133 | let arg_data = [ |
134 | 134 | % for resource in sorted(c.rta_map.keys()): |
| 135 | +<% |
| 136 | + methods = sorted(c.rta_map[resource]) |
| 137 | +%>\ |
135 | 138 | <%block filter="indent_by(4)">\ |
136 | | -("${mangle_subcommand(resource)}", vec![ |
137 | | - % for method in sorted(c.rta_map[resource]): |
| 139 | +("${mangle_subcommand(resource)}", "supported subcommands: ${put_and(["'%s'" % mangle_subcommand(m) for m in methods])}", vec![ |
| 140 | + % for method in methods: |
138 | 141 | <% |
139 | 142 | mc = new_method_context(resource, method, c) |
140 | 143 |
|
@@ -254,8 +257,8 @@ let mut app = App::new("${util.program_name()}") |
254 | 257 | % endif |
255 | 258 | % endfor |
256 | 259 |
|
257 | | -for &(main_command_name, ref subcommands) in arg_data.iter() { |
258 | | - let mut mcmd = SubCommand::new(main_command_name); |
| 260 | +for &(main_command_name, ref about, ref subcommands) in arg_data.iter() { |
| 261 | + let mut mcmd = SubCommand::new(main_command_name).about(about); |
259 | 262 |
|
260 | 263 | for &(sub_command_name, ref desc, ref args) in subcommands { |
261 | 264 | let mut scmd = SubCommand::new(sub_command_name); |
|
0 commit comments