Skip to content
Permalink
Browse files

Conspire to give the user version information if they ask for "--vers…

…ion"

(which is an extremely common idiom). We can't just give them the information,
since dportinit hasn't been called at the point where we process arguments,
but default "action" to "version" for this case (assuming they won't also
have asked for an action), and emit a warning message for good measure.

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@14585 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
jdberry committed Oct 12, 2005
1 parent 0078a7e commit dcfe311633a60d674b64773619d8c95622d39640
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/port/port.tcl
@@ -2,7 +2,7 @@
#\
exec @TCLSH@ "$0" "$@"
# port.tcl
# $Id: port.tcl,v 1.131 2005/10/12 22:21:20 jberry Exp $
# $Id: port.tcl,v 1.132 2005/10/12 22:35:01 jberry Exp $
#
# Copyright (c) 2004 Robert Shaw <rshaw@opendarwin.org>
# Copyright (c) 2002 Apple Computer, Inc.
@@ -1072,8 +1072,11 @@ while {[moreargs]} {
if {[string index $arg 0] != "-"} {
break
} elseif {[string index $arg 1] == "-"} {
# Process long args -- we don't support any for now
print_usage; exit 1
# Process long arguments
switch -- $arg {
--version { puts {(please use "version" to get version information)}; set action "version" }
default { print_usage; exit 1 }
}
} else {
# Process short arg(s)
set opts [string range $arg 1 end]

0 comments on commit dcfe311

Please sign in to comment.
You can’t perform that action at this time.