Skip to content

Commit 2117574

Browse files
committed
fix option parsing
thanks @gghose
1 parent 040d339 commit 2117574

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

XcodeLegacy.sh

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -21,46 +21,6 @@
2121
#set -e
2222
#set -u
2323

24-
if [ $# != 1 ]; then
25-
# ################################################################################ 80 cols
26-
echo "Usage: $0 [-compilers|-osx104|-osx105|-osx106|-osx107|-osx108|-osx109|-osx1010|-osx1011] buildpackages|install|installbeta|cleanpackages|uninstall|uninstallbeta"
27-
echo "Description: Extracts / installs / cleans / uninstalls the following components"
28-
echo "from Xcode 3.2.6, Xcode 4.6.3, Xcode 5.1.1, Xcode 6.4 and Xcode 7.3.1, which"
29-
echo "are not available in Xcode >= 4.2:"
30-
echo " - GCC 4.0 Xcode plugin"
31-
echo " - PPC assembler and linker"
32-
echo " - GCC 4.0 and 4.2"
33-
echo " - Mac OS X SDK 10.4u, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11"
34-
echo ""
35-
echo "An optional first argument may be provided to limit the operation (by default"
36-
echo "everything is done):"
37-
echo " -compilers : only install the gcc and llvm-gcc compilers, as well as the"
38-
echo " corresponding Xcode plugins"
39-
echo " -osx104 : only install Mac OSX 10.4 SDK"
40-
echo " -osx105 : only install Mac OSX 10.5 SDK"
41-
echo " -osx106 : only install Mac OSX 10.6 SDK"
42-
echo " -osx107 : only install Mac OSX 10.7 SDK"
43-
echo " -osx108 : only install OSX 10.8 SDK"
44-
echo " -osx109 : only install OSX 10.9 SDK"
45-
echo " -osx1010 : only install OSX 10.10 SDK"
46-
echo " -osx1011 : only install OSX 10.11 SDK"
47-
echo "Note that these cannot be combined. For example, to build and install the 10.9"
48-
echo "and 10.10 SDKs, one should execute:"
49-
echo "$ $0 -osx109 buildpackages"
50-
echo "$ $0 -osx1010 buildpackages"
51-
echo "$ sudo $0 -osx109 install"
52-
echo "$ sudo $0 -osx1010 install"
53-
echo ""
54-
echo "Typically, you will want to run this script with the buildpackages argument"
55-
echo "first, then the install argument, and lastly the cleanpackages argument, in"
56-
echo "order to properly install the legacy Xcode files."
57-
echo "The install and uninstall phases have to be run with administrative rights, as"
58-
echo "in:"
59-
echo " $ sudo $0 install"
60-
echo "installbeta and uninstallbeta work on the beta versions of Xcode"
61-
exit
62-
fi
63-
6424
compilers=0
6525
osx104=0
6626
osx105=0
@@ -121,6 +81,46 @@ case $1 in
12181
;;
12282
esac
12383

84+
if [ $# != 1 ]; then
85+
# ################################################################################ 80 cols
86+
echo "Usage: $0 [-compilers|-osx104|-osx105|-osx106|-osx107|-osx108|-osx109|-osx1010|-osx1011] buildpackages|install|installbeta|cleanpackages|uninstall|uninstallbeta"
87+
echo "Description: Extracts / installs / cleans / uninstalls the following components"
88+
echo "from Xcode 3.2.6, Xcode 4.6.3, Xcode 5.1.1, Xcode 6.4 and Xcode 7.3.1, which"
89+
echo "are not available in Xcode >= 4.2:"
90+
echo " - GCC 4.0 Xcode plugin"
91+
echo " - PPC assembler and linker"
92+
echo " - GCC 4.0 and 4.2"
93+
echo " - Mac OS X SDK 10.4u, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11"
94+
echo ""
95+
echo "An optional first argument may be provided to limit the operation (by default"
96+
echo "everything is done):"
97+
echo " -compilers : only install the gcc and llvm-gcc compilers, as well as the"
98+
echo " corresponding Xcode plugins"
99+
echo " -osx104 : only install Mac OSX 10.4 SDK"
100+
echo " -osx105 : only install Mac OSX 10.5 SDK"
101+
echo " -osx106 : only install Mac OSX 10.6 SDK"
102+
echo " -osx107 : only install Mac OSX 10.7 SDK"
103+
echo " -osx108 : only install OSX 10.8 SDK"
104+
echo " -osx109 : only install OSX 10.9 SDK"
105+
echo " -osx1010 : only install OSX 10.10 SDK"
106+
echo " -osx1011 : only install OSX 10.11 SDK"
107+
echo "Note that these cannot be combined. For example, to build and install the 10.9"
108+
echo "and 10.10 SDKs, one should execute:"
109+
echo "$ $0 -osx109 buildpackages"
110+
echo "$ $0 -osx1010 buildpackages"
111+
echo "$ sudo $0 -osx109 install"
112+
echo "$ sudo $0 -osx1010 install"
113+
echo ""
114+
echo "Typically, you will want to run this script with the buildpackages argument"
115+
echo "first, then the install argument, and lastly the cleanpackages argument, in"
116+
echo "order to properly install the legacy Xcode files."
117+
echo "The install and uninstall phases have to be run with administrative rights, as"
118+
echo "in:"
119+
echo " $ sudo $0 install"
120+
echo "installbeta and uninstallbeta work on the beta versions of Xcode"
121+
exit
122+
fi
123+
124124
XCODEDIR="/Developer"
125125
PLUGINDIR="$XCODEDIR/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins"
126126
GCCDIR="$XCODEDIR"

0 commit comments

Comments
 (0)