lib/bashly/views/command/usage.gtx
= view_marker
> {{ function_name }}_usage() {
> if [[ -n $long_usage ]]; then
if summary == help
> printf "{{ caption_string.sanitize_for_print }}\n"
> echo
else
> printf "{{ full_name }}\n"
> echo
> printf "{{ help.wrap(78).indent(2).sanitize_for_print }}\n"
> echo
end
> else
> printf "{{ caption_string.sanitize_for_print }}\n"
> echo
> fi
>
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