Changeset 15870 for trunk/base


Ignore:
Timestamp:
Jan 16, 2006, 2:17:57 AM (15 years ago)
Author:
jberry
Message:

Eliminate runtime error when a long option is presented globally

File:
1 edited

Legend:

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

    r15869 r15870  
    33exec @TCLSH@ "$0" "$@"
    44# port.tcl
    5 # $Id: port.tcl,v 1.153 2006/01/16 01:59:04 jberry Exp $
     5# $Id: port.tcl,v 1.154 2006/01/16 02:17:57 jberry Exp $
    66#
    77# Copyright (c) 2002-2006 DarwinPorts organization
     
    20652065#               (the global_options array is reset to global_options_base prior to each command)
    20662066#
    2067 proc parse_options { action_name ui_options_name global_options_name } {
    2068         upvar $action_name action
     2067proc parse_options { action ui_options_name global_options_name } {
    20692068        upvar $ui_options_name ui_options
    20702069        upvar $global_options_name global_options
     2070        global cmdname
    20712071       
    20722072        while {[moreargs]} {
     
    20812081                                                          advance; break
    20822082                                                        }
    2083                                 --version       { ui_warn "(please use \"$cmdname version\" to get version information)"; set action "version" }
     2083                                --version       { ui_warn "(please use \"$cmdname version\" to get version information)" }
    20842084                                default         {
    20852085                                                          set key [string range $arg 2 end]
     
    21772177                # (to avoid abiguity with -variants and a default port, either -- must be
    21782178                # used to terminate option processing, or the pseudo-port current must be specified).
    2179                 parse_options action ui_options global_options
     2179                parse_options $action ui_options global_options
    21802180               
    21812181                # Parse port specifications into portlist
     
    24382438
    24392439# Parse global options that will affect all subsequent commands
    2440 parse_options default_action ui_options global_options
     2440parse_options "global" ui_options global_options
    24412441
    24422442# Get arguments remaining after option processing
Note: See TracChangeset for help on using the changeset viewer.