[48131] trunk/base/src/port/port.tcl

raimue at macports.org raimue at macports.org
Sat Mar 14 23:05:40 PDT 2009


Revision: 48131
          http://trac.macports.org/changeset/48131
Author:   raimue at macports.org
Date:     2009-03-14 23:05:39 -0700 (Sat, 14 Mar 2009)
Log Message:
-----------
port/port.tcl:
Avoid storing the synopsis twice

Modified Paths:
--------------
    trunk/base/src/port/port.tcl

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2009-03-15 05:52:17 UTC (rev 48130)
+++ trunk/base/src/port/port.tcl	2009-03-15 06:05:39 UTC (rev 48131)
@@ -41,26 +41,26 @@
 
 
 # Standard procedures
-proc print_usage {args} {
+proc print_usage {{verbose 1}} {
     global cmdname
     set syntax {
         [-bcdfiknopqRstuvxy] [-D portdir] [-F cmdfile] action [privopts] [actionflags]
         [[portname|pseudo-portname|port-url] [@version] [+-variant]... [option=value]...]...
     }
 
-    puts stderr "Usage: $cmdname$syntax"
-    puts stderr "\"$cmdname help\" or \"man 1 port\" for more information."
+    if {$verbose} {
+        puts stderr "Usage: $cmdname$syntax"
+        puts stderr "\"$cmdname help\" or \"man 1 port\" for more information."
+    } else {
+        puts stderr "$cmdname$syntax"
+    }
 }
 
 proc print_help {args} {
-    global cmdname
     global action_array
-    
-    set syntax {
-        [-bcdfiknopqRstuvx] [-D portdir] [-F cmdfile] action [privopts] [actionflags]
-        [[portname|pseudo-portname|port-url] [@version] [+-variant]... [option=value]...]...
-    }
 
+    print_usage 0
+
     # Generate and format the command list from the action_array
     set cmds ""
     set lineLen 0
@@ -77,12 +77,12 @@
         incr lineLen [string length $new]
         set cmds "$cmds$new"
     }
-    
-    set cmdText "
+
+    set cmdText [string range "
 Supported commands
 ------------------
 $cmds
-"
+" 1 end-1]
 
     set text {
 Pseudo-portnames
@@ -116,8 +116,7 @@
 porthier(7), portstyle(7). Also, see http://www.macports.org.
     }
 
-
-    puts "$cmdname$syntax $cmdText $text"
+    puts "$cmdText $text"
 }
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090314/79118e4b/attachment.html>


More information about the macports-changes mailing list