-
-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathusage.gtx
More file actions
49 lines (40 loc) · 1.1 KB
/
usage.gtx
File metadata and controls
49 lines (40 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
= view_marker
> {{ function_name }}_usage() {
if summary == help && !help_header_override
> printf "{{ caption_string.sanitize_for_print }}\n\n"
else
> if [[ -n $long_usage ]]; then
if help_header_override
= help_header_override.indent 4
else
> printf "{{ full_name }}\n\n"
> printf "{{ user_string help, indent: 2 }}\n\n"
end
> else
> printf "{{ caption_string.sanitize_for_print }}\n\n"
> fi
end
if alt&.any?
> printf "{{ strings[:command_alias] % { alias: alt.join(', ') } }}\n"
> echo
end
>
> printf "%s\n" "{{ strings[:usage].color(:caption) }}"
> printf " {{ usage_string }}\n"
if commands.any?
> printf " {{ full_name }} [COMMAND] --help{{ " | -h" unless short_flag_exist? "-h" }}\n"
else
> printf " {{ full_name }} --help{{ " | -h" unless short_flag_exist? "-h" }}\n"
end
if root_command?
> printf " {{ full_name }} --version{{ " | -v" unless short_flag_exist? "-v" }}\n"
end
> echo
= render(:usage_commands).indent 2 if commands.any?
>
= render(:long_usage).indent 2
> }
>
commands.each do |command|
= command.render 'usage'
end