Created
December 19, 2010 16:39
-
-
Save juanarzola/747464 to your computer and use it in GitHub Desktop.
Generate a switch statement from a selection of #define statements. This is intended to be used within Xcode user scripts. (Make sure that "directory" is set to "home")
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "switch(<#expression#>){" | |
echo -n "%%%{PBXSelection}%%%" | |
awk '/#define/ {print " case "$2":{\n break;\n }"}' <&0 | |
echo -n "%%%{PBXSelection}%%%" | |
echo "}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment