Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Changeset 37290 for trunk/base/src

Show
Ignore:
Timestamp:
06/02/08 08:05:26 (6 months ago)
Author:
raimue@…
Message:

port/port.tcl:
Add a new option --line to port search.
This works a little bit like the old output of port search in 1.6.1, but uses
tabs to separate fields instead of hardcoded spaces (easy parsing with awk or similar).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port/port.tcl

    r37269 r37290  
    20172017 
    20182018proc action_search { action portlist opts } { 
    2019     global private_options 
     2019    global private_options global_options 
    20202020    set status 0 
    20212021    if {![llength $portlist] && [info exists private_options(ports_no_args)] && $private_options(ports_no_args) == "yes"} { 
     
    20902090                puts $portinfo(name) 
    20912091            } else { 
    2092                 puts -nonewline $joiner 
    2093  
    2094                 puts -nonewline "$portinfo(name) @$portinfo(version)" 
    2095                 if {[info exists portinfo(categories)]} { 
    2096                     puts -nonewline " ([join $portinfo(categories) ", "])" 
    2097                 } 
    2098                 puts "" 
    2099                 puts [wrap [join $portinfo(description)] 80 [string repeat " " 4]] 
     2092                if {[info exists global_options(ports_search_line)] 
     2093                        && $global_options(ports_search_line) == "yes"} { 
     2094                    puts "$portinfo(name)\t$portinfo(version)\t$portinfo(categories)\t$portinfo(description)" 
     2095                } else { 
     2096                    puts -nonewline $joiner 
     2097 
     2098                    puts -nonewline "$portinfo(name) @$portinfo(version)" 
     2099                    if {[info exists portinfo(categories)]} { 
     2100                        puts -nonewline " ([join $portinfo(categories) ", "])" 
     2101                    } 
     2102                    puts "" 
     2103                    puts [wrap [join $portinfo(description)] 80 [string repeat " " 4]] 
     2104                } 
    21002105            } 
    21012106 
     
    21062111            ui_msg "No match for $portname found" 
    21072112        } elseif {[llength $res] > 1} { 
    2108             ui_msg "\nFound [llength $res] ports." 
     2113            if {![info exists global_options(ports_search_line)] 
     2114                    || $global_options(ports_search_line) != "yes"} { 
     2115                ui_msg "\nFound [llength $res] ports." 
     2116            } 
    21092117        } 
    21102118 
     
    25652573                {maintainers 0} {name 0} {platform 0} {platforms 0} {portdir 0} 
    25662574                {revision 0} {variant 0} {variants 0} {version 0}} 
     2575    search      {{line 0}} 
    25672576    selfupdate  {{nosync 0} {pretend 0}} 
    25682577    uninstall   {{follow-dependents 0}}