Sha256: f12af259f7c164807c2d0769bfbddd44f1bc2f43714dad2b966d654cca73412b

Contents?: true

Size: 1.15 KB

Versions: 25

Compression:

Stored size: 1.15 KB

Contents

<%- if subcommand[:subcommands].any? %>
<%= function_name %>() {
    local subcommands="
        <%- subcommand[:subcommands].each do |subcommand| -%>
        <%= subcommand[:name] %>
        <%- subcommand[:aliases].each do |_alias| -%>
        <%= _alias %>
        <%- end -%>
        <%- end -%>
    "

    local options="
        <%- subcommand[:options].each do |option| -%>
        <%- option[:names].each do |name| -%>
        <%= name %>
        <%- end -%>
        <%- end -%>
    "

    _autoproj_subcommands "$subcommands" && return

    case "$cur" in
        -*)
            COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
            ;;
        *)
            COMPREPLY=( $( compgen -W "$subcommands" -- "$cur" ) )
            ;;
    esac
}
<%- else %>
<%= function_name %>() {
    local options="
        <%- subcommand[:options].each do |option| -%>
        <%- option[:names].each do |name| -%>
        <%= name %>
        <%- end -%>
        <%- end -%>
    "

    case "$cur" in
        -*)
            COMPREPLY=($(compgen -W "$options" -- ${cur}))
            ;;
        *)
            <%= subcommand[:completer] %>
            ;;
    esac
}
<%- end %>

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
autoproj-2.17.0 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.16.0 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.15.3 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.15.2 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.15.1 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.15.0 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.14.0 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.13.0 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.12.1 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.12.0 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.11.0 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.10.2 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.10.1 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.10.0 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.9.0 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.8.8 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.8.7 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.8.6 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.8.5 lib/autoproj/templates/subcommand.bash.erb
autoproj-2.8.5.b1 lib/autoproj/templates/subcommand.bash.erb