[MacPorts] #29410: gawk @3.1.8: add --enable-switch

MacPorts noreply at macports.org
Wed Jul 6 23:32:31 PDT 2011


#29410: gawk @3.1.8: add --enable-switch
------------------------------+---------------------------------------------
 Reporter:  axkibe@…          |       Owner:  mschamschula@…        
     Type:  enhancement       |      Status:  new                   
 Priority:  Normal            |   Milestone:                        
Component:  ports             |     Version:  1.9.2                 
 Keywords:  haspatch          |        Port:  gawk                  
------------------------------+---------------------------------------------

Comment(by axkibe@…):

 Any script that has a switch statement in it.

 E.g. Run this with:
 $ gawk -f switch.awk -v time="year"

 See also http://www.gnu.org/software/gawk/manual/html_node/Switch-
 Statement.html

 --------------
 BEGIN {
         IGNORECASE = 1
         switch(time) {
                 case "year":
                         timeformat = "%Y"
                         break
                 case "month":
                         timeformat = "%Y-%b"
                         break
                 case "day":
                         timeformat = "%Y-%b-%d"
                         break
                 case "hour":
                         timeformat = "%Y-%b-%d %H"
                         break
                 case "minute":
                         timeformat = "%Y-%b-%d %H:%M"
                         break
                 default:
                         print "missing timeformat"
                         exit
         }

         print timeformat
         exit
 }
 --------------

-- 
Ticket URL: <https://trac.macports.org/ticket/29410#comment:3>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list