mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-19 23:21:15 -03:00
Compare commits
1077 Commits
OpenBeta_r
...
Integratio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0986b6d991 | ||
|
|
7f4908b0db | ||
|
|
482e615fe0 | ||
|
|
9c78295a9a | ||
|
|
fd70ae0b61 | ||
|
|
3e2d68a059 | ||
|
|
78e2b7cc08 | ||
|
|
397249a8d5 | ||
|
|
b44b624ca5 | ||
|
|
b5cd21c337 | ||
|
|
4cb4fc3ef8 | ||
|
|
af14cf8f8b | ||
|
|
c0989dce2d | ||
|
|
8412c867a5 | ||
|
|
10642a34f1 | ||
|
|
3c5d5b344e | ||
|
|
4980959fce | ||
|
|
8edb53e902 | ||
|
|
460bfc6853 | ||
|
|
3e5b8f1e97 | ||
|
|
fab7299d49 | ||
|
|
09ff1e7af0 | ||
|
|
ad5ae9ba3b | ||
|
|
3788f462b4 | ||
|
|
238bbfcbbb | ||
|
|
0efa211a05 | ||
|
|
00a890c8c7 | ||
|
|
6990871efd | ||
|
|
a62ebc9a69 | ||
|
|
6c82e7acda | ||
|
|
084e435883 | ||
|
|
2f33e5919d | ||
|
|
cbe615224d | ||
|
|
6c70ed79ae | ||
|
|
488652c23a | ||
|
|
bb3a00d1eb | ||
|
|
bf3cf2580f | ||
|
|
843944f558 | ||
|
|
991c900fc6 | ||
|
|
0d2af9e742 | ||
|
|
4aa9f76d06 | ||
|
|
1235e60a29 | ||
|
|
735af50ce9 | ||
|
|
7ce5f34d6f | ||
|
|
f76a16a727 | ||
|
|
f2a5237802 | ||
|
|
4ea92a97ea | ||
|
|
a7ed3658e3 | ||
|
|
061b872498 | ||
|
|
97ea61a407 | ||
|
|
44bd405ed3 | ||
|
|
73f1030bde | ||
|
|
fdef82f89c | ||
|
|
3d68d1bbe2 | ||
|
|
c2dcfc9176 | ||
|
|
df300e042b | ||
|
|
3996f178e5 | ||
|
|
7935b1613a | ||
|
|
8df81f93c8 | ||
|
|
95d5e55df2 | ||
|
|
daf3469ce4 | ||
|
|
1565f9d9c3 | ||
|
|
b56542a9f1 | ||
|
|
5b5b53872c | ||
|
|
1442a2abe8 | ||
|
|
e031fa7207 | ||
|
|
1b521d0822 | ||
|
|
e529f4d75f | ||
|
|
307a4ae9e8 | ||
|
|
46452e7634 | ||
|
|
ee3b355c34 | ||
|
|
61c5b631f3 | ||
|
|
b993dce12f | ||
|
|
cd1c2f74d3 | ||
|
|
a1020b3e61 | ||
|
|
1b1aa07414 | ||
|
|
5023ade7ac | ||
|
|
9921e9e79f | ||
|
|
5ef13d9011 | ||
|
|
3816abb9de | ||
|
|
7561075af8 | ||
|
|
fe10f98038 | ||
|
|
6709d1067d | ||
|
|
74e27a0a82 | ||
|
|
04c0ac9ee8 | ||
|
|
8159f55243 | ||
|
|
cca60adc35 | ||
|
|
16ba544edd | ||
|
|
f230da12c5 | ||
|
|
03aae47424 | ||
|
|
df0aaa1ebe | ||
|
|
68f9342060 | ||
|
|
c38a40d193 | ||
|
|
23ba7b5bff | ||
|
|
173fd4fd23 | ||
|
|
3a893ff17f | ||
|
|
da89591a53 | ||
|
|
097e2030b4 | ||
|
|
24f1da7f30 | ||
|
|
85ce80d72e | ||
|
|
ec1037fcbc | ||
|
|
7a1bedcab6 | ||
|
|
06b4964dd8 | ||
|
|
d2ffdc8986 | ||
|
|
7e1a3148fb | ||
|
|
5559962f6f | ||
|
|
1d67d8ff23 | ||
|
|
9f46881c16 | ||
|
|
dead45fa67 | ||
|
|
a8af974895 | ||
|
|
8605cc685d | ||
|
|
9a49b2c9fb | ||
|
|
b6f495d107 | ||
|
|
05233aa6f4 | ||
|
|
7541fac245 | ||
|
|
7b6780f712 | ||
|
|
d6791a836b | ||
|
|
69c6b007aa | ||
|
|
ee113a5632 | ||
|
|
4899086b3c | ||
|
|
f4f2847662 | ||
|
|
fb89e1a26f | ||
|
|
e849beabba | ||
|
|
2979d3bf16 | ||
|
|
88efc73797 | ||
|
|
77b13d02f0 | ||
|
|
588c520c4a | ||
|
|
d371af0504 | ||
|
|
3e115b7a85 | ||
|
|
ca8e4c08a7 | ||
|
|
6ec4591f02 | ||
|
|
679ef95257 | ||
|
|
5818289c2d | ||
|
|
d407d680ea | ||
|
|
feb36e7342 | ||
|
|
8ab81e6d4b | ||
|
|
4fc2ee1bd4 | ||
|
|
07c48590c0 | ||
|
|
4388b73077 | ||
|
|
d7c6855918 | ||
|
|
e5e7da1482 | ||
|
|
64921fe08a | ||
|
|
79d5ff0350 | ||
|
|
ada3ab4213 | ||
|
|
a00b979bb6 | ||
|
|
b1d8492c3f | ||
|
|
75fe438f21 | ||
|
|
8cdcfc2a91 | ||
|
|
2a06c72113 | ||
|
|
05563ab11e | ||
|
|
625a1cb0b5 | ||
|
|
ed8ff85d2a | ||
|
|
b482cab7be | ||
|
|
0bf5316249 | ||
|
|
969928e500 | ||
|
|
f30a5fe288 | ||
|
|
6f3d7209c2 | ||
|
|
82b589e390 | ||
|
|
b280cc5e75 | ||
|
|
1964b04ea9 | ||
|
|
c4bc216815 | ||
|
|
3af40efdb1 | ||
|
|
27d84ef8be | ||
|
|
be77b9201e | ||
|
|
0479f0ad63 | ||
|
|
aa8b3cb6d6 | ||
|
|
c62d9c37d2 | ||
|
|
70fbb4623f | ||
|
|
6aebeca1d0 | ||
|
|
e3ea953ff4 | ||
|
|
8dd9602f06 | ||
|
|
92d2e681d6 | ||
|
|
c82dbaca8b | ||
|
|
6faeb71770 | ||
|
|
d534b0ba81 | ||
|
|
87a0363ba7 | ||
|
|
0005702399 | ||
|
|
8642a1e68e | ||
|
|
ec1d2e86c8 | ||
|
|
2a46b984cd | ||
|
|
5a7b85adc7 | ||
|
|
914f83cb10 | ||
|
|
db969dc85a | ||
|
|
5b39d1819f | ||
|
|
3fe1adfc6d | ||
|
|
0af49d0533 | ||
|
|
d5c1bf98d7 | ||
|
|
5753fa2106 | ||
|
|
31b01f8de3 | ||
|
|
222e36ee3e | ||
|
|
f9c2a77c67 | ||
|
|
92099c7af2 | ||
|
|
58ad04b61c | ||
|
|
97bea94550 | ||
|
|
51ae9b3ed4 | ||
|
|
4726221d18 | ||
|
|
7353c6f94d | ||
|
|
91a04c7638 | ||
|
|
1511de68ed | ||
|
|
d6c9d3ce94 | ||
|
|
c64a86efae | ||
|
|
c522c0833a | ||
|
|
28fdfec7cb | ||
|
|
d3bb2a718a | ||
|
|
cabebd9f51 | ||
|
|
886c4320d6 | ||
|
|
379cf3d249 | ||
|
|
0fe44f0e2a | ||
|
|
07b7a65b86 | ||
|
|
7e7b50cd74 | ||
|
|
0b8f7d4fe7 | ||
|
|
93278dc7e3 | ||
|
|
a3c87fb30b | ||
|
|
228fa38240 | ||
|
|
a142c5e1ec | ||
|
|
4702283280 | ||
|
|
918df393e6 | ||
|
|
1e415a9943 | ||
|
|
c955379971 | ||
|
|
1debe4f055 | ||
|
|
9b9ce31550 | ||
|
|
292908c00a | ||
|
|
e027492e11 | ||
|
|
640118e781 | ||
|
|
c6ec2645dc | ||
|
|
5d75ee7721 | ||
|
|
70208eb33a | ||
|
|
825a7311ea | ||
|
|
09b0213738 | ||
|
|
8214ae9b15 | ||
|
|
e63ef84ac1 | ||
|
|
697c44a293 | ||
|
|
18e34902a5 | ||
|
|
4b0c3ffc2f | ||
|
|
b4d33a58b1 | ||
|
|
c177965da5 | ||
|
|
220e1e8fb5 | ||
|
|
464187491f | ||
|
|
fd15d30987 | ||
|
|
03e36bda72 | ||
|
|
a259c37415 | ||
|
|
54c21f5974 | ||
|
|
08f378c359 | ||
|
|
58818e9738 | ||
|
|
599556d7d1 | ||
|
|
9e4d7b41e0 | ||
|
|
b35a2d568a | ||
|
|
9ca12e9f9d | ||
|
|
908b07527e | ||
|
|
ee7339b661 | ||
|
|
35610da204 | ||
|
|
c06b1694a2 | ||
|
|
c238bdd861 | ||
|
|
d378904b98 | ||
|
|
3a4a2a6dac | ||
|
|
cfe815135e | ||
|
|
2eb97edf02 | ||
|
|
cdfb5c2bd8 | ||
|
|
8f9ba2cd09 | ||
|
|
ee95a7309a | ||
|
|
f32dfe2da6 | ||
|
|
9f0775c873 | ||
|
|
9169a673d5 | ||
|
|
37123ee053 | ||
|
|
c2616e385c | ||
|
|
5297d46017 | ||
|
|
2ef9126744 | ||
|
|
1d2cd99e96 | ||
|
|
994e9fe9de | ||
|
|
e63a2a2152 | ||
|
|
2997ce2e3c | ||
|
|
b8028c1b1d | ||
|
|
568de8157a | ||
|
|
924b646b79 | ||
|
|
f8786c25be | ||
|
|
92b2c28532 | ||
|
|
cc0c44f36b | ||
|
|
ce279e9c2d | ||
|
|
84978b7132 | ||
|
|
e4e9f6f221 | ||
|
|
77ec902ca7 | ||
|
|
7d9b0a00e4 | ||
|
|
f3c1ca3564 | ||
|
|
f109fa227d | ||
|
|
8befc474c1 | ||
|
|
622efba247 | ||
|
|
ce0c52d353 | ||
|
|
b03515276e | ||
|
|
30af350be0 | ||
|
|
1287b9d823 | ||
|
|
91aab03b90 | ||
|
|
e921dc50e0 | ||
|
|
dd6bb04ba7 | ||
|
|
c80bd104d2 | ||
|
|
22d1aaa27d | ||
|
|
2f5016262a | ||
|
|
47583877f1 | ||
|
|
1dbff80691 | ||
|
|
7abf6c71ad | ||
|
|
2da81b0ae7 | ||
|
|
d4c881791f | ||
|
|
516be01366 | ||
|
|
2b99190a1b | ||
|
|
3087f57453 | ||
|
|
4a4f8ec523 | ||
|
|
0c004147c0 | ||
|
|
451eb13e0e | ||
|
|
4e84cf1d38 | ||
|
|
72b7e64ad8 | ||
|
|
c3690b0878 | ||
|
|
b3f248fd19 | ||
|
|
d4686e6a59 | ||
|
|
14af6ba2af | ||
|
|
c3ee3af201 | ||
|
|
6496adf101 | ||
|
|
79f8d5c51e | ||
|
|
74ef1bc8ff | ||
|
|
26eeb9f37a | ||
|
|
ab385cd609 | ||
|
|
0f12f2b6b1 | ||
|
|
32c1d50887 | ||
|
|
956c94f30a | ||
|
|
3e69e5b082 | ||
|
|
330faab6cd | ||
|
|
fe6699f0bf | ||
|
|
807c5f2ef2 | ||
|
|
f7708955b6 | ||
|
|
be9024767e | ||
|
|
a1a83f8880 | ||
|
|
eb3a1f6739 | ||
|
|
03c1f2ef5b | ||
|
|
d215e86662 | ||
|
|
10962d7175 | ||
|
|
6889232b41 | ||
|
|
c54097af20 | ||
|
|
7c6695354e | ||
|
|
2d7fbf2476 | ||
|
|
1ef8206db1 | ||
|
|
b65f8d81fc | ||
|
|
e285d2939b | ||
|
|
6b602a4589 | ||
|
|
084542b943 | ||
|
|
ef8ea97044 | ||
|
|
dd6d0e774c | ||
|
|
f934310337 | ||
|
|
afe293c20a | ||
|
|
7f0a68f8d6 | ||
|
|
2517832718 | ||
|
|
bcf3accb74 | ||
|
|
1c5556334d | ||
|
|
299d803396 | ||
|
|
d513ace39d | ||
|
|
d5a9a4463c | ||
|
|
cf0baada2c | ||
|
|
49589e2da0 | ||
|
|
0e24676144 | ||
|
|
b0132821ac | ||
|
|
24afe544a3 | ||
|
|
3d7ff9f758 | ||
|
|
a81e70350b | ||
|
|
7f6f0ca103 | ||
|
|
c89bc73740 | ||
|
|
3100669b79 | ||
|
|
22c670c3d3 | ||
|
|
c37c7cee05 | ||
|
|
46579f3799 | ||
|
|
6de30028a8 | ||
|
|
c78c1427be | ||
|
|
953e7fd717 | ||
|
|
1ae08cfedf | ||
|
|
3c116cd077 | ||
|
|
bcab703e31 | ||
|
|
73046ec838 | ||
|
|
e1734468f5 | ||
|
|
aa78292c2a | ||
|
|
8bbd8ab073 | ||
|
|
b936be8e34 | ||
|
|
b8f34cdd35 | ||
|
|
993c028579 | ||
|
|
9285ade8a8 | ||
|
|
83e9f0dd91 | ||
|
|
c641f5cbdc | ||
|
|
c6302e3b3f | ||
|
|
94acb6ed5d | ||
|
|
42497d9932 | ||
|
|
3f172d13b2 | ||
|
|
437b4397b9 | ||
|
|
3a7ab3f030 | ||
|
|
fccf38a4d6 | ||
|
|
46edc49ede | ||
|
|
c05281492d | ||
|
|
5cebd3abf7 | ||
|
|
5ed5d637b8 | ||
|
|
516e18900c | ||
|
|
0970487cca | ||
|
|
d38f1380e9 | ||
|
|
2626b83b08 | ||
|
|
db0659aab4 | ||
|
|
e23a60a6bb | ||
|
|
3ea8d83d3f | ||
|
|
d9445f04b1 | ||
|
|
1543d02f96 | ||
|
|
11a444e914 | ||
|
|
2a6412481e | ||
|
|
b4447bfa4d | ||
|
|
72b5988e56 | ||
|
|
3a2c3c2288 | ||
|
|
9762a8ca1e | ||
|
|
e02e5e503d | ||
|
|
e4329f3ae7 | ||
|
|
f7082ee034 | ||
|
|
3ac9621f87 | ||
|
|
46e92e998e | ||
|
|
77dfd7b783 | ||
|
|
7d480ff579 | ||
|
|
37140d5e10 | ||
|
|
b04e874e43 | ||
|
|
d146f578a4 | ||
|
|
40c0c5a298 | ||
|
|
3a475a99fc | ||
|
|
9394583f96 | ||
|
|
3b4f4c5f59 | ||
|
|
34f2f77067 | ||
|
|
6b94708508 | ||
|
|
1d93e89eed | ||
|
|
e0e0bcdc1e | ||
|
|
1ed8af2ee8 | ||
|
|
3830c0adc4 | ||
|
|
5dbda6cd95 | ||
|
|
d8dbdc83c0 | ||
|
|
359a7cebde | ||
|
|
490ead52eb | ||
|
|
a5a7a32447 | ||
|
|
7e9652787b | ||
|
|
3b00d06a62 | ||
|
|
234fb7c2fe | ||
|
|
2c7e0ef577 | ||
|
|
2cbcc82968 | ||
|
|
b48e504522 | ||
|
|
4cce303c89 | ||
|
|
6a97b45ad1 | ||
|
|
1afdbb848e | ||
|
|
4d19bb17a9 | ||
|
|
b2012467b3 | ||
|
|
daf5ef1bbd | ||
|
|
85a5319c4b | ||
|
|
6ca11044a4 | ||
|
|
42be7733fe | ||
|
|
1d75c232ff | ||
|
|
97c9c9c9d1 | ||
|
|
ab52469fbb | ||
|
|
fba984272a | ||
|
|
fb3a41d3ad | ||
|
|
be7d02ebdd | ||
|
|
b989978dd3 | ||
|
|
d9c9760aac | ||
|
|
6ff88a44f0 | ||
|
|
cbcc439e03 | ||
|
|
bf282e9bd7 | ||
|
|
4c3d3af73e | ||
|
|
10648cac5b | ||
|
|
3bfcd5e105 | ||
|
|
87aca05e7f | ||
|
|
94b1d58cc2 | ||
|
|
c55cbd3f2f | ||
|
|
d89fcdcc5f | ||
|
|
76f715c486 | ||
|
|
bbab6b2fdc | ||
|
|
a8e92639af | ||
|
|
d99c2cb9a7 | ||
|
|
9f8fe3d5e3 | ||
|
|
3c8c8a7559 | ||
|
|
a61e2caadb | ||
|
|
f109d535b1 | ||
|
|
12095c721c | ||
|
|
7b873179ad | ||
|
|
f1d923714a | ||
|
|
b9ba227733 | ||
|
|
f7754a2927 | ||
|
|
125d12798d | ||
|
|
d3bec4e686 | ||
|
|
1b0e4a0067 | ||
|
|
286bef5eb7 | ||
|
|
c9b4163e23 | ||
|
|
fbedf020bc | ||
|
|
d3e9183303 | ||
|
|
aaa0c25ff7 | ||
|
|
2f43584727 | ||
|
|
e7c1cb7185 | ||
|
|
911c37e63e | ||
|
|
8b40f09e17 | ||
|
|
93dfb6f7d6 | ||
|
|
547b0a9850 | ||
|
|
4416753df0 | ||
|
|
dc54ec5b2b | ||
|
|
b682c4102e | ||
|
|
6d522e6ed6 | ||
|
|
635c87d629 | ||
|
|
a355cf24f1 | ||
|
|
bc7ad955a3 | ||
|
|
05125341f1 | ||
|
|
12332328c1 | ||
|
|
8d95d0834d | ||
|
|
db5eebd372 | ||
|
|
b119b4f1da | ||
|
|
694ab455cd | ||
|
|
46edc07ae4 | ||
|
|
2a7fc9c3a5 | ||
|
|
be23c0755e | ||
|
|
db55176212 | ||
|
|
66a445f043 | ||
|
|
6527a48897 | ||
|
|
3f9706a7f3 | ||
|
|
41fc3bcb74 | ||
|
|
d46859b9e8 | ||
|
|
51a955c75c | ||
|
|
9a89da3b33 | ||
|
|
e8da9999f6 | ||
|
|
3f5c02bf92 | ||
|
|
e918851902 | ||
|
|
e411bac592 | ||
|
|
ded81ec186 | ||
|
|
cd276030c1 | ||
|
|
818533f9f0 | ||
|
|
ff7cbab991 | ||
|
|
ad8d68dd43 | ||
|
|
0db1b6ce44 | ||
|
|
843d5a5977 | ||
|
|
406d7f1a47 | ||
|
|
7df89566f3 | ||
|
|
32b2c9fc9e | ||
|
|
3f8baeba20 | ||
|
|
1879dc4b59 | ||
|
|
ea8c6bc15e | ||
|
|
4683ce2771 | ||
|
|
798537d47b | ||
|
|
0257b02a8c | ||
|
|
27e71c5f37 | ||
|
|
cddf7e0986 | ||
|
|
2b35b3f06e | ||
|
|
92b2376c23 | ||
|
|
412902e4ae | ||
|
|
29fda9cb6c | ||
|
|
e7b3f5745c | ||
|
|
268d64d244 | ||
|
|
8f045b9ec5 | ||
|
|
2ea1c2be92 | ||
|
|
5e9ca72731 | ||
|
|
debfc0f712 | ||
|
|
1e65e7c996 | ||
|
|
d12b1650aa | ||
|
|
70a75dc88a | ||
|
|
fa090f2c9f | ||
|
|
b6bd6e399d | ||
|
|
a3b497b271 | ||
|
|
55b3cf4627 | ||
|
|
eb1c00c56b | ||
|
|
c58278758c | ||
|
|
3d0d9a250b | ||
|
|
274f018494 | ||
|
|
970d05df39 | ||
|
|
abae08a9fb | ||
|
|
a0edee51fa | ||
|
|
887474d607 | ||
|
|
3bf3c11b0b | ||
|
|
6d61919941 | ||
|
|
e07de09460 | ||
|
|
98a17f4046 | ||
|
|
f850c021b7 | ||
|
|
8600243683 | ||
|
|
c6e5987480 | ||
|
|
e0c858478a | ||
|
|
a3b15b995e | ||
|
|
57ef5289fe | ||
|
|
a63c0311bb | ||
|
|
9808829ece | ||
|
|
00b6431ad9 | ||
|
|
e020ad0c06 | ||
|
|
df0c1eb32c | ||
|
|
9057801c4b | ||
|
|
0f443ef37b | ||
|
|
a20e0b9e2e | ||
|
|
4b6bd7cae5 | ||
|
|
6f35792c74 | ||
|
|
f1b375b042 | ||
|
|
4e672427bc | ||
|
|
165068c81d | ||
|
|
89993e9cbf | ||
|
|
78ab7e7ba1 | ||
|
|
424bb589a2 | ||
|
|
664fee5c6e | ||
|
|
146a353085 | ||
|
|
214ef3dd0b | ||
|
|
406c8a6d1e | ||
|
|
6416cb45fb | ||
|
|
1db7c6233b | ||
|
|
640beafa8c | ||
|
|
44f70d2b52 | ||
|
|
acbb6fb8e2 | ||
|
|
1163961927 | ||
|
|
e1190eb1f3 | ||
|
|
dc37a8079e | ||
|
|
373cca0bf6 | ||
|
|
b32fcc7a8e | ||
|
|
e9c226b8be | ||
|
|
af9d611847 | ||
|
|
9d6c4fa678 | ||
|
|
b66233de78 | ||
|
|
ff49792f44 | ||
|
|
b2abd963f0 | ||
|
|
0ab9cf8054 | ||
|
|
c70e92e98d | ||
|
|
bf10d6c03b | ||
|
|
de084b4a0d | ||
|
|
e46cbea251 | ||
|
|
7f6e63aba5 | ||
|
|
25081f60c4 | ||
|
|
91bf41cfce | ||
|
|
552d8f394e | ||
|
|
f8e01628b2 | ||
|
|
3d1ad89963 | ||
|
|
2188bb9b88 | ||
|
|
f0000ea7d2 | ||
|
|
5b173dafae | ||
|
|
c939f2ee45 | ||
|
|
309dfeb6a8 | ||
|
|
bf3e4126b2 | ||
|
|
8a357e1866 | ||
|
|
b8135574c3 | ||
|
|
85fdf587c0 | ||
|
|
8d4a701f86 | ||
|
|
1c83144773 | ||
|
|
edb973fadc | ||
|
|
77f1b1f0fe | ||
|
|
a79d3c680c | ||
|
|
ac023f7588 | ||
|
|
f3c8f535a4 | ||
|
|
b02f6cf3bc | ||
|
|
b7c4a4fc3b | ||
|
|
9f33050a32 | ||
|
|
f73caeb6a3 | ||
|
|
15da4aaec7 | ||
|
|
9ee7b0a501 | ||
|
|
3c116f6ab3 | ||
|
|
431ef224e0 | ||
|
|
600aeb6ccc | ||
|
|
a4c646f75c | ||
|
|
7f35f98d7d | ||
|
|
8b10b0a614 | ||
|
|
a9ada13a23 | ||
|
|
1ae0e5d7cb | ||
|
|
808fac9b14 | ||
|
|
737972be2f | ||
|
|
4cb70e8e2a | ||
|
|
abf3ee6563 | ||
|
|
1a0a3d85ca | ||
|
|
1bbac9e5ce | ||
|
|
705793eae6 | ||
|
|
efa6e38741 | ||
|
|
183aea5c96 | ||
|
|
97ddf9a4f3 | ||
|
|
489366290a | ||
|
|
fb8f16373f | ||
|
|
fed352653d | ||
|
|
a697b2b60e | ||
|
|
efe9c82bc6 | ||
|
|
2bdb199169 | ||
|
|
d0dabb0ff6 | ||
|
|
27e4ece24f | ||
|
|
fc898eff65 | ||
|
|
dd317709f8 | ||
|
|
fde9842a8e | ||
|
|
3bf88110aa | ||
|
|
cc5c411039 | ||
|
|
37bdb20092 | ||
|
|
e31431140a | ||
|
|
8a66ba6c35 | ||
|
|
8a446f43ff | ||
|
|
d6b5558cf2 | ||
|
|
50c04752f5 | ||
|
|
2a91a7640c | ||
|
|
6b35250099 | ||
|
|
2ba92f92b7 | ||
|
|
0b1e371880 | ||
|
|
ce15abd577 | ||
|
|
30392bf66a | ||
|
|
71233ee894 | ||
|
|
af3059ab2a | ||
|
|
1f0ae8b06d | ||
|
|
d5af389d2e | ||
|
|
644607c29f | ||
|
|
aa477195d4 | ||
|
|
b0a9a5a756 | ||
|
|
882a62ad52 | ||
|
|
f9697c8e36 | ||
|
|
0479060858 | ||
|
|
c2e5403408 | ||
|
|
3d2b12e72a | ||
|
|
09b1eee5d0 | ||
|
|
28264423a4 | ||
|
|
87baa4d3d2 | ||
|
|
c5031c2b39 | ||
|
|
82223d3bad | ||
|
|
56dd25667d | ||
|
|
d4a171a791 | ||
|
|
978066a6de | ||
|
|
2628da4a59 | ||
|
|
ccb157c7a3 | ||
|
|
d43c803bfe | ||
|
|
eec6db0a23 | ||
|
|
983bc5cecc | ||
|
|
60435f99b9 | ||
|
|
332cda6b16 | ||
|
|
8d73f2af34 | ||
|
|
6a8219a02e | ||
|
|
c8f7d33a9a | ||
|
|
40ec2303ff | ||
|
|
19eddddcff | ||
|
|
b1e86d6fea | ||
|
|
b9283d48b5 | ||
|
|
33fc5c99ea | ||
|
|
a4581cb233 | ||
|
|
36dfc9f1bf | ||
|
|
4a55fff3b9 | ||
|
|
02f16e90b6 | ||
|
|
984a498063 | ||
|
|
c1b51c6530 | ||
|
|
224de547b3 | ||
|
|
43d2e15bb7 | ||
|
|
ac70772070 | ||
|
|
1feea366ca | ||
|
|
f599239fd4 | ||
|
|
a122d2eb50 | ||
|
|
17e7860700 | ||
|
|
34fab879cb | ||
|
|
b02ed0bbe6 | ||
|
|
165ba535f0 | ||
|
|
8253df7c3d | ||
|
|
4788da204b | ||
|
|
cf11d1e4e6 | ||
|
|
e557327860 | ||
|
|
e152cfac34 | ||
|
|
464f1f44aa | ||
|
|
bf27cb1f5e | ||
|
|
654010f639 | ||
|
|
918f84438f | ||
|
|
93e2415924 | ||
|
|
4837a2d0df | ||
|
|
be80e1a863 | ||
|
|
e53e00c4f9 | ||
|
|
90495f3ac5 | ||
|
|
6fc9e6f21e | ||
|
|
7117c4a5ee | ||
|
|
a3a7c48799 | ||
|
|
f545fb2491 | ||
|
|
e73be48d96 | ||
|
|
04b1b83039 | ||
|
|
e9d216bc84 | ||
|
|
87510ac77d | ||
|
|
44ce3e6731 | ||
|
|
26678682ca | ||
|
|
7d63900fb8 | ||
|
|
e47d56a84f | ||
|
|
9b52269a5b | ||
|
|
9992b8eb0e | ||
|
|
bab69f2672 | ||
|
|
2e33633698 | ||
|
|
eb7601d116 | ||
|
|
5827bfd9a2 | ||
|
|
dc8cc39bc8 | ||
|
|
47df1ae40a | ||
|
|
c9c2fc5ee3 | ||
|
|
b79854ad1a | ||
|
|
8229b17f0d | ||
|
|
4a5d02aab4 | ||
|
|
ed4e6cd3a5 | ||
|
|
7d45e6f12f | ||
|
|
0302162d8e | ||
|
|
1dfa404210 | ||
|
|
bd4551e2ef | ||
|
|
d6a56428d1 | ||
|
|
a10fa3a20b | ||
|
|
be5fde9e54 | ||
|
|
abfc7e16a1 | ||
|
|
d76f880faf | ||
|
|
21e83a881e | ||
|
|
5ba1261285 | ||
|
|
7bb844a778 | ||
|
|
8c24d49c73 | ||
|
|
5e371e8fe7 | ||
|
|
e46324ced9 | ||
|
|
5ea486b20a | ||
|
|
425afa63ce | ||
|
|
7c09a767b6 | ||
|
|
768f92303e | ||
|
|
34054fa1fb | ||
|
|
4a37d6d1f9 | ||
|
|
8dfc8625a7 | ||
|
|
e878947cb2 | ||
|
|
f56f84c6ac | ||
|
|
239d43dac4 | ||
|
|
8a63326411 | ||
|
|
01608cf062 | ||
|
|
e06d6ce4a2 | ||
|
|
58a0c6f9d3 | ||
|
|
f310f1e96c | ||
|
|
c7bf1aa222 | ||
|
|
be3fff9282 | ||
|
|
e52cf09bc1 | ||
|
|
57de1388e8 | ||
|
|
7ee0ce745e | ||
|
|
469743cd23 | ||
|
|
91e1d59869 | ||
|
|
5fb97f05a3 | ||
|
|
618b42980d | ||
|
|
211b9ea8b9 | ||
|
|
833abc27cc | ||
|
|
3d5a3f03fa | ||
|
|
51de26960c | ||
|
|
b67526aae8 | ||
|
|
14bf057c62 | ||
|
|
8eb53ea7ca | ||
|
|
9b60af4d52 | ||
|
|
956f99365a | ||
|
|
9904415144 | ||
|
|
83febbdc7d | ||
|
|
6b026e399c | ||
|
|
a661c03743 | ||
|
|
ffc03735e8 | ||
|
|
c7e24488eb | ||
|
|
fe7d2c57e3 | ||
|
|
4fc80b5057 | ||
|
|
12f3f5dcbb | ||
|
|
16f2ffc29d | ||
|
|
86a978d9ee | ||
|
|
f6fe3df59b | ||
|
|
e0764bb25e | ||
|
|
1ba0bfd10c | ||
|
|
593ab75a76 | ||
|
|
3589554028 | ||
|
|
1a59346b51 | ||
|
|
ff124465fd | ||
|
|
de5223db66 | ||
|
|
cc1395797e | ||
|
|
122791646e | ||
|
|
a3c4de52d6 | ||
|
|
95de6cf5a7 | ||
|
|
d788c84440 | ||
|
|
96046ffd30 | ||
|
|
b5e92a831b | ||
|
|
a2788129ff | ||
|
|
5bbf220077 | ||
|
|
f5d4e3f94c | ||
|
|
04ea680e9a | ||
|
|
3a940781d9 | ||
|
|
00fcd63b88 | ||
|
|
f3093649de | ||
|
|
670e33ab27 | ||
|
|
3606664cf7 | ||
|
|
81f45208b0 | ||
|
|
9145d05397 | ||
|
|
ef566836c4 | ||
|
|
10dfca1a75 | ||
|
|
b3e3f041fe | ||
|
|
e3ec361552 | ||
|
|
bfccc7133d | ||
|
|
f41a699f5d | ||
|
|
7d029778e6 | ||
|
|
26857fabdc | ||
|
|
a9b119833a | ||
|
|
c5ffe8a974 | ||
|
|
df1b4e1f21 | ||
|
|
61686aff34 | ||
|
|
ad6645c48d | ||
|
|
1e328c3546 | ||
|
|
0e2a625815 | ||
|
|
6eb66770a4 | ||
|
|
84729c4dfa | ||
|
|
8de8877c7c | ||
|
|
fdc6c3722a | ||
|
|
deca475972 | ||
|
|
ba070e21e4 | ||
|
|
35e9fd1bb0 | ||
|
|
4906609dd9 | ||
|
|
682353f9cc | ||
|
|
25c6671a87 | ||
|
|
c67702a498 | ||
|
|
5880cd88c8 | ||
|
|
54ceb4211e | ||
|
|
7a46227141 | ||
|
|
b904aa78e8 | ||
|
|
8185bee4b8 | ||
|
|
2e1b3325c6 | ||
|
|
1b8f1650dc | ||
|
|
1070b34996 | ||
|
|
13b1b73c15 | ||
|
|
e1de72d0ac | ||
|
|
dc837eb8a3 | ||
|
|
f6b76e6ecb | ||
|
|
e7cbcc83a4 | ||
|
|
390700ca71 | ||
|
|
b604321169 | ||
|
|
62c49f13ce | ||
|
|
eba75dbc2e | ||
|
|
32d2d0f0d0 | ||
|
|
81e0342bf6 | ||
|
|
56599621cc | ||
|
|
261bf12c91 | ||
|
|
b08fb86637 | ||
|
|
b290fd33b9 | ||
|
|
966bbd476f | ||
|
|
cf9bfe9e66 | ||
|
|
bb4a05032b | ||
|
|
7039e01136 | ||
|
|
e9f43f1097 | ||
|
|
150789690f | ||
|
|
e284233013 | ||
|
|
d06d6c6964 | ||
|
|
977a4477f6 | ||
|
|
33c6410809 | ||
|
|
7e321afd2a | ||
|
|
548ea1e54a | ||
|
|
4755c5f8c8 | ||
|
|
ea1bfd715e | ||
|
|
b1281c3fb9 | ||
|
|
257e9b04fe | ||
|
|
8643870822 | ||
|
|
6819696222 | ||
|
|
193bbd4e00 | ||
|
|
1bf168348e | ||
|
|
f8b4c1b389 | ||
|
|
830fba64b1 | ||
|
|
1cd61952b0 | ||
|
|
4ee1cc3b37 | ||
|
|
11dd904b6d | ||
|
|
0c03b6ddc7 | ||
|
|
176a3913aa | ||
|
|
6f0b00f983 | ||
|
|
69ace201f8 | ||
|
|
a04f31c5c0 | ||
|
|
1d9f47d1e5 | ||
|
|
36a91fc6ff | ||
|
|
cd3ed71137 | ||
|
|
73e56527bf | ||
|
|
24059924b1 | ||
|
|
bb100a2511 | ||
|
|
0c8c32cd03 | ||
|
|
a38d6e74f5 | ||
|
|
05d8dacb27 | ||
|
|
d6a0859eab | ||
|
|
4912967eab | ||
|
|
76e1cda495 | ||
|
|
c1a23bf450 | ||
|
|
b25b5bf5f6 | ||
|
|
079f17761c | ||
|
|
e1b8c425da | ||
|
|
5f05756e65 | ||
|
|
c0e996acf8 | ||
|
|
41ec58a524 | ||
|
|
0a5e7be129 | ||
|
|
b23d65b014 | ||
|
|
60ef7903e2 | ||
|
|
ee8fd21d28 | ||
|
|
232ed91ec7 | ||
|
|
7fccad156e | ||
|
|
11e56456a0 | ||
|
|
d07e78c59a | ||
|
|
c45479a6e5 | ||
|
|
345a528625 | ||
|
|
01d8490255 | ||
|
|
ea4b37d5c5 | ||
|
|
a1319cb8aa | ||
|
|
35c49d62d7 | ||
|
|
0576a11a6f | ||
|
|
c8f86d94c9 | ||
|
|
2b24eab26a | ||
|
|
7bbc7a61ce | ||
|
|
fe26284376 | ||
|
|
ab62fe6496 | ||
|
|
bc9bae0f7f | ||
|
|
e5939d1a18 | ||
|
|
5fadb7f200 | ||
|
|
a02aa7a316 | ||
|
|
3ab26a5d40 | ||
|
|
a8bae31939 | ||
|
|
faea588fb8 | ||
|
|
792e246262 | ||
|
|
85f19f9b8c | ||
|
|
40e4f49dbe | ||
|
|
05c721bebb | ||
|
|
e995cc9329 | ||
|
|
9457c115be | ||
|
|
1eddc79a90 | ||
|
|
ccfc909eb2 | ||
|
|
1a93cbba1e | ||
|
|
529d410bec | ||
|
|
4d1c0eaa52 | ||
|
|
adfd3c1098 | ||
|
|
f7d0c4b065 | ||
|
|
5fb32f1e2d | ||
|
|
f69489a4fc | ||
|
|
d34ce26c4e | ||
|
|
3f7fe94009 | ||
|
|
ae593decfc | ||
|
|
eea62125a1 | ||
|
|
96f36a63dc | ||
|
|
19e183f02f | ||
|
|
57f3df3cab | ||
|
|
08e78e63cf | ||
|
|
9228dffe5e | ||
|
|
93dc7d4cc1 | ||
|
|
1bead8adf7 | ||
|
|
6681f3bfec | ||
|
|
71f8960ef1 | ||
|
|
01780f19b1 | ||
|
|
1fa0c4d4d3 | ||
|
|
eebe126842 | ||
|
|
ebfa285122 | ||
|
|
27212719dc | ||
|
|
17567028da | ||
|
|
34fd8e0e00 | ||
|
|
6cf42075fc | ||
|
|
afd8d2f9ba | ||
|
|
1d54bff385 | ||
|
|
6dd0013a5d | ||
|
|
f2b5292bcb | ||
|
|
3a94f6e8b3 | ||
|
|
f2846a0b78 | ||
|
|
dbde7033d8 | ||
|
|
18f04adccb | ||
|
|
1ed65b6bd7 | ||
|
|
9b781c4c06 | ||
|
|
25f9105a97 | ||
|
|
602109bd8d | ||
|
|
631d27f7a8 | ||
|
|
aad27a7a68 | ||
|
|
4ac01154d9 | ||
|
|
4e2c7c57d7 | ||
|
|
6e65cfcc9a | ||
|
|
96a4b7eaa7 | ||
|
|
64afada7f0 | ||
|
|
9f563f4873 | ||
|
|
ca61d0ee8b | ||
|
|
e96dabadf1 | ||
|
|
b6601338c2 | ||
|
|
8167e1e07e | ||
|
|
23ce927301 | ||
|
|
c7941fc7b0 | ||
|
|
1078ad9ae9 | ||
|
|
c0085cbc61 | ||
|
|
a49d245b92 | ||
|
|
0ce6829e4c | ||
|
|
4e3acdcbdc | ||
|
|
85f808130d | ||
|
|
b187538339 | ||
|
|
93f6aabe12 | ||
|
|
10aa107380 | ||
|
|
53cba2a2e6 | ||
|
|
d871095d0b | ||
|
|
9bf8a5e877 | ||
|
|
3836bfe5a1 | ||
|
|
7698553c3a | ||
|
|
be1d216b34 | ||
|
|
85cbb943b5 | ||
|
|
ec34f2527a | ||
|
|
b877181e17 | ||
|
|
69446be1ee | ||
|
|
cc90f9cf80 | ||
|
|
457e6a5f46 | ||
|
|
e7db18bae2 | ||
|
|
f8e3e853aa | ||
|
|
b7ba252965 | ||
|
|
ae12e1b537 | ||
|
|
9255f625fa | ||
|
|
377d93d1cf | ||
|
|
19d14c7c3a | ||
|
|
6e3a823b7b |
18
.gitattributes
vendored
18
.gitattributes
vendored
@@ -1,4 +1,20 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
/build_tools export-ignore
|
||||
/build_tools/make_svn_completions.fish export-ignore
|
||||
/build_tools/description-pak export-ignore
|
||||
/build_tools/make_hg_completions.fish export-ignore
|
||||
/build_tools/make_vcs_completions.fish export-ignore
|
||||
/build_tools/make_vcs_completions_generic.fish export-ignore
|
||||
/build_tools/osx_package_resources export-ignore
|
||||
/build_tools/osx_package_resources/terminal_logo.png export-ignore
|
||||
/build_tools/osx_package_resources/welcome.rtf export-ignore
|
||||
/build_tools/make_csv_completions.fish export-ignore
|
||||
/build_tools/osx_distribution.xml export-ignore
|
||||
/build_tools/make_tarball.sh export-ignore
|
||||
/build_tools/make_deb.sh export-ignore
|
||||
/build_tools/osx_package_scripts export-ignore
|
||||
/build_tools/osx_package_scripts/add-shell export-ignore
|
||||
/build_tools/osx_package_scripts/postinstall export-ignore
|
||||
/build_tools/make_pkg.sh export-ignore
|
||||
/build_tools/make_darcs_completions.fish export-ignore
|
||||
|
||||
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
@@ -1,19 +1,21 @@
|
||||
*.o
|
||||
*~
|
||||
*.exe
|
||||
|
||||
Doxyfile.help
|
||||
Makefile
|
||||
autom4te.cache/
|
||||
build/
|
||||
command_list.txt
|
||||
confdefs.h
|
||||
config.h
|
||||
config.h.in
|
||||
config.log
|
||||
config.status
|
||||
configure
|
||||
doc/
|
||||
doc.h
|
||||
doc_src/commands.hdr
|
||||
doc_src/index.hdr
|
||||
etc/config.fish
|
||||
po/*.gmo
|
||||
fish
|
||||
fish.spec
|
||||
@@ -28,6 +30,8 @@ share/config.fish
|
||||
share/man/
|
||||
toc.txt
|
||||
user_doc/
|
||||
xsel-1.2.0/
|
||||
xcuserdata
|
||||
tests/*tmp.*
|
||||
tests/foo.txt
|
||||
FISH-BUILD-VERSION-FILE
|
||||
version
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
24-01-2012 Jan Kanis
|
||||
* Added a changelog file
|
||||
* removed unescaping if the 'commandline' builtin is called without the -o (tokenise) flag
|
||||
* Added a changelog file
|
||||
* removed unescaping if the 'commandline' builtin is called without the -o (tokenise) flag
|
||||
|
||||
105
CONTRIBUTING.md
Normal file
105
CONTRIBUTING.md
Normal file
@@ -0,0 +1,105 @@
|
||||
# Style guide
|
||||
|
||||
This is style guide for fish contributors. You should use it for any new code
|
||||
that you would add to this project and try to format existing code to use this
|
||||
style.
|
||||
|
||||
## Formatting
|
||||
|
||||
1. fish uses the Allman/BSD style of indentation.
|
||||
2. Indent with spaces, not tabs.
|
||||
3. Use 4 spaces per indent (unless needed like `Makefile`).
|
||||
4. Opening curly bracket is on the following line:
|
||||
|
||||
// ✔:
|
||||
struct name
|
||||
{
|
||||
// code
|
||||
};
|
||||
|
||||
void func()
|
||||
{
|
||||
// code
|
||||
}
|
||||
|
||||
if (...)
|
||||
{
|
||||
// code
|
||||
}
|
||||
|
||||
// ✗:
|
||||
void func() {
|
||||
// code
|
||||
}
|
||||
|
||||
5. Put space after `if`, `while` and `for` before conditions.
|
||||
|
||||
// ✔:
|
||||
if () {}
|
||||
|
||||
// ✗:
|
||||
if() {}
|
||||
|
||||
6. Put spaces before and after operators excluding increment and decrement;
|
||||
|
||||
// ✔:
|
||||
int a = 1 + 2 * 3;
|
||||
a++;
|
||||
|
||||
// ✗:
|
||||
int a=1+2*3;
|
||||
a ++;
|
||||
|
||||
7. Never put spaces between function name and parameters list.
|
||||
|
||||
// ✔:
|
||||
func(args);
|
||||
|
||||
// ✗:
|
||||
func (args);
|
||||
|
||||
8. Never put spaces after `(` and before `)`.
|
||||
9. Always put space after comma and semicolon.
|
||||
|
||||
// ✔:
|
||||
func(arg1, arg2);
|
||||
|
||||
for (int i = 0; i < LENGTH; i++) {}
|
||||
|
||||
// ✗:
|
||||
func(arg1,arg2);
|
||||
|
||||
for (int i = 0;i<LENGTH;i++) {}
|
||||
|
||||
## Documentation
|
||||
|
||||
Document your code using [Doxygen][dox].
|
||||
|
||||
1. Documentation comment should use double star notation or tripple slash:
|
||||
|
||||
// ✔:
|
||||
/// Some var
|
||||
int var;
|
||||
|
||||
/**
|
||||
* Some func
|
||||
*/
|
||||
void func();
|
||||
|
||||
2. Use slash as tag mark:
|
||||
|
||||
// ✔:
|
||||
|
||||
/**
|
||||
* \param a an integer argument.
|
||||
* \param s a constant character pointer.
|
||||
* \return The results
|
||||
*/
|
||||
int foo(int a, const char *s);
|
||||
|
||||
## Naming
|
||||
|
||||
All names in code should be `small_snake_case`. No Hungarian notation is used.
|
||||
Classes and structs names should be followed by `_t`.
|
||||
|
||||
[dox]: http://www.stack.nl/~dimitri/doxygen/ "Doxygen homepage"
|
||||
@@ -1,356 +0,0 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
D03EE83814DF88B200FC7150 /* lru.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = lru.h; sourceTree = "<group>"; };
|
||||
D09B1C1914FC7B5B00F91077 /* postfork.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = postfork.cpp; sourceTree = "<group>"; };
|
||||
D09B1C1A14FC7B5B00F91077 /* postfork.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = postfork.h; sourceTree = "<group>"; };
|
||||
D0A0850313B3ACEE0099B651 /* builtin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = builtin.h; sourceTree = "<group>"; };
|
||||
D0A0850413B3ACEE0099B651 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = "<group>"; };
|
||||
D0A0850513B3ACEE0099B651 /* complete.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = complete.h; sourceTree = "<group>"; };
|
||||
D0A0850613B3ACEE0099B651 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
|
||||
D0A0850713B3ACEE0099B651 /* env_universal_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = env_universal_common.h; sourceTree = "<group>"; };
|
||||
D0A0850813B3ACEE0099B651 /* env_universal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = env_universal.h; sourceTree = "<group>"; };
|
||||
D0A0850913B3ACEE0099B651 /* env.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = env.h; sourceTree = "<group>"; };
|
||||
D0A0850A13B3ACEE0099B651 /* event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = event.h; sourceTree = "<group>"; };
|
||||
D0A0850B13B3ACEE0099B651 /* exec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exec.h; sourceTree = "<group>"; };
|
||||
D0A0850C13B3ACEE0099B651 /* expand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = expand.h; sourceTree = "<group>"; };
|
||||
D0A0850D13B3ACEE0099B651 /* fallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fallback.h; sourceTree = "<group>"; };
|
||||
D0A0850E13B3ACEE0099B651 /* function.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = function.h; sourceTree = "<group>"; };
|
||||
D0A0851113B3ACEE0099B651 /* highlight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = highlight.h; sourceTree = "<group>"; };
|
||||
D0A0851213B3ACEE0099B651 /* history.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = history.h; sourceTree = "<group>"; };
|
||||
D0A0851313B3ACEE0099B651 /* input_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = input_common.h; sourceTree = "<group>"; };
|
||||
D0A0851413B3ACEE0099B651 /* input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = input.h; sourceTree = "<group>"; };
|
||||
D0A0851513B3ACEE0099B651 /* intern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = intern.h; sourceTree = "<group>"; };
|
||||
D0A0851613B3ACEE0099B651 /* io.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = io.h; sourceTree = "<group>"; };
|
||||
D0A0851713B3ACEE0099B651 /* iothread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iothread.h; sourceTree = "<group>"; };
|
||||
D0A0851813B3ACEE0099B651 /* kill.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kill.h; sourceTree = "<group>"; };
|
||||
D0A0851913B3ACEE0099B651 /* mimedb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mimedb.h; sourceTree = "<group>"; };
|
||||
D0A0851A13B3ACEE0099B651 /* output.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = output.h; sourceTree = "<group>"; };
|
||||
D0A0851B13B3ACEE0099B651 /* parse_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parse_util.h; sourceTree = "<group>"; };
|
||||
D0A0851C13B3ACEE0099B651 /* parser_keywords.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parser_keywords.h; sourceTree = "<group>"; };
|
||||
D0A0851D13B3ACEE0099B651 /* parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parser.h; sourceTree = "<group>"; };
|
||||
D0A0851E13B3ACEE0099B651 /* path.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = path.h; sourceTree = "<group>"; };
|
||||
D0A0851F13B3ACEE0099B651 /* print_help.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = print_help.h; sourceTree = "<group>"; };
|
||||
D0A0852013B3ACEE0099B651 /* proc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = proc.h; sourceTree = "<group>"; };
|
||||
D0A0852113B3ACEE0099B651 /* reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = "<group>"; };
|
||||
D0A0852213B3ACEE0099B651 /* sanity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sanity.h; sourceTree = "<group>"; };
|
||||
D0A0852313B3ACEE0099B651 /* screen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = screen.h; sourceTree = "<group>"; };
|
||||
D0A0852413B3ACEE0099B651 /* signal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = signal.h; sourceTree = "<group>"; };
|
||||
D0A0852513B3ACEE0099B651 /* tokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tokenizer.h; sourceTree = "<group>"; };
|
||||
D0A0852613B3ACEE0099B651 /* util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util.h; sourceTree = "<group>"; };
|
||||
D0A0852713B3ACEE0099B651 /* wgetopt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wgetopt.h; sourceTree = "<group>"; };
|
||||
D0A0852813B3ACEE0099B651 /* wildcard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wildcard.h; sourceTree = "<group>"; };
|
||||
D0A0852913B3ACEE0099B651 /* wutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wutil.h; sourceTree = "<group>"; };
|
||||
D0A0852A13B3ACEE0099B651 /* xdgmime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xdgmime.h; sourceTree = "<group>"; };
|
||||
D0A0852B13B3ACEE0099B651 /* xdgmimealias.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xdgmimealias.h; sourceTree = "<group>"; };
|
||||
D0A0852C13B3ACEE0099B651 /* xdgmimeglob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xdgmimeglob.h; sourceTree = "<group>"; };
|
||||
D0A0852D13B3ACEE0099B651 /* xdgmimeint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xdgmimeint.h; sourceTree = "<group>"; };
|
||||
D0A0852E13B3ACEE0099B651 /* xdgmimemagic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xdgmimemagic.h; sourceTree = "<group>"; };
|
||||
D0A0852F13B3ACEE0099B651 /* xdgmimeparent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xdgmimeparent.h; sourceTree = "<group>"; };
|
||||
D0A0853013B3ACEE0099B651 /* builtin_commandline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = builtin_commandline.cpp; sourceTree = "<group>"; };
|
||||
D0A0853113B3ACEE0099B651 /* builtin_complete.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = builtin_complete.cpp; sourceTree = "<group>"; };
|
||||
D0A0853213B3ACEE0099B651 /* builtin_jobs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = builtin_jobs.cpp; sourceTree = "<group>"; };
|
||||
D0A0853313B3ACEE0099B651 /* builtin_set.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = builtin_set.cpp; sourceTree = "<group>"; };
|
||||
D0A0853413B3ACEE0099B651 /* builtin_ulimit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = builtin_ulimit.cpp; sourceTree = "<group>"; };
|
||||
D0A0853513B3ACEE0099B651 /* builtin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = builtin.cpp; sourceTree = "<group>"; };
|
||||
D0A0853613B3ACEE0099B651 /* common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = common.cpp; sourceTree = "<group>"; };
|
||||
D0A0853713B3ACEE0099B651 /* complete.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = complete.cpp; sourceTree = "<group>"; };
|
||||
D0A0853813B3ACEE0099B651 /* env_universal_common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = env_universal_common.cpp; sourceTree = "<group>"; };
|
||||
D0A0853913B3ACEE0099B651 /* env_universal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = env_universal.cpp; sourceTree = "<group>"; };
|
||||
D0A0853A13B3ACEE0099B651 /* env.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = env.cpp; sourceTree = "<group>"; };
|
||||
D0A0853B13B3ACEE0099B651 /* event.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = event.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
|
||||
D0A0853C13B3ACEE0099B651 /* exec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = exec.cpp; sourceTree = "<group>"; };
|
||||
D0A0853D13B3ACEE0099B651 /* expand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = expand.cpp; sourceTree = "<group>"; };
|
||||
D0A0853E13B3ACEE0099B651 /* fallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fallback.cpp; sourceTree = "<group>"; };
|
||||
D0A0853F13B3ACEE0099B651 /* fish_indent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fish_indent.cpp; sourceTree = "<group>"; };
|
||||
D0A0854013B3ACEE0099B651 /* fish_pager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fish_pager.cpp; sourceTree = "<group>"; };
|
||||
D0A0854113B3ACEE0099B651 /* fish_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fish_tests.cpp; sourceTree = "<group>"; };
|
||||
D0A0854213B3ACEE0099B651 /* fish.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fish.cpp; sourceTree = "<group>"; };
|
||||
D0A0854313B3ACEE0099B651 /* fishd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fishd.cpp; sourceTree = "<group>"; };
|
||||
D0A0854413B3ACEE0099B651 /* function.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = function.cpp; sourceTree = "<group>"; };
|
||||
D0A0854713B3ACEE0099B651 /* highlight.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = highlight.cpp; sourceTree = "<group>"; };
|
||||
D0A0854813B3ACEE0099B651 /* history.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = history.cpp; sourceTree = "<group>"; };
|
||||
D0A0854913B3ACEE0099B651 /* input_common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = input_common.cpp; sourceTree = "<group>"; };
|
||||
D0A0854A13B3ACEE0099B651 /* input.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = input.cpp; sourceTree = "<group>"; };
|
||||
D0A0854B13B3ACEE0099B651 /* intern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = intern.cpp; sourceTree = "<group>"; };
|
||||
D0A0854C13B3ACEE0099B651 /* io.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = io.cpp; sourceTree = "<group>"; };
|
||||
D0A0854D13B3ACEE0099B651 /* iothread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iothread.cpp; sourceTree = "<group>"; };
|
||||
D0A0854E13B3ACEE0099B651 /* key_reader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = key_reader.cpp; sourceTree = "<group>"; };
|
||||
D0A0854F13B3ACEE0099B651 /* kill.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kill.cpp; sourceTree = "<group>"; };
|
||||
D0A0855013B3ACEE0099B651 /* mimedb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mimedb.cpp; sourceTree = "<group>"; };
|
||||
D0A0855113B3ACEE0099B651 /* output.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = output.cpp; sourceTree = "<group>"; };
|
||||
D0A0855213B3ACEE0099B651 /* parse_util.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parse_util.cpp; sourceTree = "<group>"; };
|
||||
D0A0855313B3ACEE0099B651 /* parser_keywords.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parser_keywords.cpp; sourceTree = "<group>"; };
|
||||
D0A0855413B3ACEE0099B651 /* parser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = parser.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
|
||||
D0A0855513B3ACEE0099B651 /* path.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = path.cpp; sourceTree = "<group>"; };
|
||||
D0A0855613B3ACEE0099B651 /* print_help.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = print_help.cpp; sourceTree = "<group>"; };
|
||||
D0A0855713B3ACEE0099B651 /* proc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = proc.cpp; sourceTree = "<group>"; };
|
||||
D0A0855813B3ACEE0099B651 /* reader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = reader.cpp; sourceTree = "<group>"; };
|
||||
D0A0855913B3ACEE0099B651 /* sanity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sanity.cpp; sourceTree = "<group>"; };
|
||||
D0A0855A13B3ACEE0099B651 /* screen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = screen.cpp; sourceTree = "<group>"; };
|
||||
D0A0855B13B3ACEE0099B651 /* set_color.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = set_color.cpp; sourceTree = "<group>"; };
|
||||
D0A0855C13B3ACEE0099B651 /* signal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = signal.cpp; sourceTree = "<group>"; };
|
||||
D0A0855D13B3ACEE0099B651 /* tokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tokenizer.cpp; sourceTree = "<group>"; };
|
||||
D0A0855E13B3ACEE0099B651 /* util.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util.cpp; sourceTree = "<group>"; };
|
||||
D0A0855F13B3ACEE0099B651 /* wgetopt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wgetopt.cpp; sourceTree = "<group>"; };
|
||||
D0A0856013B3ACEE0099B651 /* wildcard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wildcard.cpp; sourceTree = "<group>"; };
|
||||
D0A0856113B3ACEE0099B651 /* wutil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wutil.cpp; sourceTree = "<group>"; };
|
||||
D0A0856213B3ACEE0099B651 /* xdgmime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdgmime.cpp; sourceTree = "<group>"; };
|
||||
D0A0856313B3ACEE0099B651 /* xdgmimealias.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdgmimealias.cpp; sourceTree = "<group>"; };
|
||||
D0A0856413B3ACEE0099B651 /* xdgmimeglob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdgmimeglob.cpp; sourceTree = "<group>"; };
|
||||
D0A0856513B3ACEE0099B651 /* xdgmimeint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdgmimeint.cpp; sourceTree = "<group>"; };
|
||||
D0A0856613B3ACEE0099B651 /* xdgmimemagic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdgmimemagic.cpp; sourceTree = "<group>"; };
|
||||
D0A0856713B3ACEE0099B651 /* xdgmimeparent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdgmimeparent.cpp; sourceTree = "<group>"; };
|
||||
D0B6B0FE14E88BA400AD6C10 /* color.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = color.cpp; sourceTree = "<group>"; };
|
||||
D0B6B0FF14E88BA400AD6C10 /* color.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = color.h; sourceTree = "<group>"; };
|
||||
D0C6FCC914CFA4B0004CE8AD /* autoload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = autoload.cpp; sourceTree = "<group>"; };
|
||||
D0C6FCCB14CFA4B7004CE8AD /* autoload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = autoload.h; sourceTree = "<group>"; };
|
||||
D0F3373A1506DE3C00ECEFC0 /* builtin_test.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = builtin_test.cpp; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
D0A084F013B3AC130099B651 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D0C6FCCB14CFA4B7004CE8AD /* autoload.h */,
|
||||
D0C6FCC914CFA4B0004CE8AD /* autoload.cpp */,
|
||||
D0A0850313B3ACEE0099B651 /* builtin.h */,
|
||||
D0A0853013B3ACEE0099B651 /* builtin_commandline.cpp */,
|
||||
D0A0853113B3ACEE0099B651 /* builtin_complete.cpp */,
|
||||
D0A0853213B3ACEE0099B651 /* builtin_jobs.cpp */,
|
||||
D0A0853313B3ACEE0099B651 /* builtin_set.cpp */,
|
||||
D0A0853413B3ACEE0099B651 /* builtin_ulimit.cpp */,
|
||||
D0F3373A1506DE3C00ECEFC0 /* builtin_test.cpp */,
|
||||
D0A0853513B3ACEE0099B651 /* builtin.cpp */,
|
||||
D0B6B0FF14E88BA400AD6C10 /* color.h */,
|
||||
D0B6B0FE14E88BA400AD6C10 /* color.cpp */,
|
||||
D0A0850413B3ACEE0099B651 /* common.h */,
|
||||
D0A0853613B3ACEE0099B651 /* common.cpp */,
|
||||
D0A0850513B3ACEE0099B651 /* complete.h */,
|
||||
D0A0853713B3ACEE0099B651 /* complete.cpp */,
|
||||
D0A0850613B3ACEE0099B651 /* config.h */,
|
||||
D0A0850713B3ACEE0099B651 /* env_universal_common.h */,
|
||||
D0A0853813B3ACEE0099B651 /* env_universal_common.cpp */,
|
||||
D0A0850813B3ACEE0099B651 /* env_universal.h */,
|
||||
D0A0853913B3ACEE0099B651 /* env_universal.cpp */,
|
||||
D0A0850913B3ACEE0099B651 /* env.h */,
|
||||
D0A0853A13B3ACEE0099B651 /* env.cpp */,
|
||||
D0A0850A13B3ACEE0099B651 /* event.h */,
|
||||
D0A0853B13B3ACEE0099B651 /* event.cpp */,
|
||||
D0A0850B13B3ACEE0099B651 /* exec.h */,
|
||||
D0A0853C13B3ACEE0099B651 /* exec.cpp */,
|
||||
D0A0850C13B3ACEE0099B651 /* expand.h */,
|
||||
D0A0853D13B3ACEE0099B651 /* expand.cpp */,
|
||||
D0A0850D13B3ACEE0099B651 /* fallback.h */,
|
||||
D0A0853E13B3ACEE0099B651 /* fallback.cpp */,
|
||||
D0A0850E13B3ACEE0099B651 /* function.h */,
|
||||
D0A0854413B3ACEE0099B651 /* function.cpp */,
|
||||
D0A0853F13B3ACEE0099B651 /* fish_indent.cpp */,
|
||||
D0A0854013B3ACEE0099B651 /* fish_pager.cpp */,
|
||||
D0A0854113B3ACEE0099B651 /* fish_tests.cpp */,
|
||||
D0A0854213B3ACEE0099B651 /* fish.cpp */,
|
||||
D0A0854313B3ACEE0099B651 /* fishd.cpp */,
|
||||
D0A0851113B3ACEE0099B651 /* highlight.h */,
|
||||
D0A0854713B3ACEE0099B651 /* highlight.cpp */,
|
||||
D0A0851213B3ACEE0099B651 /* history.h */,
|
||||
D0A0854813B3ACEE0099B651 /* history.cpp */,
|
||||
D0A0851313B3ACEE0099B651 /* input_common.h */,
|
||||
D0A0854913B3ACEE0099B651 /* input_common.cpp */,
|
||||
D0A0851413B3ACEE0099B651 /* input.h */,
|
||||
D0A0854A13B3ACEE0099B651 /* input.cpp */,
|
||||
D0A0851513B3ACEE0099B651 /* intern.h */,
|
||||
D0A0854B13B3ACEE0099B651 /* intern.cpp */,
|
||||
D0A0851613B3ACEE0099B651 /* io.h */,
|
||||
D0A0854C13B3ACEE0099B651 /* io.cpp */,
|
||||
D0A0851713B3ACEE0099B651 /* iothread.h */,
|
||||
D0A0854D13B3ACEE0099B651 /* iothread.cpp */,
|
||||
D0A0851813B3ACEE0099B651 /* kill.h */,
|
||||
D0A0854F13B3ACEE0099B651 /* kill.cpp */,
|
||||
D0A0854E13B3ACEE0099B651 /* key_reader.cpp */,
|
||||
D03EE83814DF88B200FC7150 /* lru.h */,
|
||||
D0A0851913B3ACEE0099B651 /* mimedb.h */,
|
||||
D0A0855013B3ACEE0099B651 /* mimedb.cpp */,
|
||||
D0A0851A13B3ACEE0099B651 /* output.h */,
|
||||
D0A0855113B3ACEE0099B651 /* output.cpp */,
|
||||
D0A0851B13B3ACEE0099B651 /* parse_util.h */,
|
||||
D0A0855213B3ACEE0099B651 /* parse_util.cpp */,
|
||||
D0A0851C13B3ACEE0099B651 /* parser_keywords.h */,
|
||||
D0A0855313B3ACEE0099B651 /* parser_keywords.cpp */,
|
||||
D0A0851D13B3ACEE0099B651 /* parser.h */,
|
||||
D0A0855413B3ACEE0099B651 /* parser.cpp */,
|
||||
D0A0851E13B3ACEE0099B651 /* path.h */,
|
||||
D0A0855513B3ACEE0099B651 /* path.cpp */,
|
||||
D09B1C1A14FC7B5B00F91077 /* postfork.h */,
|
||||
D09B1C1914FC7B5B00F91077 /* postfork.cpp */,
|
||||
D0A0851F13B3ACEE0099B651 /* print_help.h */,
|
||||
D0A0855613B3ACEE0099B651 /* print_help.cpp */,
|
||||
D0A0852013B3ACEE0099B651 /* proc.h */,
|
||||
D0A0855713B3ACEE0099B651 /* proc.cpp */,
|
||||
D0A0852113B3ACEE0099B651 /* reader.h */,
|
||||
D0A0855813B3ACEE0099B651 /* reader.cpp */,
|
||||
D0A0852213B3ACEE0099B651 /* sanity.h */,
|
||||
D0A0855913B3ACEE0099B651 /* sanity.cpp */,
|
||||
D0A0852313B3ACEE0099B651 /* screen.h */,
|
||||
D0A0855A13B3ACEE0099B651 /* screen.cpp */,
|
||||
D0A0852413B3ACEE0099B651 /* signal.h */,
|
||||
D0A0855C13B3ACEE0099B651 /* signal.cpp */,
|
||||
D0A0855B13B3ACEE0099B651 /* set_color.cpp */,
|
||||
D0A0852513B3ACEE0099B651 /* tokenizer.h */,
|
||||
D0A0855D13B3ACEE0099B651 /* tokenizer.cpp */,
|
||||
D0A0852613B3ACEE0099B651 /* util.h */,
|
||||
D0A0855E13B3ACEE0099B651 /* util.cpp */,
|
||||
D0A0852713B3ACEE0099B651 /* wgetopt.h */,
|
||||
D0A0855F13B3ACEE0099B651 /* wgetopt.cpp */,
|
||||
D0A0852813B3ACEE0099B651 /* wildcard.h */,
|
||||
D0A0856013B3ACEE0099B651 /* wildcard.cpp */,
|
||||
D0A0852913B3ACEE0099B651 /* wutil.h */,
|
||||
D0A0856113B3ACEE0099B651 /* wutil.cpp */,
|
||||
D0A0852A13B3ACEE0099B651 /* xdgmime.h */,
|
||||
D0A0856213B3ACEE0099B651 /* xdgmime.cpp */,
|
||||
D0A0852B13B3ACEE0099B651 /* xdgmimealias.h */,
|
||||
D0A0856313B3ACEE0099B651 /* xdgmimealias.cpp */,
|
||||
D0A0852C13B3ACEE0099B651 /* xdgmimeglob.h */,
|
||||
D0A0856413B3ACEE0099B651 /* xdgmimeglob.cpp */,
|
||||
D0A0852D13B3ACEE0099B651 /* xdgmimeint.h */,
|
||||
D0A0856513B3ACEE0099B651 /* xdgmimeint.cpp */,
|
||||
D0A0852E13B3ACEE0099B651 /* xdgmimemagic.h */,
|
||||
D0A0856613B3ACEE0099B651 /* xdgmimemagic.cpp */,
|
||||
D0A0852F13B3ACEE0099B651 /* xdgmimeparent.h */,
|
||||
D0A0856713B3ACEE0099B651 /* xdgmimeparent.cpp */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXLegacyTarget section */
|
||||
D0A084F713B3AC130099B651 /* FishsFish */ = {
|
||||
isa = PBXLegacyTarget;
|
||||
buildArgumentsString = "-k ${ACTION}";
|
||||
buildConfigurationList = D0A084FA13B3AC130099B651 /* Build configuration list for PBXLegacyTarget "FishsFish" */;
|
||||
buildPhases = (
|
||||
);
|
||||
buildToolPath = /usr/bin/make;
|
||||
buildWorkingDirectory = "";
|
||||
dependencies = (
|
||||
);
|
||||
name = FishsFish;
|
||||
passBuildSettingsInEnvironment = 1;
|
||||
productName = FishsFish;
|
||||
};
|
||||
/* End PBXLegacyTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
D0A084F213B3AC130099B651 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0420;
|
||||
};
|
||||
buildConfigurationList = D0A084F513B3AC130099B651 /* Build configuration list for PBXProject "FishsFish" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = D0A084F013B3AC130099B651;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
D0A084F713B3AC130099B651 /* FishsFish */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
D0A084F813B3AC130099B651 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
D0A084F913B3AC130099B651 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
D0A084FB13B3AC130099B651 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUGGING_SYMBOLS = YES;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
OTHER_CFLAGS = "";
|
||||
OTHER_LDFLAGS = "";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
D0A084FC13B3AC130099B651 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
OTHER_CFLAGS = "";
|
||||
OTHER_LDFLAGS = "";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
D0A084F513B3AC130099B651 /* Build configuration list for PBXProject "FishsFish" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
D0A084F813B3AC130099B651 /* Debug */,
|
||||
D0A084F913B3AC130099B651 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
D0A084FA13B3AC130099B651 /* Build configuration list for PBXLegacyTarget "FishsFish" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
D0A084FB13B3AC130099B651 /* Debug */,
|
||||
D0A084FC13B3AC130099B651 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = D0A084F213B3AC130099B651 /* Project object */;
|
||||
}
|
||||
73
INSTALL
73
INSTALL
@@ -1,73 +0,0 @@
|
||||
|
||||
Known issues
|
||||
============
|
||||
|
||||
Fish is developed using GCC, with the goal of using only C89 language
|
||||
features. Fish does, however use the *wprintf family of functions,
|
||||
which are new to the C99 standrard. It is not unlikely that any given
|
||||
release contains a few GCC:isms, but ICC 9.0.030 has been found to
|
||||
produce working binaries. GCC 2.95.* won't compile fish, but GCC 3.2.3
|
||||
is known to work. Patches to fix any remaining GNU:isms are welcome.
|
||||
|
||||
Older versions of Doxygen has bugs in the man-page generation which
|
||||
cause the builtin help to render incorrectly. Doxygen 1.2.14 is known
|
||||
to have this problem.
|
||||
|
||||
|
||||
Prerequisites
|
||||
=============
|
||||
|
||||
Fish requires the following programs and libraries to build:
|
||||
|
||||
- Doxygen
|
||||
- Curses or Ncurses
|
||||
- GNU make
|
||||
- GCC
|
||||
|
||||
fish also relies on standard unix tools such as cat, cut, grep, sed,
|
||||
whoami, bc and echo. Fish does not yet support cross-compilation,
|
||||
separate build directories or any other fancy configure options.
|
||||
|
||||
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
Always begin by uninstalling any previous fish versions. This is done
|
||||
by running the command 'make uninstall' in the source directory of
|
||||
your previous fish installation.
|
||||
|
||||
Next, if you have downloaded a fresh copy of the darcs repository of
|
||||
fish, you need to run the 'autoconf' command.
|
||||
|
||||
Then, use following commands to compile fish:
|
||||
|
||||
./configure
|
||||
make # Compile fish
|
||||
make install # Install fish
|
||||
echo /usr/local/bin/fish >>/etc/shells # Add fish to list of shells
|
||||
|
||||
Finally, if you wish to use fish as your default shell, use the
|
||||
following command:
|
||||
|
||||
% chsh -s /usr/local/bin/fish
|
||||
|
||||
chsh will prompt you for your password, and change your default shell.
|
||||
|
||||
|
||||
Local install procedure
|
||||
=======================
|
||||
|
||||
If you have downloaded the darcs repository of fish, you need to run
|
||||
autoconf to generate the configure script.
|
||||
|
||||
To install fish in your own home directory (typically as non-root),
|
||||
type:
|
||||
|
||||
% ./configure --prefix=$HOME
|
||||
% make # Compile fish
|
||||
% make install # Install fish
|
||||
|
||||
You will not be able to use fish as the default shell unless you also
|
||||
add the corresponding line to /etc/shells, which mostly defeats the
|
||||
point of a local install. As a workaround, you can add fish as the
|
||||
last command of the init files for your regular shell.
|
||||
498
Makefile.in
498
Makefile.in
@@ -55,14 +55,13 @@ mandir = @mandir@
|
||||
sysconfdir = @sysconfdir@
|
||||
docdir = @docdir@
|
||||
localedir = @localedir@
|
||||
prefix = @prefix@
|
||||
optbindirs = @optbindirs@
|
||||
|
||||
#
|
||||
# Various flags
|
||||
#
|
||||
|
||||
MACROS = -DLOCALEDIR=\"$(localedir)\" -DPREFIX=L\"$(prefix)\" -DDATADIR=L\"$(datadir)\" -DSYSCONFDIR=L\"$(sysconfdir)\"
|
||||
MACROS = -DLOCALEDIR=\"$(localedir)\" -DPREFIX=L\"$(prefix)\" -DDATADIR=L\"$(datadir)\" -DSYSCONFDIR=L\"$(sysconfdir)\" -DBINDIR=L\"$(bindir)\"
|
||||
CXXFLAGS = @CXXFLAGS@ $(MACROS) $(EXTRA_CXXFLAGS)
|
||||
LDFLAGS = @LIBS@ @LDFLAGS@
|
||||
LDFLAGS_FISH = ${LDFLAGS} @LIBS_FISH@ @LDFLAGS_FISH@
|
||||
@@ -70,7 +69,6 @@ LDFLAGS_FISH_INDENT = ${LDFLAGS} @LIBS_FISH_INDENT@
|
||||
LDFLAGS_FISH_PAGER = ${LDFLAGS} @LIBS_FISH_PAGER@
|
||||
LDFLAGS_FISHD = ${LDFLAGS} @LIBS_FISHD@
|
||||
LDFLAGS_MIMEDB = ${LDFLAGS} @LIBS_MIMEDB@
|
||||
LDFLAGS_SET_COLOR = ${LDFLAGS} @LIBS_SET_COLOR@
|
||||
|
||||
#
|
||||
# Set to 1 if we have gettext
|
||||
@@ -78,6 +76,11 @@ LDFLAGS_SET_COLOR = ${LDFLAGS} @LIBS_SET_COLOR@
|
||||
|
||||
HAVE_GETTEXT=@HAVE_GETTEXT@
|
||||
|
||||
#
|
||||
# Set to 1 if we have doxygen
|
||||
#
|
||||
|
||||
HAVE_DOXYGEN=@HAVE_DOXYGEN@
|
||||
|
||||
#
|
||||
#Additional .cpp files used by common.o. These also have a corresponding
|
||||
@@ -96,7 +99,7 @@ FISH_OBJS := function.o builtin.o complete.o env.o exec.o expand.o \
|
||||
tokenizer.o wildcard.o wgetopt.o wutil.o input.o output.o intern.o \
|
||||
env_universal.o env_universal_common.o input_common.o event.o \
|
||||
signal.o io.o parse_util.o common.o screen.o path.o autoload.o \
|
||||
parser_keywords.o iothread.o builtin_scripts.o color.o postfork.o \
|
||||
parser_keywords.o iothread.o color.o postfork.o \
|
||||
builtin_test.o
|
||||
|
||||
FISH_INDENT_OBJS := fish_indent.o print_help.o common.o \
|
||||
@@ -107,7 +110,8 @@ parser_keywords.o wutil.o tokenizer.o
|
||||
#
|
||||
|
||||
BUILTIN_FILES := builtin_set.cpp builtin_commandline.cpp \
|
||||
builtin_ulimit.cpp builtin_complete.cpp builtin_jobs.cpp
|
||||
builtin_ulimit.cpp builtin_complete.cpp builtin_jobs.cpp \
|
||||
builtin_set_color.cpp builtin_printf.cpp
|
||||
|
||||
|
||||
#
|
||||
@@ -149,27 +153,25 @@ MIME_OBJS := mimedb.o print_help.o xdgmimealias.o xdgmime.o \
|
||||
|
||||
#
|
||||
# These files are the source files, they contain a few @FOO@-style substitutions
|
||||
# Note that this order defines the order that they appear in the documentation
|
||||
#
|
||||
|
||||
HDR_FILES_SRC := doc_src/index.hdr.in doc_src/commands.hdr.in doc_src/design.hdr doc_src/license.hdr doc_src/faq.hdr
|
||||
HDR_FILES_SRC := doc_src/index.hdr.in doc_src/tutorial.hdr doc_src/design.hdr doc_src/license.hdr doc_src/commands.hdr.in doc_src/faq.hdr
|
||||
|
||||
|
||||
#
|
||||
# These are the generated result files
|
||||
#
|
||||
|
||||
HDR_FILES := $(subst .hdr.in,.hdr,$(HDR_FILES_SRC))
|
||||
|
||||
#
|
||||
# Internalized scripts
|
||||
#
|
||||
|
||||
GENERATED_INTERN_SCRIPT_FILES := builtin_scripts.h builtin_scripts.cpp
|
||||
HDR_FILES := $(HDR_FILES_SRC:.hdr.in=.hdr)
|
||||
|
||||
# Use a pattern rule so that Make knows to only issue one invocation
|
||||
# per http://www.gnu.org/software/make/manual/make.html#Pattern-Intro
|
||||
builtin%scripts.h builtin%scripts.cpp: internalize_scripts.py
|
||||
./internalize_scripts.py share/functions/*.fish share/completions/*.fish
|
||||
|
||||
# Internalized scripts are currently disabled.
|
||||
# For now, we just generate empty arrays.
|
||||
# To generate them again, you would run this:
|
||||
# ./internalize_scripts.py share/functions/*.fish share/completions/*.fish
|
||||
|
||||
|
||||
#
|
||||
@@ -201,14 +203,14 @@ DOC_SRC_DIR_FILES := $(HDR_FILES_SRC) $(HELP_SRC)
|
||||
# Files in ./
|
||||
#
|
||||
|
||||
MAIN_DIR_FILES_UNSORTED := Doxyfile Doxyfile.user Doxyfile.help.in \
|
||||
Makefile.in configure configure.ac config.h.in install-sh \
|
||||
set_color.cpp key_reader.cpp $(MIME_OBJS:.o=.h) \
|
||||
$(MIME_OBJS:.o=.cpp) $(FISH_OBJS:.o=.h) $(BUILTIN_FILES) \
|
||||
$(COMMON_FILES) $(COMMON_FILES:.cpp=.h) $(FISH_OBJS:.o=.cpp) \
|
||||
fish.spec.in INSTALL README user_doc.head.html xsel-0.9.6.tar \
|
||||
MAIN_DIR_FILES_UNSORTED := Doxyfile Doxyfile.user Doxyfile.help \
|
||||
Makefile.in configure configure.ac config.h.in install-sh \
|
||||
key_reader.cpp $(MIME_OBJS:.o=.h) \
|
||||
$(MIME_OBJS:.o=.cpp) $(FISH_OBJS:.o=.h) $(BUILTIN_FILES) \
|
||||
$(COMMON_FILES) $(COMMON_FILES:.cpp=.h) $(FISH_OBJS:.o=.cpp) \
|
||||
fish.spec.in INSTALL README user_doc.head.html \
|
||||
ChangeLog config.sub config.guess fish_tests.cpp fish.cpp fish_pager.cpp \
|
||||
fishd.cpp seq.in make_vcs_completions.fish $(FISH_INDENT_OBJS:.o=.cpp)
|
||||
fishd.cpp make_vcs_completions.fish $(FISH_INDENT_OBJS:.o=.cpp)
|
||||
|
||||
#
|
||||
# The sorting is not meaningful in itself, but it has the side effect
|
||||
@@ -219,20 +221,6 @@ MAIN_DIR_FILES_UNSORTED := Doxyfile Doxyfile.user Doxyfile.help.in \
|
||||
MAIN_DIR_FILES := $(sort $(MAIN_DIR_FILES_UNSORTED))
|
||||
|
||||
|
||||
#
|
||||
# Files in ./etc/
|
||||
#
|
||||
|
||||
ETC_DIR_FILES :=etc/config.fish.in
|
||||
|
||||
|
||||
#
|
||||
# Files in ./share/
|
||||
#
|
||||
|
||||
SHARE_DIR_FILES :=share/config.fish.in
|
||||
|
||||
|
||||
#
|
||||
# Files in ./tests/
|
||||
#
|
||||
@@ -259,16 +247,14 @@ FUNCTIONS_DIR_FILES := $(wildcard share/functions/*.fish)
|
||||
# Programs to install
|
||||
#
|
||||
|
||||
SIMPLE_PROGRAMS := fish set_color mimedb fish_pager fishd fish_indent
|
||||
PROGRAMS := $(SIMPLE_PROGRAMS) @XSEL_BIN@ @SEQ_FALLBACK@
|
||||
|
||||
PROGRAMS := fish mimedb fish_pager fishd fish_indent
|
||||
|
||||
#
|
||||
# Manual pages to install
|
||||
#
|
||||
|
||||
MANUALS := $(addsuffix .1, $(addprefix share/man/, \
|
||||
$(SIMPLE_PROGRAMS))) @XSEL_MAN_PATH@
|
||||
MANUALS := $(addsuffix .1, $(addprefix share/man/man1/, \
|
||||
$(PROGRAMS)))
|
||||
|
||||
|
||||
#
|
||||
@@ -278,23 +264,38 @@ MANUALS := $(addsuffix .1, $(addprefix share/man/, \
|
||||
TRANSLATIONS_SRC := $(wildcard po/*.po)
|
||||
TRANSLATIONS := $(TRANSLATIONS_SRC:.po=.gmo)
|
||||
|
||||
|
||||
#
|
||||
# Extra util
|
||||
# If Doxygen is not available, don't attempt to build the documentation
|
||||
#
|
||||
|
||||
XSEL := @XSEL@
|
||||
XSEL_BIN := @XSEL_BIN@
|
||||
ifeq ($(HAVE_DOXYGEN), 1)
|
||||
user_doc=user_doc
|
||||
share_man=share/man
|
||||
else
|
||||
user_doc=
|
||||
share_man=
|
||||
endif
|
||||
|
||||
#
|
||||
# Make everything needed for installing fish
|
||||
#
|
||||
|
||||
all: $(PROGRAMS) user_doc share/man etc/config.fish share/config.fish $(TRANSLATIONS)
|
||||
all: $(PROGRAMS) $(user_doc) $(share_man) $(TRANSLATIONS)
|
||||
@echo fish has now been built.
|
||||
@echo Use \'$(MAKE) install\' to install fish.
|
||||
.PHONY: all
|
||||
|
||||
#
|
||||
# Pull version information
|
||||
#
|
||||
|
||||
FISH-BUILD-VERSION-FILE: FORCE
|
||||
@./build_tools/git_version_gen.sh
|
||||
-include FISH-BUILD-VERSION-FILE
|
||||
CPPFLAGS += -DFISH_BUILD_VERSION=\"$(FISH_BUILD_VERSION)\"
|
||||
.PHONY: FORCE
|
||||
env.o fish.o fish_indent.o fish_pager.o fishd.o mimedb.o: FISH-BUILD-VERSION-FILE
|
||||
|
||||
|
||||
#
|
||||
# These dependencies make sure that autoconf and configure are run
|
||||
@@ -313,12 +314,9 @@ Makefile: Makefile.in configure
|
||||
# and should only be used when debuging fish.
|
||||
#
|
||||
|
||||
debug:
|
||||
$(MAKE) fish EXTRA_CXXFLAGS="-O0 -Wno-unused -g"
|
||||
.PHONY: debug
|
||||
|
||||
prof:
|
||||
$(MAKE) all EXTRA_CXXFLAGS="-pg" LDFLAGS="-pg"
|
||||
prof: EXTRA_CXXFLAGS += -pg
|
||||
prof: LDFLAGS += -pg
|
||||
prof: all
|
||||
.PHONY: prof
|
||||
|
||||
#
|
||||
@@ -327,12 +325,11 @@ prof:
|
||||
|
||||
# Depend on the sources (*.hdr.in) and manually make the
|
||||
# intermediate *.hdr and doc.h files if needed
|
||||
# Allow doxygen to fail, e.g. if it does not exist
|
||||
# The sed command deletes everything including and after the first -, for simpler version numbers
|
||||
|
||||
user_doc: $(HDR_FILES_SRC) Doxyfile.user user_doc.head.html $(HELP_SRC) doc.h $(HDR_FILES)
|
||||
(cat Doxyfile.user ; echo PROJECT_NUMBER=$(FISH_BUILD_VERSION) | sed "s/-.*//") | doxygen - && touch user_doc
|
||||
|
||||
user_doc: $(HDR_FILES_SRC) Doxyfile.user user_doc.head.html $(HELP_SRC)
|
||||
$(MAKE) doc.h $(HDR_FILES)
|
||||
- doxygen Doxyfile.user
|
||||
touch user_doc
|
||||
|
||||
|
||||
#
|
||||
@@ -340,7 +337,7 @@ user_doc: $(HDR_FILES_SRC) Doxyfile.user user_doc.head.html $(HELP_SRC)
|
||||
#
|
||||
|
||||
doc: *.h *.cpp doc.h Doxyfile
|
||||
doxygen;
|
||||
(cat Doxyfile ; echo PROJECT_NUMBER=$(FISH_BUILD_VERSION)) | doxygen - ;
|
||||
|
||||
|
||||
#
|
||||
@@ -364,40 +361,40 @@ test: $(PROGRAMS) fish_tests
|
||||
.PHONY: test
|
||||
|
||||
|
||||
#
|
||||
# Build the xsel program, which is maintained in its own tarball
|
||||
#
|
||||
|
||||
$(XSEL_BIN):
|
||||
$(MAKE) -C $(XSEL) || echo "Failed to build xsel - either add the required dependencies or use './configure --without-xsel' to disable it."
|
||||
|
||||
|
||||
#
|
||||
# commands.hdr collects documentation on all commands, functions and
|
||||
# builtins
|
||||
#
|
||||
|
||||
doc_src/commands.hdr:$(HELP_SRC) doc_src/commands.hdr.in
|
||||
-rm command_list.tmp $@
|
||||
-rm command_list.tmp command_list_toc.tmp $@
|
||||
for i in `printf "%s\n" $(HELP_SRC)|sort`; do \
|
||||
echo "<hr>" >>command_list.tmp; \
|
||||
cat $$i >>command_list.tmp; \
|
||||
echo >>command_list.tmp; \
|
||||
echo >>command_list.tmp; \
|
||||
NAME=`basename $$i .txt`; \
|
||||
echo '- <a href="#'$$NAME'">'$$NAME'</a>' >> command_list_toc.tmp; \
|
||||
echo "Back to <a href='index.html#toc-commands'>index</a>". >>command_list.tmp; \
|
||||
done
|
||||
mv command_list.tmp command_list.txt
|
||||
cat $@.in | awk '{if ($$0 ~ /@command_list@/){ system("cat command_list.txt");} else{ print $$0;}}' >$@
|
||||
mv command_list_toc.tmp command_list_toc.txt
|
||||
cat $@.in | awk '{if ($$0 ~ /@command_list_toc@/) { system("cat command_list_toc.txt"); } else if ($$0 ~ /@command_list@/){ system("cat command_list.txt");} else{ print $$0;}}' >$@
|
||||
|
||||
|
||||
toc.txt: $(subst index.hdr,index.hdr.in,$(HDR_FILES))
|
||||
toc.txt: $(HDR_FILES:index.hdr=index.hdr.in)
|
||||
-rm toc.tmp $@
|
||||
for i in $(subst index.hdr,index.hdr.in,$(HDR_FILES)); do\
|
||||
# Ugly hack to set the toc initial title for the main page
|
||||
echo '- <a href="index.html" id="toc-index">Documentation</a>' > toc.tmp
|
||||
# The first sed command captures the page name, followed by the description
|
||||
# The second sed command captures the command name \1 and the description \2, but only up to a dash
|
||||
# This is to reduce the size of the TOC in the command listing on the main page
|
||||
for i in $(HDR_FILES:index.hdr=index.hdr.in); do\
|
||||
NAME=`basename $$i .hdr`; \
|
||||
NAME=`basename $$NAME .hdr.in`; \
|
||||
sed <$$i >>toc.tmp -n \
|
||||
-e 's,.*\\page *\([^ ]*\) *\(.*\)$$,- <a href="'$$NAME'.html" name="toc-'$$NAME'">\2</a>,p' \
|
||||
-e 's,.*\\section *\([^ ]*\) *\(.*\)$$, - <a href="'$$NAME'.html#\1" name="toc-'$$NAME'">\2</a>,p'; \
|
||||
-e 's,.*\\page *\([^ ]*\) *\(.*\)$$,- <a href="'$$NAME'.html" id="toc-'$$NAME'">\2</a>,p' \
|
||||
-e 's,.*\\section *\([^ ]*\) *\([^-]*\)\(.*\)$$, - <a href="'$$NAME'.html#\1">\2</a>,p'; \
|
||||
done
|
||||
mv toc.tmp $@
|
||||
|
||||
@@ -466,10 +463,10 @@ doc.h: $(HDR_FILES)
|
||||
# Create a template translation object
|
||||
#
|
||||
|
||||
messages.pot: *.cpp *.h etc/*.in share/*.in share/completions/*.fish share/functions/*.fish seq
|
||||
messages.pot: *.cpp *.h share/completions/*.fish share/functions/*.fish
|
||||
if test $(HAVE_GETTEXT) = 1;then \
|
||||
xgettext -k_ -kN_ *.cpp *.h -o messages.pot; \
|
||||
if xgettext -j -k_ -kN_ -k--description -LShell etc/*.in share/*.in share/completions/*.fish share/functions/*.fish seq -o messages.pot; then true; else \
|
||||
if xgettext -j -k_ -kN_ -k--description -LShell share/completions/*.fish share/functions/*.fish -o messages.pot; then true; else \
|
||||
echo "Your xgettext version is too old to build the messages.pot file"\
|
||||
rm messages.pot\
|
||||
false;\
|
||||
@@ -509,25 +506,10 @@ common.o: $(COMMON_FILES)
|
||||
#
|
||||
|
||||
share/man: $(HELP_SRC)
|
||||
-rm doc_src/*.doxygen # Remove temp files from previous run
|
||||
-rm -r help_doc
|
||||
-mkdir share/man
|
||||
touch share/man
|
||||
for i in $(HELP_SRC); do \
|
||||
FILE=doc_src/`basename $$i .txt`.doxygen; \
|
||||
echo "/** \page" `basename $$i .txt` >$$FILE; \
|
||||
cat $$i >>$$FILE; \
|
||||
echo "*/" >>$$FILE; \
|
||||
done
|
||||
if command -v doxygen; then \
|
||||
doxygen Doxyfile.help ; \
|
||||
for i in $(HELP_SRC); do \
|
||||
CMD_NAME=`basename $$i .txt`; \
|
||||
sed -e "s/\(.\)\\.SH/\1/" -e "s/$$CMD_NAME *\\\\- *\"\(.*\)\"/\1/" <help_doc/man/man1/$$CMD_NAME.1 >share/man/$$CMD_NAME.1; \
|
||||
done \
|
||||
fi
|
||||
rm doc_src/*.doxygen # Clean up intermediate files in doc_src/
|
||||
rm -rf help_doc # Clean up intermediate help_doc tree
|
||||
-rm -Rf share/man/man1
|
||||
./build_tools/build_documentation.sh Doxyfile.help ./doc_src ./share
|
||||
|
||||
#
|
||||
# The build rules for installing/uninstalling fish
|
||||
@@ -564,6 +546,20 @@ check-uninstall:
|
||||
fi;
|
||||
.PHONY: check-uninstall
|
||||
|
||||
check-legacy-binaries:
|
||||
@SEQLOC=$(prefix)/bin/seq;\
|
||||
if test -f "$$SEQLOC" && grep -q '\(^#!/.*/fish\|^#!/usr/bin/env fish\)' "$$SEQLOC"; then\
|
||||
echo "An outdated seq from a previous fish install was found. You should remove it with:";\
|
||||
echo " rm '$$SEQLOC'";\
|
||||
fi;
|
||||
@SETCOLOR_LOC=$(prefix)/bin/set_color;\
|
||||
if test -x "$$SETCOLOR_LOC" && $$SETCOLOR_LOC -v 2>&1 >/dev/null | grep -q "^set_color, version "; then\
|
||||
echo "An outdated set_color from a previous fish install was found. You should remove it with:";\
|
||||
echo " rm '$$SETCOLOR_LOC'";\
|
||||
fi;
|
||||
@true;
|
||||
.PHONY: check-legacy-binaries
|
||||
|
||||
|
||||
#
|
||||
# This check makes sure that the install-sh script is executable. The
|
||||
@@ -580,9 +576,17 @@ install-sh:
|
||||
# Try to install after checking for incompatible installed versions.
|
||||
#
|
||||
|
||||
install: all install-sh check-uninstall install-force
|
||||
install: all install-sh check-uninstall install-force check-legacy-binaries
|
||||
.PHONY: install
|
||||
|
||||
#
|
||||
# Xcode install
|
||||
#
|
||||
xcode-install:
|
||||
rm -Rf /tmp/fish_build;\
|
||||
xcodebuild install DSTROOT=/tmp/fish_build;\
|
||||
ditto /tmp/fish_build /
|
||||
.PHONY: xcode-install
|
||||
|
||||
#
|
||||
# Force installation, even in presense of incompatible previous
|
||||
@@ -600,21 +604,22 @@ install-force: all install-translations
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/completions
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/functions
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/man
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/man/man1
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools/web_config
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools/web_config/sample_prompts
|
||||
$(INSTALL) -m 644 etc/config.fish $(DESTDIR)$(sysconfdir)/fish/
|
||||
$(INSTALL) -m 644 share/config.fish $(DESTDIR)$(datadir)/fish/
|
||||
for i in $(COMPLETIONS_DIR_FILES); do \
|
||||
for i in $(COMPLETIONS_DIR_FILES:%='%'); do \
|
||||
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/completions/; \
|
||||
true; \
|
||||
done;
|
||||
for i in $(FUNCTIONS_DIR_FILES); do \
|
||||
for i in $(FUNCTIONS_DIR_FILES:%='%'); do \
|
||||
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/functions/; \
|
||||
true; \
|
||||
done;
|
||||
for i in share/man/*.1; do \
|
||||
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/man/; \
|
||||
for i in share/man/man1/*.1; do \
|
||||
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/man/man1/; \
|
||||
true; \
|
||||
done;
|
||||
for i in share/tools/*.py; do\
|
||||
@@ -625,6 +630,10 @@ install-force: all install-translations
|
||||
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/tools/web_config/; \
|
||||
true; \
|
||||
done;
|
||||
for i in share/tools/web_config/sample_prompts/*.fish; do\
|
||||
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/tools/web_config/sample_prompts/; \
|
||||
true; \
|
||||
done;
|
||||
for i in share/tools/web_config/*.py; do\
|
||||
$(INSTALL) -m 755 $$i $(DESTDIR)$(datadir)/fish/tools/web_config/; \
|
||||
true; \
|
||||
@@ -644,12 +653,15 @@ install-force: all install-translations
|
||||
@echo fish is now installed on your system.
|
||||
@echo To run fish, type \'fish\' in your terminal.
|
||||
@echo
|
||||
@echo To use fish as your login shell:
|
||||
@echo \* add the line \'$(DESTDIR)$(bindir)/fish\' to the file \'/etc/shells\'.
|
||||
@echo \* use the command \'chsh -s $(DESTDIR)$(bindir)/fish\'.
|
||||
@echo
|
||||
@if type chsh &> /dev/null; then \
|
||||
echo To use fish as your login shell:; \
|
||||
grep -q -- "$(DESTDIR)$(bindir)/fish" /etc/shells || echo \* add the line \'$(DESTDIR)$(bindir)/fish\' to the file \'/etc/shells\'.; \
|
||||
echo \* use the command \'chsh -s $(DESTDIR)$(bindir)/fish\'.; \
|
||||
echo; \
|
||||
fi;
|
||||
@echo To set your colors, run \'fish_config\'
|
||||
@echo To scan your man pages for completions, run \'fish_update_completions\'
|
||||
@echo To autocomplete command suggestions press Ctrl + F or right arrow key.
|
||||
@echo
|
||||
@echo Have fun!
|
||||
.PHONY: install-force
|
||||
@@ -663,17 +675,15 @@ uninstall: uninstall-translations
|
||||
-for i in $(PROGRAMS); do \
|
||||
rm -f $(DESTDIR)$(bindir)/$$i; \
|
||||
done;
|
||||
-rm -f $(DESTDIR)$(bindir)/xsel
|
||||
-rm -f $(DESTDIR)$(sysconfdir)/fish/config.fish
|
||||
-rmdir $(DESTDIR)$(sysconfdir)/fish
|
||||
-rm -rf $(DESTDIR)$(sysconfdir)/fish
|
||||
-if test -d $(DESTDIR)$(datadir)/fish; then \
|
||||
rm -r $(DESTDIR)$(datadir)/fish; \
|
||||
fi
|
||||
-if test -d $(DESTDIR)$(docdir); then \
|
||||
rm -r $(DESTDIR)$(docdir);\
|
||||
rm -rf $(DESTDIR)$(docdir);\
|
||||
fi
|
||||
-for i in $(MANUALS); do \
|
||||
rm -f $(DESTDIR)$(mandir)/man1/`basename $$i`*; \
|
||||
rm -rf $(DESTDIR)$(mandir)/man1/`basename $$i`*; \
|
||||
done;
|
||||
.PHONY: uninstall
|
||||
|
||||
@@ -769,22 +779,6 @@ mimedb: $(MIME_OBJS)
|
||||
$(CXX) $(MIME_OBJS) $(LDFLAGS_MIMEDB) -o $@
|
||||
|
||||
|
||||
#
|
||||
# Build the set_color program
|
||||
#
|
||||
|
||||
set_color: set_color.o print_help.o common.o color.o wutil.o
|
||||
$(CXX) set_color.o print_help.o common.o wutil.o color.o $(LDFLAGS_SET_COLOR) -o $@
|
||||
|
||||
|
||||
#
|
||||
# Test program for the tokenizer library
|
||||
#
|
||||
|
||||
tokenizer_test: tokenizer.cpp tokenizer.h wutil.o common.o
|
||||
$(CXX) $(CXXFLAGS) tokenizer.cpp wutil.o common.o -D TOKENIZER_TEST $(LDFLAGS) -o $@
|
||||
|
||||
|
||||
#
|
||||
# Build the fish_indent program.
|
||||
#
|
||||
@@ -809,68 +803,6 @@ depend:
|
||||
./config.status
|
||||
.PHONY: depend
|
||||
|
||||
|
||||
#
|
||||
# Dependencies that makedepend misses
|
||||
#
|
||||
autoload.cpp function.cpp: $(GENERATED_INTERN_SCRIPT_FILES)
|
||||
|
||||
#
|
||||
# Copy all the source files into a new directory and use tar to create
|
||||
# an archive from it. Simplest way I could think of to make an archive
|
||||
# witout backups, autogenerated files, etc.
|
||||
#
|
||||
# Uses install instead of mkdir so build won't fail if the directory
|
||||
# exists
|
||||
#
|
||||
|
||||
fish-@PACKAGE_VERSION@.tar: $(DOC_SRC_DIR_FILES) $(MAIN_DIR_FILES) $(ETC_DIR_FILES) $(TEST_DIR_FILES) $(SHARE_DIR_FILES) $(FUNCTIONS_DIR_FILES) $(COMPLETIONS_DIR_FILES) ChangeLog user_doc share/man
|
||||
rm -rf fish-@PACKAGE_VERSION@
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/doc_src
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/user_doc
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/etc
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/share
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/share/completions
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/share/functions
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/share/man
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/tests
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/po
|
||||
cp -f $(DOC_SRC_DIR_FILES) fish-@PACKAGE_VERSION@/doc_src
|
||||
cp -f $(MAIN_DIR_FILES) fish-@PACKAGE_VERSION@/
|
||||
cp -f $(ETC_DIR_FILES) fish-@PACKAGE_VERSION@/etc/
|
||||
cp -f $(SHARE_DIR_FILES) fish-@PACKAGE_VERSION@/share/
|
||||
cp -f $(COMPLETIONS_DIR_FILES) fish-@PACKAGE_VERSION@/share/completions/
|
||||
cp -f $(FUNCTIONS_DIR_FILES) fish-@PACKAGE_VERSION@/share/functions/
|
||||
cp -f $(TESTS_DIR_FILES) fish-@PACKAGE_VERSION@/tests/
|
||||
cp -f $(TRANSLATIONS_SRC) fish-@PACKAGE_VERSION@/po/
|
||||
cp -f share/man/*.1 fish-@PACKAGE_VERSION@/share/man/
|
||||
cp -rf user_doc fish-@PACKAGE_VERSION@/
|
||||
tar -c fish-@PACKAGE_VERSION@ >fish-@PACKAGE_VERSION@.tar
|
||||
rm -rf fish-@PACKAGE_VERSION@
|
||||
|
||||
|
||||
#
|
||||
# Just an alias for fish-@PACKAGE_VERSION@.tar
|
||||
#
|
||||
|
||||
tar: fish-@PACKAGE_VERSION@.tar
|
||||
.PHONY: tar
|
||||
|
||||
|
||||
#
|
||||
# Make compressed tar archives
|
||||
#
|
||||
|
||||
fish-@PACKAGE_VERSION@.tar.gz: fish-@PACKAGE_VERSION@.tar
|
||||
gzip -f --best -c fish-@PACKAGE_VERSION@.tar >fish-@PACKAGE_VERSION@.tar.gz
|
||||
|
||||
fish-@PACKAGE_VERSION@.tar.bz2: fish-@PACKAGE_VERSION@.tar
|
||||
bzip2 -f --best -k fish-@PACKAGE_VERSION@.tar
|
||||
|
||||
dist: fish-@PACKAGE_VERSION@.tar.bz2
|
||||
.PHONY: dist
|
||||
|
||||
#
|
||||
# Build the RPM spec file.
|
||||
#
|
||||
@@ -878,28 +810,6 @@ dist: fish-@PACKAGE_VERSION@.tar.bz2
|
||||
fish.spec: fish.spec.in
|
||||
./config.status
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Create .rpm file for the current systems architecture and an
|
||||
# .src.rpm file.
|
||||
#
|
||||
|
||||
rpm: fish-@PACKAGE_VERSION@.tar.bz2 fish.spec
|
||||
@if which rpmbuild; then true; else \
|
||||
echo Could not find the rpmbuild command, needed to build an rpm; \
|
||||
echo You may be able to install it using the following command:; \
|
||||
echo \'yum install rpm-build\'; \
|
||||
false; \
|
||||
fi
|
||||
cp fish.spec /usr/src/redhat/SPECS/
|
||||
cp fish-@PACKAGE_VERSION@.tar.bz2 /usr/src/redhat/SOURCES/
|
||||
rpmbuild -ba --clean /usr/src/redhat/SPECS/fish.spec
|
||||
mv /usr/src/redhat/RPMS/*/fish*@PACKAGE_VERSION@*.rpm .
|
||||
mv /usr/src/redhat/SRPMS/fish*@PACKAGE_VERSION@*.src.rpm .
|
||||
.PHONY: rpm
|
||||
|
||||
|
||||
#
|
||||
# Cleanup targets
|
||||
#
|
||||
@@ -909,10 +819,8 @@ rpm: fish-@PACKAGE_VERSION@.tar.bz2 fish.spec
|
||||
#
|
||||
|
||||
distclean: clean
|
||||
rm -f fish.spec Doxyfile.help
|
||||
rm -f etc/config.fish seq share/config.fish
|
||||
rm -f fish.spec
|
||||
rm -f config.status config.log config.h Makefile
|
||||
rm -rf $(XSEL)
|
||||
.PHONY: distclean
|
||||
|
||||
|
||||
@@ -921,76 +829,80 @@ distclean: clean
|
||||
# are created by the configure script.
|
||||
#
|
||||
|
||||
# Don't delete the docs unless we have Doxygen installed
|
||||
# We provide pre-built docs in the tarball, and if they get
|
||||
# deleted we won't be able to regenerate them
|
||||
|
||||
clean:
|
||||
rm -f *.o doc.h doc.tmp doc_src/*.doxygen doc_src/*.cpp doc_src/*.o doc_src/commands.hdr
|
||||
rm -f $(GENERATED_INTERN_SCRIPT_FILES)
|
||||
rm -f tests/tmp.err tests/tmp.out tests/tmp.status tests/foo.txt
|
||||
rm -f $(PROGRAMS) fish_tests tokenizer_test key_reader
|
||||
rm -f share/config.fish etc/config.fish doc_src/index.hdr doc_src/commands.hdr
|
||||
rm -f fish-@PACKAGE_VERSION@.tar
|
||||
rm -f fish-@PACKAGE_VERSION@.tar.gz
|
||||
rm -f fish-@PACKAGE_VERSION@.tar.bz2
|
||||
rm -rf doc;
|
||||
rm -rf fish-@PACKAGE_VERSION@
|
||||
rm -f $(PROGRAMS) fish_tests key_reader
|
||||
rm -f command_list.txt command_list_toc.txt toc.txt
|
||||
rm -f doc_src/index.hdr doc_src/commands.hdr
|
||||
rm -f FISH-BUILD-VERSION-FILE
|
||||
if test "$(HAVE_DOXYGEN)" = 1; then \
|
||||
rm -rf doc user_doc share/man; \
|
||||
fi
|
||||
rm -f $(TRANSLATIONS)
|
||||
test ! -d "$(XSEL)" || make -C $(XSEL) clean
|
||||
.PHONY: clean
|
||||
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
autoload.o: config.h autoload.h common.h util.h lru.h wutil.h signal.h env.h
|
||||
autoload.o: builtin_scripts.h exec.h proc.h io.h
|
||||
builtin.o: config.h signal.h fallback.h util.h wutil.h builtin.h io.h
|
||||
builtin.o: common.h function.h event.h complete.h proc.h parser.h reader.h
|
||||
builtin.o: env.h wgetopt.h sanity.h tokenizer.h wildcard.h input_common.h
|
||||
autoload.o: exec.h proc.h io.h
|
||||
builtin.o: config.h signal.h fallback.h util.h wutil.h common.h builtin.h
|
||||
builtin.o: io.h function.h event.h complete.h proc.h parser.h reader.h env.h
|
||||
builtin.o: wgetopt.h sanity.h tokenizer.h wildcard.h expand.h input_common.h
|
||||
builtin.o: input.h intern.h exec.h highlight.h screen.h color.h parse_util.h
|
||||
builtin.o: autoload.h lru.h parser_keywords.h expand.h path.h builtin_set.cpp
|
||||
builtin.o: builtin_commandline.cpp builtin_complete.cpp builtin_ulimit.cpp
|
||||
builtin.o: builtin_jobs.cpp
|
||||
builtin_commandline.o: config.h signal.h fallback.h util.h wutil.h builtin.h
|
||||
builtin_commandline.o: io.h common.h wgetopt.h reader.h proc.h parser.h
|
||||
builtin_commandline.o: event.h function.h tokenizer.h input_common.h input.h
|
||||
builtin_commandline.o: parse_util.h autoload.h lru.h
|
||||
builtin_complete.o: config.h signal.h fallback.h util.h wutil.h builtin.h
|
||||
builtin_complete.o: io.h common.h complete.h wgetopt.h parser.h proc.h
|
||||
builtin.o: autoload.h lru.h parser_keywords.h path.h history.h
|
||||
builtin.o: builtin_set.cpp builtin_commandline.cpp builtin_complete.cpp
|
||||
builtin.o: builtin_ulimit.cpp builtin_jobs.cpp builtin_printf.cpp
|
||||
builtin_commandline.o: config.h signal.h fallback.h util.h wutil.h common.h
|
||||
builtin_commandline.o: builtin.h io.h wgetopt.h reader.h complete.h proc.h
|
||||
builtin_commandline.o: parser.h event.h function.h tokenizer.h input_common.h
|
||||
builtin_commandline.o: input.h parse_util.h autoload.h lru.h
|
||||
builtin_complete.o: config.h signal.h fallback.h util.h wutil.h common.h
|
||||
builtin_complete.o: builtin.h io.h complete.h wgetopt.h parser.h proc.h
|
||||
builtin_complete.o: event.h function.h reader.h
|
||||
builtin_jobs.o: config.h fallback.h signal.h util.h wutil.h builtin.h io.h
|
||||
builtin_jobs.o: common.h proc.h parser.h event.h function.h wgetopt.h
|
||||
builtin_scripts.o: builtin_scripts.h
|
||||
builtin_set.o: config.h signal.h fallback.h util.h wutil.h builtin.h io.h
|
||||
builtin_set.o: common.h env.h expand.h wgetopt.h proc.h parser.h event.h
|
||||
builtin_jobs.o: config.h fallback.h signal.h util.h wutil.h common.h
|
||||
builtin_jobs.o: builtin.h io.h proc.h parser.h event.h function.h wgetopt.h
|
||||
builtin_set.o: config.h signal.h fallback.h util.h wutil.h common.h builtin.h
|
||||
builtin_set.o: io.h env.h expand.h wgetopt.h proc.h parser.h event.h
|
||||
builtin_set.o: function.h
|
||||
builtin_test.o: config.h common.h util.h builtin.h io.h wutil.h proc.h
|
||||
builtin_test.o: signal.h
|
||||
builtin_ulimit.o: config.h fallback.h signal.h util.h builtin.h io.h common.h
|
||||
builtin_ulimit.o: wgetopt.h
|
||||
color.o: color.h config.h common.h util.h
|
||||
builtin_printf.o: wgetopt.h
|
||||
color.o: color.h config.h common.h util.h fallback.h signal.h
|
||||
common.o: config.h fallback.h signal.h util.h wutil.h common.h expand.h
|
||||
common.o: proc.h io.h wildcard.h parser.h event.h function.h complete.h
|
||||
common.o: util.cpp fallback.cpp
|
||||
complete.o: config.h signal.h fallback.h util.h tokenizer.h wildcard.h
|
||||
complete.o: common.h proc.h io.h parser.h event.h function.h complete.h
|
||||
complete.o: builtin.h env.h exec.h expand.h reader.h history.h intern.h
|
||||
complete.o: parse_util.h autoload.h lru.h parser_keywords.h wutil.h path.h
|
||||
complete.o: builtin_scripts.h
|
||||
env.o: config.h signal.h fallback.h util.h wutil.h proc.h io.h common.h env.h
|
||||
env.o: sanity.h expand.h history.h reader.h parser.h event.h function.h
|
||||
env.o: env_universal.h env_universal_common.h input_common.h path.h
|
||||
env.o: complete.h
|
||||
complete.o: config.h signal.h fallback.h util.h tokenizer.h common.h
|
||||
complete.o: wildcard.h expand.h proc.h io.h parser.h event.h function.h
|
||||
complete.o: complete.h builtin.h env.h exec.h reader.h history.h wutil.h
|
||||
complete.o: intern.h parse_util.h autoload.h lru.h parser_keywords.h path.h
|
||||
env.o: config.h signal.h fallback.h util.h wutil.h common.h proc.h io.h env.h
|
||||
env.o: sanity.h expand.h history.h reader.h complete.h parser.h event.h
|
||||
env.o: function.h env_universal.h env_universal_common.h input.h
|
||||
env.o: input_common.h path.h
|
||||
env_universal.o: config.h signal.h fallback.h util.h common.h wutil.h
|
||||
env_universal.o: env_universal_common.h env_universal.h
|
||||
env_universal_common.o: config.h signal.h fallback.h util.h common.h wutil.h
|
||||
env_universal_common.o: env_universal_common.h
|
||||
event.o: config.h signal.h fallback.h util.h wutil.h function.h common.h
|
||||
event.o: config.h signal.h fallback.h util.h wutil.h common.h function.h
|
||||
event.o: event.h proc.h io.h parser.h
|
||||
exec.o: config.h signal.h fallback.h util.h common.h wutil.h proc.h io.h
|
||||
exec.o: exec.h parser.h event.h function.h builtin.h env.h wildcard.h
|
||||
exec.o: sanity.h expand.h parse_util.h autoload.h lru.h
|
||||
exec.o: config.h signal.h fallback.h util.h iothread.h postfork.h common.h
|
||||
exec.o: proc.h io.h wutil.h exec.h parser.h event.h function.h builtin.h
|
||||
exec.o: env.h wildcard.h expand.h sanity.h parse_util.h autoload.h lru.h
|
||||
expand.o: config.h signal.h fallback.h util.h common.h wutil.h env.h proc.h
|
||||
expand.o: io.h parser.h event.h function.h expand.h wildcard.h exec.h
|
||||
expand.o: tokenizer.h complete.h parse_util.h autoload.h lru.h
|
||||
fallback.o: config.h fallback.h signal.h util.h
|
||||
fish.o: config.h signal.h fallback.h util.h common.h reader.h io.h builtin.h
|
||||
fish.o: function.h event.h complete.h wutil.h env.h sanity.h proc.h parser.h
|
||||
fish.o: config.h signal.h fallback.h util.h common.h reader.h io.h complete.h
|
||||
fish.o: builtin.h function.h event.h wutil.h env.h sanity.h proc.h parser.h
|
||||
fish.o: expand.h intern.h exec.h output.h screen.h color.h history.h path.h
|
||||
fish_indent.o: config.h fallback.h signal.h util.h common.h wutil.h
|
||||
fish_indent.o: tokenizer.h print_help.h parser_keywords.h
|
||||
@@ -998,70 +910,72 @@ fish_pager.o: config.h signal.h fallback.h util.h wutil.h common.h complete.h
|
||||
fish_pager.o: output.h screen.h color.h input_common.h env_universal.h
|
||||
fish_pager.o: env_universal_common.h print_help.h
|
||||
fish_tests.o: config.h signal.h fallback.h util.h common.h proc.h io.h
|
||||
fish_tests.o: reader.h builtin.h function.h event.h autoload.h lru.h
|
||||
fish_tests.o: complete.h wutil.h env.h expand.h parser.h tokenizer.h output.h
|
||||
fish_tests.o: screen.h color.h exec.h path.h history.h
|
||||
fish_tests.o: reader.h complete.h builtin.h function.h event.h autoload.h
|
||||
fish_tests.o: lru.h wutil.h env.h expand.h parser.h tokenizer.h output.h
|
||||
fish_tests.o: screen.h color.h exec.h path.h history.h highlight.h iothread.h
|
||||
fish_tests.o: postfork.h
|
||||
fishd.o: config.h signal.h fallback.h util.h common.h wutil.h
|
||||
fishd.o: env_universal_common.h path.h print_help.h
|
||||
function.o: config.h signal.h wutil.h fallback.h util.h function.h common.h
|
||||
function.o: event.h proc.h io.h parser.h intern.h reader.h parse_util.h
|
||||
function.o: autoload.h lru.h parser_keywords.h env.h expand.h
|
||||
function.o: builtin_scripts.h
|
||||
highlight.o: config.h signal.h fallback.h util.h wutil.h highlight.h env.h
|
||||
highlight.o: common.h screen.h color.h tokenizer.h proc.h io.h parser.h
|
||||
highlight.o: event.h function.h parse_util.h autoload.h lru.h
|
||||
highlight.o: parser_keywords.h builtin.h expand.h sanity.h complete.h
|
||||
highlight.o: output.h wildcard.h path.h
|
||||
history.o: config.h fallback.h signal.h util.h sanity.h wutil.h history.h
|
||||
history.o: common.h intern.h path.h autoload.h lru.h
|
||||
input.o: config.h signal.h fallback.h util.h wutil.h reader.h io.h common.h
|
||||
input.o: proc.h sanity.h input_common.h input.h parser.h event.h function.h
|
||||
input.o: env.h expand.h output.h screen.h color.h intern.h
|
||||
fishd.o: env_universal_common.h path.h env.h print_help.h
|
||||
function.o: config.h signal.h wutil.h common.h util.h fallback.h function.h
|
||||
function.o: event.h proc.h io.h parser.h intern.h reader.h complete.h
|
||||
function.o: parse_util.h autoload.h lru.h parser_keywords.h env.h expand.h
|
||||
highlight.o: config.h signal.h fallback.h util.h wutil.h common.h highlight.h
|
||||
highlight.o: env.h screen.h color.h tokenizer.h proc.h io.h parser.h event.h
|
||||
highlight.o: function.h parse_util.h autoload.h lru.h parser_keywords.h
|
||||
highlight.o: builtin.h expand.h sanity.h complete.h output.h wildcard.h
|
||||
highlight.o: path.h history.h
|
||||
history.o: config.h fallback.h signal.h util.h sanity.h tokenizer.h common.h
|
||||
history.o: wutil.h history.h intern.h path.h env.h autoload.h lru.h
|
||||
history.o: iothread.h
|
||||
input.o: config.h signal.h fallback.h util.h wutil.h common.h reader.h io.h
|
||||
input.o: complete.h proc.h sanity.h input_common.h input.h parser.h event.h
|
||||
input.o: function.h env.h expand.h output.h screen.h color.h intern.h
|
||||
input_common.o: config.h fallback.h signal.h util.h common.h wutil.h
|
||||
input_common.o: input_common.h env_universal.h env_universal_common.h
|
||||
input_common.o: iothread.h
|
||||
intern.o: config.h fallback.h signal.h util.h wutil.h common.h intern.h
|
||||
io.o: config.h fallback.h signal.h util.h wutil.h exec.h proc.h io.h common.h
|
||||
iothread.o: iothread.h signal.h
|
||||
key_reader.o: config.h fallback.h signal.h input_common.h
|
||||
kill.o: config.h signal.h fallback.h util.h wutil.h kill.h proc.h io.h
|
||||
kill.o: common.h sanity.h env.h exec.h path.h
|
||||
io.o: config.h fallback.h signal.h util.h wutil.h common.h exec.h proc.h io.h
|
||||
iothread.o: config.h iothread.h common.h util.h signal.h
|
||||
key_reader.o: config.h common.h util.h fallback.h signal.h input_common.h
|
||||
kill.o: config.h signal.h fallback.h util.h wutil.h common.h kill.h proc.h
|
||||
kill.o: io.h sanity.h env.h exec.h path.h
|
||||
mimedb.o: config.h xdgmime.h fallback.h signal.h util.h print_help.h
|
||||
output.o: config.h signal.h fallback.h util.h wutil.h expand.h common.h
|
||||
output.o: config.h signal.h fallback.h util.h wutil.h common.h expand.h
|
||||
output.o: output.h screen.h color.h highlight.h env.h
|
||||
parse_util.o: config.h fallback.h signal.h util.h wutil.h common.h
|
||||
parse_util.o: tokenizer.h parse_util.h autoload.h lru.h expand.h intern.h
|
||||
parse_util.o: exec.h proc.h io.h env.h wildcard.h
|
||||
parser.o: config.h signal.h fallback.h util.h common.h wutil.h proc.h io.h
|
||||
parser.o: parser.h event.h function.h parser_keywords.h tokenizer.h exec.h
|
||||
parser.o: wildcard.h builtin.h env.h expand.h reader.h sanity.h
|
||||
parser.o: wildcard.h expand.h builtin.h env.h reader.h complete.h sanity.h
|
||||
parser.o: env_universal.h env_universal_common.h intern.h parse_util.h
|
||||
parser.o: autoload.h lru.h path.h complete.h
|
||||
parser.o: autoload.h lru.h path.h
|
||||
parser_keywords.o: config.h fallback.h signal.h common.h util.h
|
||||
parser_keywords.o: parser_keywords.h
|
||||
path.o: config.h fallback.h signal.h util.h common.h env.h wutil.h path.h
|
||||
path.o: expand.h
|
||||
postfork.o: signal.h postfork.h config.h common.h util.h proc.h io.h wutil.h
|
||||
postfork.o: iothread.h exec.h
|
||||
print_help.o: print_help.h
|
||||
proc.o: config.h signal.h fallback.h util.h wutil.h proc.h io.h common.h
|
||||
proc.o: reader.h sanity.h env.h parser.h event.h function.h output.h screen.h
|
||||
proc.o: color.h
|
||||
reader.o: config.h signal.h fallback.h util.h wutil.h highlight.h env.h
|
||||
reader.o: common.h screen.h color.h reader.h io.h proc.h parser.h event.h
|
||||
reader.o: function.h complete.h history.h sanity.h exec.h expand.h
|
||||
reader.o: tokenizer.h kill.h input_common.h input.h output.h iothread.h
|
||||
reader.o: intern.h parse_util.h autoload.h lru.h
|
||||
proc.o: config.h signal.h fallback.h util.h wutil.h common.h proc.h io.h
|
||||
proc.o: reader.h complete.h sanity.h env.h parser.h event.h function.h
|
||||
proc.o: output.h screen.h color.h
|
||||
reader.o: config.h signal.h fallback.h util.h wutil.h common.h highlight.h
|
||||
reader.o: env.h screen.h color.h reader.h io.h complete.h proc.h parser.h
|
||||
reader.o: event.h function.h history.h sanity.h exec.h expand.h tokenizer.h
|
||||
reader.o: kill.h input_common.h input.h output.h iothread.h intern.h path.h
|
||||
reader.o: parse_util.h autoload.h lru.h
|
||||
sanity.o: config.h signal.h fallback.h util.h common.h sanity.h proc.h io.h
|
||||
sanity.o: history.h reader.h kill.h wutil.h
|
||||
sanity.o: history.h wutil.h reader.h complete.h kill.h
|
||||
screen.o: config.h fallback.h signal.h common.h util.h wutil.h output.h
|
||||
screen.o: screen.h color.h highlight.h env.h
|
||||
set_color.o: config.h fallback.h signal.h print_help.h
|
||||
signal.o: config.h signal.h common.h util.h fallback.h wutil.h event.h
|
||||
signal.o: reader.h io.h proc.h
|
||||
tokenizer.o: config.h fallback.h signal.h util.h wutil.h tokenizer.h common.h
|
||||
signal.o: reader.h io.h complete.h proc.h
|
||||
tokenizer.o: config.h fallback.h signal.h util.h wutil.h common.h tokenizer.h
|
||||
util.o: config.h fallback.h signal.h util.h common.h wutil.h
|
||||
wgetopt.o: config.h wgetopt.h wutil.h fallback.h signal.h
|
||||
wildcard.o: config.h fallback.h signal.h util.h wutil.h complete.h common.h
|
||||
wildcard.o: wildcard.h reader.h io.h expand.h exec.h proc.h
|
||||
wgetopt.o: config.h wgetopt.h wutil.h common.h util.h fallback.h signal.h
|
||||
wildcard.o: config.h fallback.h signal.h util.h wutil.h common.h complete.h
|
||||
wildcard.o: wildcard.h expand.h reader.h io.h exec.h proc.h
|
||||
wutil.o: config.h fallback.h signal.h util.h common.h wutil.h
|
||||
xdgmime.o: xdgmime.h xdgmimeint.h xdgmimeglob.h xdgmimemagic.h xdgmimealias.h
|
||||
xdgmime.o: xdgmimeparent.h
|
||||
|
||||
15
README
15
README
@@ -1,15 +0,0 @@
|
||||
How to find documentation for fish
|
||||
==================================
|
||||
|
||||
The fish documentation is distributed in an intermediate format. To
|
||||
view it, you have to type:
|
||||
|
||||
% make user_doc
|
||||
|
||||
Which will create the directory user_doc, containing html
|
||||
documentation for fish. If you build and install fish, the
|
||||
documentation will be available through the 'help' builtin.
|
||||
|
||||
After installation, you can start fish by typing fish in the
|
||||
terminal. After fish has started, try using the help command for more
|
||||
information.
|
||||
73
README.md
Normal file
73
README.md
Normal file
@@ -0,0 +1,73 @@
|
||||
[fish](http://fishshell.com/) - the friendly interactive shell
|
||||
================================================
|
||||
|
||||
fish is a smart and user-friendly command line shell for OS X, Linux, and the rest of the family. fish includes features like syntax highlighting, autosuggest-as-you-type, and fancy tab completions that just work, with no configuration required.
|
||||
|
||||
For more on fish's design philosophy, see the [design document](http://fishshell.com/docs/2.0/design.html).
|
||||
|
||||
## Quick Start
|
||||
|
||||
fish generally works like other shells, like bash or zsh. A few important differences can be found at <http://fishshell.com/tutorial.html> by searching for magic phrase 'unlike other shells'.
|
||||
|
||||
Detailed user documentation is available by running `help` within fish, and also at <http://fishshell.com/docs/2.0/index.html>
|
||||
|
||||
## Building
|
||||
|
||||
fish is written in a sane subset of C++98, with a few components from C++TR1. It builds successfully with g++ 4.2 or later, and with clang. It also will build as C++11.
|
||||
|
||||
fish can be built using autotools or Xcode. autoconf 2.60 or later is required.
|
||||
|
||||
fish requires gettext for translation support.
|
||||
|
||||
### Autotools Build
|
||||
|
||||
autoconf
|
||||
./configure
|
||||
make [gmake on BSD]
|
||||
sudo make install
|
||||
|
||||
### Xcode Development Build
|
||||
|
||||
* Build the `base` target in Xcode
|
||||
* Run the fish executable, for example, in `DerivedData/fish/Build/Products/Debug/base/bin/fish`
|
||||
|
||||
### Xcode Build and Install
|
||||
|
||||
xcodebuild install
|
||||
sudo ditto /tmp/fish.dst /
|
||||
|
||||
## Help, it didn't build!
|
||||
|
||||
If fish reports that it could not find curses, try installing a curses development package and build again.
|
||||
|
||||
On Debian or Ubuntu you want:
|
||||
|
||||
sudo apt-get install libncurses5-dev
|
||||
|
||||
on RedHat, CentOS, or Amazon EC2:
|
||||
|
||||
sudo yum install ncurses-devel
|
||||
|
||||
## Packages for Linux
|
||||
|
||||
Nightly builds for several Linux distros can be downloaded from <http://download.opensuse.org/repositories/home:/siteshwar/>
|
||||
|
||||
## Switching to fish
|
||||
|
||||
If you wish to use fish as your default shell, use the following command:
|
||||
|
||||
chsh -s /usr/local/bin/fish
|
||||
|
||||
chsh will prompt you for your password, and change your default shell.
|
||||
|
||||
To switch your default shell back, you can run:
|
||||
|
||||
chsh -s /bin/bash
|
||||
|
||||
Substitute /bin/bash with /bin/tcsh or /bin/zsh as appropriate.
|
||||
|
||||
## Contact Us
|
||||
|
||||
Questions, comments, rants and raves can be posted to the official fish mailing list at <https://lists.sourceforge.net/lists/listinfo/fish-users> or join us on our IRC channel [#fish at irc.oftc.net](https://webchat.oftc.net/?channels=fish).
|
||||
|
||||
Found a bug? Have an awesome idea? Please open an issue on this github page.
|
||||
235
autoload.cpp
235
autoload.cpp
@@ -1,5 +1,5 @@
|
||||
/** \file autoload.cpp
|
||||
|
||||
|
||||
The classes responsible for autoloading functions and completions.
|
||||
*/
|
||||
|
||||
@@ -9,7 +9,6 @@ The classes responsible for autoloading functions and completions.
|
||||
#include "common.h"
|
||||
#include "signal.h"
|
||||
#include "env.h"
|
||||
#include "builtin_scripts.h"
|
||||
#include "exec.h"
|
||||
#include <assert.h>
|
||||
#include <algorithm>
|
||||
@@ -17,20 +16,28 @@ The classes responsible for autoloading functions and completions.
|
||||
/* The time before we'll recheck an autoloaded file */
|
||||
static const int kAutoloadStalenessInterval = 15;
|
||||
|
||||
file_access_attempt_t access_file(const wcstring &path, int mode) {
|
||||
file_access_attempt_t access_file(const wcstring &path, int mode)
|
||||
{
|
||||
//printf("Touch %ls\n", path.c_str());
|
||||
file_access_attempt_t result = {0};
|
||||
struct stat statbuf;
|
||||
if (wstat(path, &statbuf)) {
|
||||
if (wstat(path, &statbuf))
|
||||
{
|
||||
result.error = errno;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
result.mod_time = statbuf.st_mtime;
|
||||
if (waccess(path, mode)) {
|
||||
if (waccess(path, mode))
|
||||
{
|
||||
result.error = errno;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
result.accessible = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Note that we record the last checked time after the call, on the assumption that in a slow filesystem, the lag comes before the kernel check, not after.
|
||||
result.stale = false;
|
||||
result.last_checked = time(NULL);
|
||||
@@ -38,91 +45,95 @@ file_access_attempt_t access_file(const wcstring &path, int mode) {
|
||||
}
|
||||
|
||||
autoload_t::autoload_t(const wcstring &env_var_name_var, const builtin_script_t * const scripts, size_t script_count) :
|
||||
env_var_name(env_var_name_var),
|
||||
builtin_scripts(scripts),
|
||||
builtin_script_count(script_count)
|
||||
lock(),
|
||||
env_var_name(env_var_name_var),
|
||||
builtin_scripts(scripts),
|
||||
builtin_script_count(script_count),
|
||||
last_path(),
|
||||
is_loading_set()
|
||||
{
|
||||
pthread_mutex_init(&lock, NULL);
|
||||
}
|
||||
|
||||
autoload_t::~autoload_t() {
|
||||
autoload_t::~autoload_t()
|
||||
{
|
||||
pthread_mutex_destroy(&lock);
|
||||
}
|
||||
|
||||
void autoload_t::node_was_evicted(autoload_function_t *node) {
|
||||
void autoload_t::node_was_evicted(autoload_function_t *node)
|
||||
{
|
||||
// This should only ever happen on the main thread
|
||||
ASSERT_IS_MAIN_THREAD();
|
||||
|
||||
|
||||
// Tell ourselves that the command was removed if it was loaded
|
||||
if (! node->is_loaded)
|
||||
this->command_removed(node->key);
|
||||
delete node;
|
||||
}
|
||||
|
||||
int autoload_t::unload( const wcstring &cmd )
|
||||
int autoload_t::unload(const wcstring &cmd)
|
||||
{
|
||||
return this->evict_node(cmd);
|
||||
}
|
||||
|
||||
int autoload_t::load( const wcstring &cmd, bool reload )
|
||||
int autoload_t::load(const wcstring &cmd, bool reload)
|
||||
{
|
||||
int res;
|
||||
CHECK_BLOCK( 0 );
|
||||
int res;
|
||||
CHECK_BLOCK(0);
|
||||
ASSERT_IS_MAIN_THREAD();
|
||||
|
||||
env_var_t path_var = env_get_string( env_var_name );
|
||||
|
||||
|
||||
env_var_t path_var = env_get_string(env_var_name);
|
||||
|
||||
/*
|
||||
Do we know where to look?
|
||||
*/
|
||||
if( path_var.empty() )
|
||||
if (path_var.empty())
|
||||
return 0;
|
||||
|
||||
|
||||
/* Check if the lookup path has changed. If so, drop all loaded files. path_var may only be inspected on the main thread. */
|
||||
if( path_var != this->last_path )
|
||||
if (path_var != this->last_path)
|
||||
{
|
||||
this->last_path = path_var;
|
||||
scoped_lock locker(lock);
|
||||
this->evict_all_nodes();
|
||||
}
|
||||
|
||||
|
||||
/** Warn and fail on infinite recursion. It's OK to do this because this function is only called on the main thread. */
|
||||
if (this->is_loading(cmd))
|
||||
{
|
||||
debug( 0,
|
||||
_( L"Could not autoload item '%ls', it is already being autoloaded. "
|
||||
L"This is a circular dependency in the autoloading scripts, please remove it."),
|
||||
cmd.c_str() );
|
||||
debug(0,
|
||||
_(L"Could not autoload item '%ls', it is already being autoloaded. "
|
||||
L"This is a circular dependency in the autoloading scripts, please remove it."),
|
||||
cmd.c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* Mark that we're loading this */
|
||||
is_loading_set.insert(cmd);
|
||||
|
||||
/* Get the list of paths from which we will try to load */
|
||||
std::vector<wcstring> path_list;
|
||||
tokenize_variable_array( path_var, path_list );
|
||||
tokenize_variable_array(path_var, path_list);
|
||||
|
||||
/* Try loading it */
|
||||
res = this->locate_file_and_maybe_load_it(cmd, true, reload, path_list);
|
||||
|
||||
/* Try loading it */
|
||||
res = this->locate_file_and_maybe_load_it( cmd, true, reload, path_list );
|
||||
|
||||
/* Clean up */
|
||||
int erased = is_loading_set.erase(cmd);
|
||||
bool erased = !! is_loading_set.erase(cmd);
|
||||
assert(erased);
|
||||
|
||||
return res;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
bool autoload_t::can_load( const wcstring &cmd, const env_vars &vars )
|
||||
bool autoload_t::can_load(const wcstring &cmd, const env_vars_snapshot_t &vars)
|
||||
{
|
||||
const wchar_t *path_var_ptr = vars.get(env_var_name.c_str());
|
||||
if (! path_var_ptr || ! path_var_ptr[0])
|
||||
const env_var_t path_var = vars.get(env_var_name);
|
||||
if (path_var.missing_or_empty())
|
||||
return false;
|
||||
|
||||
const wcstring path_var(path_var_ptr);
|
||||
|
||||
std::vector<wcstring> path_list;
|
||||
tokenize_variable_array( path_var, path_list );
|
||||
return this->locate_file_and_maybe_load_it( cmd, false, false, path_list );
|
||||
tokenize_variable_array(path_var, path_list);
|
||||
return this->locate_file_and_maybe_load_it(cmd, false, false, path_list);
|
||||
}
|
||||
|
||||
static bool script_name_precedes_script_name(const builtin_script_t &script1, const builtin_script_t &script2)
|
||||
@@ -130,20 +141,22 @@ static bool script_name_precedes_script_name(const builtin_script_t &script1, co
|
||||
return wcscmp(script1.name, script2.name) < 0;
|
||||
}
|
||||
|
||||
void autoload_t::unload_all(void) {
|
||||
void autoload_t::unload_all(void)
|
||||
{
|
||||
scoped_lock locker(lock);
|
||||
this->evict_all_nodes();
|
||||
}
|
||||
|
||||
/** Check whether the given command is loaded. */
|
||||
bool autoload_t::has_tried_loading( const wcstring &cmd )
|
||||
bool autoload_t::has_tried_loading(const wcstring &cmd)
|
||||
{
|
||||
scoped_lock locker(lock);
|
||||
scoped_lock locker(lock);
|
||||
autoload_function_t * func = this->get_node(cmd);
|
||||
return func != NULL;
|
||||
}
|
||||
|
||||
static bool is_stale(const autoload_function_t *func) {
|
||||
static bool is_stale(const autoload_function_t *func)
|
||||
{
|
||||
/** Return whether this function is stale. Internalized functions can never be stale. */
|
||||
return ! func->is_internalized && time(NULL) - func->access.last_checked > kAutoloadStalenessInterval;
|
||||
}
|
||||
@@ -152,11 +165,15 @@ autoload_function_t *autoload_t::get_autoloaded_function_with_creation(const wcs
|
||||
{
|
||||
ASSERT_IS_LOCKED(lock);
|
||||
autoload_function_t *func = this->get_node(cmd);
|
||||
if (! func) {
|
||||
if (! func)
|
||||
{
|
||||
func = new autoload_function_t(cmd);
|
||||
if (allow_eviction) {
|
||||
if (allow_eviction)
|
||||
{
|
||||
this->add_node(func);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
this->add_node_without_eviction(func);
|
||||
}
|
||||
}
|
||||
@@ -167,58 +184,66 @@ autoload_function_t *autoload_t::get_autoloaded_function_with_creation(const wcs
|
||||
This internal helper function does all the real work. By using two
|
||||
functions, the internal function can return on various places in
|
||||
the code, and the caller can take care of various cleanup work.
|
||||
|
||||
|
||||
cmd: the command name ('grep')
|
||||
really_load: whether to actually parse it as a function, or just check it it exists
|
||||
reload: whether to reload it if it's already loaded
|
||||
path_list: the set of paths to check
|
||||
|
||||
|
||||
Result: if really_load is true, returns whether the function was loaded. Otherwise returns whether the function existed.
|
||||
*/
|
||||
bool autoload_t::locate_file_and_maybe_load_it( const wcstring &cmd, bool really_load, bool reload, const wcstring_list_t &path_list )
|
||||
bool autoload_t::locate_file_and_maybe_load_it(const wcstring &cmd, bool really_load, bool reload, const wcstring_list_t &path_list)
|
||||
{
|
||||
/* Note that we are NOT locked in this function! */
|
||||
size_t i;
|
||||
bool reloaded = 0;
|
||||
size_t i;
|
||||
bool reloaded = 0;
|
||||
|
||||
/* Try using a cached function. If we really want the function to be loaded, require that it be really loaded. If we're not reloading, allow stale functions. */
|
||||
{
|
||||
bool allow_stale_functions = ! reload;
|
||||
|
||||
|
||||
/* Take a lock */
|
||||
scoped_lock locker(lock);
|
||||
|
||||
|
||||
/* Get the function */
|
||||
autoload_function_t * func = this->get_node(cmd);
|
||||
|
||||
|
||||
/* Determine if we can use this cached function */
|
||||
bool use_cached;
|
||||
if (! func) {
|
||||
if (! func)
|
||||
{
|
||||
/* Can't use a function that doesn't exist */
|
||||
use_cached = false;
|
||||
} else if ( ! allow_stale_functions && is_stale(func)) {
|
||||
/* Can't use a stale function */
|
||||
use_cached = false;
|
||||
} else if (really_load && ! func->is_placeholder && ! func->is_loaded) {
|
||||
}
|
||||
else if (really_load && ! func->is_placeholder && ! func->is_loaded)
|
||||
{
|
||||
/* Can't use an unloaded function */
|
||||
use_cached = false;
|
||||
} else {
|
||||
}
|
||||
else if (! allow_stale_functions && is_stale(func))
|
||||
{
|
||||
/* Can't use a stale function */
|
||||
use_cached = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* I guess we can use it */
|
||||
use_cached = true;
|
||||
}
|
||||
|
||||
|
||||
/* If we can use this function, return whether we were able to access it */
|
||||
if (use_cached) {
|
||||
if (use_cached)
|
||||
{
|
||||
return func->is_internalized || func->access.accessible;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* The source of the script will end up here */
|
||||
wcstring script_source;
|
||||
bool has_script_source = false;
|
||||
|
||||
|
||||
/* Whether we found an accessible file */
|
||||
bool found_file = false;
|
||||
|
||||
|
||||
/* Look for built-in scripts via a binary search */
|
||||
const builtin_script_t *matching_builtin_script = NULL;
|
||||
if (builtin_script_count > 0)
|
||||
@@ -232,65 +257,70 @@ bool autoload_t::locate_file_and_maybe_load_it( const wcstring &cmd, bool really
|
||||
matching_builtin_script = found;
|
||||
}
|
||||
}
|
||||
if (matching_builtin_script) {
|
||||
if (matching_builtin_script)
|
||||
{
|
||||
has_script_source = true;
|
||||
script_source = str2wcstring(matching_builtin_script->def);
|
||||
|
||||
|
||||
/* Make a node representing this function */
|
||||
scoped_lock locker(lock);
|
||||
autoload_function_t *func = this->get_autoloaded_function_with_creation(cmd, really_load);
|
||||
|
||||
|
||||
/* This function is internalized */
|
||||
func->is_internalized = true;
|
||||
|
||||
|
||||
/* It's a fiction to say the script is loaded at this point, but we're definitely going to load it down below. */
|
||||
if (really_load) func->is_loaded = true;
|
||||
}
|
||||
|
||||
|
||||
if (! has_script_source)
|
||||
{
|
||||
/* Iterate over path searching for suitable completion files */
|
||||
for( i=0; i<path_list.size(); i++ )
|
||||
for (i=0; i<path_list.size(); i++)
|
||||
{
|
||||
wcstring next = path_list.at(i);
|
||||
wcstring path = next + L"/" + cmd + L".fish";
|
||||
|
||||
const file_access_attempt_t access = access_file(path, R_OK);
|
||||
if (access.accessible) {
|
||||
if (access.accessible)
|
||||
{
|
||||
/* Found it! */
|
||||
found_file = true;
|
||||
|
||||
|
||||
/* Now we're actually going to take the lock. */
|
||||
scoped_lock locker(lock);
|
||||
autoload_function_t *func = this->get_node(cmd);
|
||||
|
||||
|
||||
/* Generate the source if we need to load it */
|
||||
bool need_to_load_function = really_load && (func == NULL || func->access.mod_time == access.mod_time || ! func->is_loaded);
|
||||
if (need_to_load_function) {
|
||||
|
||||
bool need_to_load_function = really_load && (func == NULL || func->access.mod_time != access.mod_time || ! func->is_loaded);
|
||||
if (need_to_load_function)
|
||||
{
|
||||
|
||||
/* Generate the script source */
|
||||
wcstring esc = escape_string(path, 1);
|
||||
script_source = L". " + esc;
|
||||
has_script_source = true;
|
||||
|
||||
|
||||
/* Remove any loaded command because we are going to reload it. Note that this will deadlock if command_removed calls back into us. */
|
||||
if (func && func->is_loaded) {
|
||||
if (func && func->is_loaded)
|
||||
{
|
||||
command_removed(cmd);
|
||||
func->is_placeholder = false;
|
||||
}
|
||||
|
||||
|
||||
/* Mark that we're reloading it */
|
||||
reloaded = true;
|
||||
}
|
||||
|
||||
|
||||
/* Create the function if we haven't yet. This does not load it. Do not trigger eviction unless we are actually loading, because we don't want to evict off of the main thread. */
|
||||
if (! func) {
|
||||
if (! func)
|
||||
{
|
||||
func = get_autoloaded_function_with_creation(cmd, really_load);
|
||||
}
|
||||
|
||||
|
||||
/* It's a fiction to say the script is loaded at this point, but we're definitely going to load it down below. */
|
||||
if (need_to_load_function) func->is_loaded = true;
|
||||
|
||||
|
||||
/* Unconditionally record our access time */
|
||||
func->access = access;
|
||||
|
||||
@@ -303,39 +333,44 @@ bool autoload_t::locate_file_and_maybe_load_it( const wcstring &cmd, bool really
|
||||
Later we only research if the current time is at least five seconds later.
|
||||
This way, the files won't be searched over and over again.
|
||||
*/
|
||||
if( ! found_file && ! has_script_source )
|
||||
if (! found_file && ! has_script_source)
|
||||
{
|
||||
scoped_lock locker(lock);
|
||||
/* Generate a placeholder */
|
||||
autoload_function_t *func = this->get_node(cmd);
|
||||
if (! func) {
|
||||
if (! func)
|
||||
{
|
||||
func = new autoload_function_t(cmd);
|
||||
func->is_placeholder = true;
|
||||
if (really_load) {
|
||||
if (really_load)
|
||||
{
|
||||
this->add_node(func);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
this->add_node_without_eviction(func);
|
||||
}
|
||||
}
|
||||
func->access.last_checked = time(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* If we have a script, either built-in or a file source, then run it */
|
||||
if (really_load && has_script_source)
|
||||
{
|
||||
if( exec_subshell( script_source) == -1 )
|
||||
if (exec_subshell(script_source, false /* do not apply exit status */) == -1)
|
||||
{
|
||||
/*
|
||||
Do nothing on failiure
|
||||
*/
|
||||
/* Do nothing on failure */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (really_load) {
|
||||
if (really_load)
|
||||
{
|
||||
return reloaded;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
return found_file || has_script_source;
|
||||
}
|
||||
}
|
||||
|
||||
77
autoload.h
77
autoload.h
@@ -14,7 +14,8 @@
|
||||
#include "lru.h"
|
||||
|
||||
/** A struct responsible for recording an attempt to access a file. */
|
||||
struct file_access_attempt_t {
|
||||
struct file_access_attempt_t
|
||||
{
|
||||
time_t mod_time; /** The modification time of the file */
|
||||
time_t last_checked; /** When we last checked the file */
|
||||
bool accessible; /** Whether we believe we could access this file */
|
||||
@@ -25,7 +26,7 @@ struct file_access_attempt_t {
|
||||
file_access_attempt_t access_file(const wcstring &path, int mode);
|
||||
|
||||
struct autoload_function_t : public lru_node_t
|
||||
{
|
||||
{
|
||||
autoload_function_t(const wcstring &key) : lru_node_t(key), access(), is_loaded(false), is_placeholder(false), is_internalized(false) { }
|
||||
file_access_attempt_t access; /** The last access attempt */
|
||||
bool is_loaded; /** Whether we have actually loaded this function */
|
||||
@@ -33,14 +34,20 @@ struct autoload_function_t : public lru_node_t
|
||||
bool is_internalized; /** Whether this function came from a builtin "internalized" script */
|
||||
};
|
||||
|
||||
struct builtin_script_t
|
||||
{
|
||||
const wchar_t *name;
|
||||
const char *def;
|
||||
};
|
||||
|
||||
struct builtin_script_t;
|
||||
class env_vars;
|
||||
class env_vars_snapshot_t;
|
||||
|
||||
/**
|
||||
A class that represents a path from which we can autoload, and the autoloaded contents.
|
||||
*/
|
||||
class autoload_t : private lru_cache_t<autoload_function_t> {
|
||||
class autoload_t : private lru_cache_t<autoload_function_t>
|
||||
{
|
||||
private:
|
||||
|
||||
/** Lock for thread safety */
|
||||
@@ -48,63 +55,65 @@ class autoload_t : private lru_cache_t<autoload_function_t> {
|
||||
|
||||
/** The environment variable name */
|
||||
const wcstring env_var_name;
|
||||
|
||||
|
||||
/** Builtin script array */
|
||||
const struct builtin_script_t *const builtin_scripts;
|
||||
|
||||
|
||||
/** Builtin script count */
|
||||
const size_t builtin_script_count;
|
||||
|
||||
/** The path from which we most recently autoloaded */
|
||||
wcstring last_path;
|
||||
|
||||
/**
|
||||
A table containing all the files that are currently being
|
||||
loaded. This is here to help prevent recursion.
|
||||
*/
|
||||
/**
|
||||
A table containing all the files that are currently being
|
||||
loaded. This is here to help prevent recursion.
|
||||
*/
|
||||
std::set<wcstring> is_loading_set;
|
||||
|
||||
bool is_loading(const wcstring &name) const {
|
||||
bool is_loading(const wcstring &name) const
|
||||
{
|
||||
return is_loading_set.find(name) != is_loading_set.end();
|
||||
}
|
||||
|
||||
void remove_all_functions(void) {
|
||||
|
||||
void remove_all_functions(void)
|
||||
{
|
||||
this->evict_all_nodes();
|
||||
}
|
||||
|
||||
bool locate_file_and_maybe_load_it( const wcstring &cmd, bool really_load, bool reload, const wcstring_list_t &path_list );
|
||||
|
||||
|
||||
bool locate_file_and_maybe_load_it(const wcstring &cmd, bool really_load, bool reload, const wcstring_list_t &path_list);
|
||||
|
||||
virtual void node_was_evicted(autoload_function_t *node);
|
||||
|
||||
autoload_function_t *get_autoloaded_function_with_creation(const wcstring &cmd, bool allow_eviction);
|
||||
|
||||
protected:
|
||||
|
||||
protected:
|
||||
/** Overridable callback for when a command is removed */
|
||||
virtual void command_removed(const wcstring &cmd) { }
|
||||
|
||||
public:
|
||||
|
||||
|
||||
public:
|
||||
|
||||
/** Create an autoload_t for the given environment variable name */
|
||||
autoload_t(const wcstring &env_var_name_var, const builtin_script_t *scripts, size_t script_count );
|
||||
|
||||
autoload_t(const wcstring &env_var_name_var, const builtin_script_t *scripts, size_t script_count);
|
||||
|
||||
/** Destructor */
|
||||
virtual ~autoload_t();
|
||||
|
||||
|
||||
/**
|
||||
Autoload the specified file, if it exists in the specified path. Do
|
||||
not load it multiple times unless it's timestamp changes or
|
||||
not load it multiple times unless its timestamp changes or
|
||||
parse_util_unload is called.
|
||||
|
||||
Autoloading one file may unload another.
|
||||
Autoloading one file may unload another.
|
||||
|
||||
\param cmd the filename to search for. The suffix '.fish' is always added to this name
|
||||
\param on_unload a callback function to run if a suitable file is found, which has not already been run. unload will also be called for old files which are unloaded.
|
||||
\param reload wheter to recheck file timestamps on already loaded files
|
||||
*/
|
||||
int load( const wcstring &cmd, bool reload );
|
||||
|
||||
int load(const wcstring &cmd, bool reload);
|
||||
|
||||
/** Check whether we have tried loading the given command. Does not do any I/O. */
|
||||
bool has_tried_loading( const wcstring &cmd );
|
||||
bool has_tried_loading(const wcstring &cmd);
|
||||
|
||||
/**
|
||||
Tell the autoloader that the specified file, in the specified path,
|
||||
@@ -114,15 +123,15 @@ class autoload_t : private lru_cache_t<autoload_function_t> {
|
||||
\param on_unload a callback function which will be called before (re)loading a file, may be used to unload the previous file.
|
||||
\return non-zero if the file was removed, zero if the file had not yet been loaded
|
||||
*/
|
||||
int unload( const wcstring &cmd );
|
||||
|
||||
int unload(const wcstring &cmd);
|
||||
|
||||
/**
|
||||
Unloads all files.
|
||||
*/
|
||||
void unload_all( );
|
||||
|
||||
void unload_all();
|
||||
|
||||
/** Check whether the given command could be loaded, but do not load it. */
|
||||
bool can_load( const wcstring &cmd, const env_vars &vars );
|
||||
bool can_load(const wcstring &cmd, const env_vars_snapshot_t &vars);
|
||||
|
||||
};
|
||||
|
||||
|
||||
134
build_tools/build_documentation.sh
Executable file
134
build_tools/build_documentation.sh
Executable file
@@ -0,0 +1,134 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script is run as part of the build process
|
||||
|
||||
if test $# -eq 0
|
||||
then
|
||||
# Use fish's defaults
|
||||
DOXYFILE=Doxyfile.help
|
||||
INPUTDIR=doc_src
|
||||
OUTPUTDIR=share
|
||||
echo "Using defaults: $0 ${DOXYFILE} ${INPUTDIR} ${OUTPUTDIR}"
|
||||
elif test $# -eq 3
|
||||
then
|
||||
DOXYFILE="$1"
|
||||
INPUTDIR="$2"
|
||||
OUTPUTDIR="$3"
|
||||
else
|
||||
echo "Usage: $0 doxygen_file input_directory output_directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Determine which man pages we don't want to generate.
|
||||
# on OS X, don't make a man page for open, since we defeat fish's open function on OS X.
|
||||
CONDEMNED_PAGES=
|
||||
if test `uname` = 'Darwin'; then
|
||||
CONDEMNED_PAGES="$CONDEMNED_PAGES open.1"
|
||||
fi
|
||||
|
||||
# Helper function to turn a relative path into an absolute path
|
||||
resolve_path()
|
||||
{
|
||||
D=`command dirname "$1"`
|
||||
B=`command basename "$1"`
|
||||
echo "`cd \"$D\" 2>/dev/null && pwd || echo \"$D\"`/$B"
|
||||
}
|
||||
|
||||
# Expand relative paths
|
||||
DOXYFILE=`resolve_path "$DOXYFILE"`
|
||||
INPUTDIR=`resolve_path "$INPUTDIR"`
|
||||
OUTPUTDIR=`resolve_path "$OUTPUTDIR"`
|
||||
|
||||
echo " doxygen file: $DOXYFILE"
|
||||
echo " input directory: $INPUTDIR"
|
||||
echo " output directory: $OUTPUTDIR"
|
||||
echo " skipping: $CONDEMNED_PAGES"
|
||||
|
||||
# Make sure INPUTDIR is found
|
||||
if test ! -d "$INPUTDIR"; then
|
||||
echo >&2 "Could not find input directory '${INPUTDIR}'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make sure doxygen is found
|
||||
DOXYGENPATH=`command -v doxygen`
|
||||
if test -z "$DOXYGENPATH" ; then
|
||||
for i in /usr/local/bin/doxygen /opt/bin/doxygen /Applications/Doxygen.app/Contents/Resources/doxygen ~/Applications/Doxygen.app/Contents/Resources/doxygen ; do
|
||||
if test -f "$i"; then
|
||||
DOXYGENPATH="$i"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test -z "$DOXYGENPATH"; then
|
||||
echo >&2 "doxygen is not installed, so documentation will not be built."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Determine where our output should go
|
||||
if ! mkdir -p "${OUTPUTDIR}" ; then
|
||||
echo "Could not create output directory '${OUTPUTDIR}'"
|
||||
fi
|
||||
|
||||
# Make a temporary directory
|
||||
TMPLOC=`mktemp -d -t fish_doc_build_XXXXXX` || { echo >&2 "Could not build documentation because mktemp failed"; exit 1; }
|
||||
|
||||
# Copy stuff to the temp directory
|
||||
for i in "$INPUTDIR"/*.txt; do
|
||||
INPUTFILE=$TMPLOC/`basename $i .txt`.doxygen
|
||||
echo "/** \page" `basename $i .txt` > $INPUTFILE
|
||||
cat $i >>$INPUTFILE
|
||||
echo "*/" >>$INPUTFILE
|
||||
done
|
||||
|
||||
# Make some extra stuff to pass to doxygen
|
||||
# Input is kept as . because we cd to the input directory beforehand
|
||||
# This prevents doxygen from generating "documentation" for intermediate directories
|
||||
DOXYPARAMS=$(cat <<EOF
|
||||
PROJECT_NUMBER=2.0.0
|
||||
INPUT=.
|
||||
OUTPUT_DIRECTORY=$OUTPUTDIR
|
||||
QUIET=YES
|
||||
EOF
|
||||
);
|
||||
|
||||
# echo "$DOXYPARAMS"
|
||||
|
||||
# Clear out the output directory first
|
||||
find "${OUTPUTDIR}" -name "*.1" -delete
|
||||
|
||||
# Run doxygen
|
||||
cd "$TMPLOC"
|
||||
(cat "${DOXYFILE}" ; echo "$DOXYPARAMS";) | "$DOXYGENPATH" -
|
||||
|
||||
# Remember errors
|
||||
RESULT=$?
|
||||
|
||||
cd "${OUTPUTDIR}/man/man1/"
|
||||
if test "$RESULT" = 0 ; then
|
||||
|
||||
# Postprocess the files
|
||||
for i in "$INPUTDIR"/*.txt; do
|
||||
# It would be nice to use -i here for edit in place, but that is not portable
|
||||
CMD_NAME=`basename "$i" .txt`;
|
||||
sed -e "s/\(.\)\\.SH/\1/" -e "s/$CMD_NAME *\\\\- *\"\(.*\)\"/\1/" "${CMD_NAME}.1" > "${CMD_NAME}.1.tmp"
|
||||
mv "${CMD_NAME}.1.tmp" "${CMD_NAME}.1"
|
||||
done
|
||||
|
||||
# Erase condemned pages
|
||||
rm -f $CONDEMNED_PAGES
|
||||
|
||||
fi
|
||||
|
||||
# Destroy TMPLOC
|
||||
echo "Cleaning up '$TMPLOC'"
|
||||
rm -Rf "$TMPLOC"
|
||||
|
||||
if test "$RESULT" = 0; then
|
||||
# Tell the user what we did
|
||||
echo "Output man pages into '${OUTPUTDIR}'"
|
||||
else
|
||||
echo "Doxygen failed. See the output log for details."
|
||||
fi
|
||||
exit $RESULT
|
||||
3
build_tools/description-pak
Normal file
3
build_tools/description-pak
Normal file
@@ -0,0 +1,3 @@
|
||||
This is the_ridiculous'fish s delightful fork of, fish friendly interactive shell. For more information, visit http://ridiculousfish.com/shell/ .
|
||||
|
||||
This installer will install fish, but will not modify your /etc/shells file or your default shell. I trust you know how to do that yourself if you care to!
|
||||
@@ -1 +0,0 @@
|
||||
<pkg-contents spec="1.12"/>
|
||||
@@ -1 +0,0 @@
|
||||
<pkgref spec="1.12" uuid="6A7E1ED5-E40E-4ACE-959B-B9D77555AD39"><config><identifier>com.ridiculousfish.fish-shell.fishShell.fish_pkg.pkg</identifier><version>1.0</version><description></description><post-install type="none"/><requireAuthorization/><installFrom>/private/tmp/fish_pkg</installFrom><installTo>/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>installTo</mod><mod>parent</mod></config></pkgref>
|
||||
@@ -1,40 +0,0 @@
|
||||
<pkmkdoc spec="1.12"><properties><title>fish shell</title><organization>com.ridiculousfish.fish-shell</organization><userSees ui="easy"/><min-target os="3"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><contents><choice title="fish_pkg" id="fish shell" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="com.ridiculousfish.fish-shell.fishShell.fish_pkg.pkg"/></choice></contents><resources bg-scale="proportional" bg-align="bottomleft"><locale lang="en"><resource mod="true" type="background">/Users/peter/Desktop/Untitled.pdf</resource><resource mime-type="text/rtf" kind="embedded" type="welcome"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
|
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
|
||||
\f0\fs30 \cf0 This installs ridiculous_fish's fork of fish, a command line shell for Mac OS X, Linux, and the rest of the family. For more information on fish, visit {\field{\*\fldinst{HYPERLINK "http://ridiculousfish.com/shell/"}}{\fldrslt http://ridiculousfish.com/shell/}}\
|
||||
\
|
||||
The path to fish will be added to /etc/shells, but your default shell will not be modified. \
|
||||
\
|
||||
This release is beta r1.\
|
||||
}]]></resource><resource mime-type="text/rtf" kind="embedded" type="conclusion"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
|
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Monaco;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
|
||||
\f0\fs26 \cf0 Run
|
||||
\f1 fish
|
||||
\f0 at the command line to start it up! Some useful commands:\
|
||||
\
|
||||
Interactively set your colors from a web page:\
|
||||
\
|
||||
|
||||
\f1 fish_config
|
||||
\f0 \
|
||||
\
|
||||
Update man-page completions:\
|
||||
\
|
||||
|
||||
\f1 fish_update_completions
|
||||
\f0 \
|
||||
\
|
||||
Make fish your default shell:\
|
||||
\
|
||||
|
||||
\f1 chsh -s /usr/local/bin/fish\
|
||||
|
||||
\f0 \
|
||||
\
|
||||
Enjoy!\
|
||||
}]]></resource></locale></resources><flags/><item type="file">01fish.xml</item><mod>properties.title</mod><mod>description</mod></pkmkdoc>
|
||||
31
build_tools/git_version_gen.sh
Executable file
31
build_tools/git_version_gen.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
# Originally from the git sources (GIT-VERSION-GEN)
|
||||
# Presumably (C) Junio C Hamano <junkio@cox.net>
|
||||
# Reused under GPL v2.0
|
||||
# Modified for fish by David Adam <zanchey@ucc.gu.uwa.edu.au>
|
||||
|
||||
FBVF=FISH-BUILD-VERSION-FILE
|
||||
DEF_VER=2.0.GIT
|
||||
|
||||
# First see if there is a version file (included in release tarballs),
|
||||
# then try git-describe, then default.
|
||||
if test -f version
|
||||
then
|
||||
VN=$(cat version) || VN="$DEF_VER"
|
||||
elif test -d .git -o -f .git && type git >/dev/null
|
||||
then
|
||||
VN=$(git describe --tags --dirty 2>/dev/null)
|
||||
else
|
||||
VN="$DEF_VER"
|
||||
fi
|
||||
|
||||
if test -r $FBVF
|
||||
then
|
||||
VC=$(sed -e 's/^FISH_BUILD_VERSION = //' <$FBVF)
|
||||
else
|
||||
VC=unset
|
||||
fi
|
||||
test "$VN" = "$VC" || {
|
||||
echo >&2 "FISH_BUILD_VERSION = $VN"
|
||||
echo "FISH_BUILD_VERSION = $VN" >$FBVF
|
||||
}
|
||||
8
build_tools/make_csv_completions.fish
Executable file
8
build_tools/make_csv_completions.fish
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env fish
|
||||
#
|
||||
# This file produces command specific completions for csv. Meant to be executed
|
||||
# from the root directory (so the completions get put in the right place).
|
||||
|
||||
. build_tools/make_vcs_completions_generic.fish
|
||||
|
||||
write_completions csv >share/completions/csv.fish
|
||||
12
build_tools/make_darcs_completions.fish
Executable file
12
build_tools/make_darcs_completions.fish
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env fish
|
||||
#
|
||||
# This file produces command specific completions for darcs. Meant to be
|
||||
# executed from the root directory (so the completions get put in the right
|
||||
# place).
|
||||
|
||||
. build_tools/make_vcs_completions_generic.fish
|
||||
|
||||
set darcs_comp 'complete -c darcs -n "not __fish_use_subcommand" -a "(test -f _darcs/prefs/repos; and cat _darcs/prefs/repos)" --description "Darcs repo"'
|
||||
set darcs_comp $darcs_comp 'complete -c darcs -a "test predist boringfile binariesfile" -n "contains setpref (commandline -poc)" --description "Set the specified option" -x'
|
||||
|
||||
write_completions darcs $darcs_comp >share/completions/darcs.fish
|
||||
8
build_tools/make_hg_completions.fish
Executable file
8
build_tools/make_hg_completions.fish
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env fish
|
||||
#
|
||||
# This file produces command specific completions for hg. Meant to be executed
|
||||
# from the root directory (so the completions get put in the right place).
|
||||
|
||||
. build_tools/make_vcs_completions_generic.fish
|
||||
|
||||
write_completions hg >share/completions/hg.fish
|
||||
@@ -1,31 +1,30 @@
|
||||
#!/bin/sh -x
|
||||
#!/bin/sh
|
||||
|
||||
VERSION=`sed -E -n 's/^.*PACKAGE_VERSION "([0-9.]+)"/\1/p' osx/config.h`
|
||||
if test -z "$VERSION" ; then
|
||||
echo "Could not get version from osx/config.h"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Version is $VERSION"
|
||||
|
||||
set -x
|
||||
|
||||
make distclean
|
||||
rm -rf /tmp/fish_pkg
|
||||
mkdir -p /tmp/fish_pkg/
|
||||
rm -Rf /tmp/fish_pkg
|
||||
|
||||
# Make sure what we build can run on SnowLeopard
|
||||
export OSX_SDK="/Developer/SDKs/MacOSX10.6.sdk"
|
||||
export MACOSX_DEPLOYMENT_TARGET="10.6"
|
||||
export CC="clang -isysroot $OSX_SDK -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
|
||||
export CCX="clang++ -isysroot $OSX_SDK -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
|
||||
export CFLAGS="$CFLAGS -isysroot $OSX_SDK -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
|
||||
export CXXFLAGS="$CXXFLAGS -isysroot $OSX_SDK -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
|
||||
export LDFLAGS="$LDFLAGS -isysroot $OSX_SDK -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
|
||||
autoconf
|
||||
./configure --without-xsel
|
||||
#Exit on error
|
||||
set -e
|
||||
|
||||
# Actually build it now
|
||||
if make -j 4 DESTDIR=/tmp/fish_pkg install
|
||||
then
|
||||
echo "Root written to /tmp/fish_pkg/"
|
||||
if /Developer/usr/bin/packagemaker --doc ./build_tools/fish_shell.pmdoc --out ~/fish_built/fishfish.pkg
|
||||
then
|
||||
echo "Package written to ~/fish_built/fishfish.pkg"
|
||||
else
|
||||
echo "Package could not be written"
|
||||
fi
|
||||
|
||||
else
|
||||
echo "Root could not be written"
|
||||
fi
|
||||
mkdir -p /tmp/fish_pkg/root /tmp/fish_pkg/intermediates /tmp/fish_pkg/dst
|
||||
xcodebuild install -scheme install_tree -configuration Release DSTROOT=/tmp/fish_pkg/root/
|
||||
pkgbuild --scripts build_tools/osx_package_scripts --root /tmp/fish_pkg/root/ --identifier 'com.ridiculousfish.fish-shell-pkg' --version "$VERSION" /tmp/fish_pkg/intermediates/fish.pkg
|
||||
|
||||
productbuild --package-path /tmp/fish_pkg/intermediates --distribution build_tools/osx_distribution.xml --resources build_tools/osx_package_resources/ ~/fish_built/fish.pkg
|
||||
|
||||
|
||||
# Make the app
|
||||
xcodebuild -scheme fish.app -configuration Release DSTROOT=/tmp/fish_app/
|
||||
rm -f ~/fish_built/fish.app.zip
|
||||
cd DerivedData/fish/Build/Products/Release/
|
||||
zip -r ~/fish_built/fish.app.zip fish.app
|
||||
|
||||
8
build_tools/make_svn_completions.fish
Executable file
8
build_tools/make_svn_completions.fish
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env fish
|
||||
#
|
||||
# This file produces command specific completions for svn. Meant to be executed
|
||||
# from the root directory (so the completions get put in the right place).
|
||||
|
||||
. build_tools/make_vcs_completions_generic.fish
|
||||
|
||||
write_completions svn >share/completions/svn.fish
|
||||
@@ -1,9 +1,58 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm -f ~/fish_built/fishfish.tar.gz
|
||||
if git archive --format=tar --prefix=fishfish/ fish_fish | gzip - > ~/fish_built/fishfish.tar.gz
|
||||
then
|
||||
echo "Tarball written to ~/fish_built/fishfish.tar.gz"
|
||||
else
|
||||
echo "Tarball could not be written"
|
||||
fi
|
||||
# Script to generate a tarball
|
||||
# We use git to output a tree. But we also want to build the user documentation
|
||||
# and put that in the tarball, so that nobody needs to have doxygen installed
|
||||
# to build it.
|
||||
|
||||
# Exit on error
|
||||
set -e
|
||||
|
||||
# We wil generate a tarball with a prefix "fish"
|
||||
# git can do that automatically for us via git-archive
|
||||
# but to get the documentation in, we need to make a symlink called "fish"
|
||||
# and tar from that, so that the documentation gets the right prefix
|
||||
|
||||
# Get the current directory, which we'll use for symlinks
|
||||
wd="$PWD"
|
||||
|
||||
# The name of the prefix, which is the directory that you get when you untar
|
||||
prefix="fish"
|
||||
|
||||
# Get the version from git-describe
|
||||
VERSION=`git describe --tags --dirty 2>/dev/null`
|
||||
prefix="$prefix-$VERSION"
|
||||
|
||||
# The path where we will output the tar file
|
||||
path=~/fish_built/$prefix.tar
|
||||
|
||||
# Clean up stuff we've written before
|
||||
rm -f "$path" "$path".gz
|
||||
|
||||
# git starts the archive
|
||||
git archive --format=tar --prefix="$prefix"/ master > "$path"
|
||||
|
||||
# tarball out the documentation, generate a configure script and version file
|
||||
# Don't use autoreconf since it invokes commands that may not be installed, like aclocal
|
||||
# Don't run autoheader since configure.ac runs it. autoconf is enough.
|
||||
autoconf
|
||||
./configure --with-doxygen
|
||||
make user_doc share/man
|
||||
echo $VERSION > version
|
||||
cd /tmp
|
||||
rm -f "$prefix"
|
||||
ln -s "$wd" "$prefix"
|
||||
TAR_APPEND="gnutar --append --file=$path --mtime=now --owner=0 --group=0 --mode=g+w,a+rX"
|
||||
$TAR_APPEND --no-recursion "$prefix"/user_doc
|
||||
$TAR_APPEND "$prefix"/user_doc/html "$prefix"/share/man
|
||||
$TAR_APPEND "$prefix"/version
|
||||
$TAR_APPEND "$prefix"/configure "$prefix"/config.h.in
|
||||
rm -f "$prefix"/version
|
||||
rm -f "$prefix"
|
||||
|
||||
# gzip it
|
||||
gzip "$path"
|
||||
|
||||
# Output what we did, and the sha1 hash
|
||||
echo "Tarball written to $path".gz
|
||||
openssl sha1 "$path".gz
|
||||
|
||||
9
build_tools/make_vcs_completions.fish
Executable file
9
build_tools/make_vcs_completions.fish
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env fish
|
||||
#
|
||||
# This file produces command specific completions for hg, darcs and a
|
||||
# few other vcs systems.
|
||||
|
||||
build_tools/make_darcs_completions.fish
|
||||
build_tools/make_hg_completions.fish
|
||||
build_tools/make_svn_completions.fish
|
||||
build_tools/make_csv_completions.fish
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env fish
|
||||
#
|
||||
# This file produces command specific completions for hg, darcs and a
|
||||
# few other vcs systems. It uses the fact that all these systems have a
|
||||
# somewhat uniform command line help mechanism.
|
||||
# This file provides generic functions for generating specific completions for
|
||||
# hg, darcs and a few other vcs systems. It uses the fact that all these
|
||||
# systems have a somewhat uniform command line help mechanism.
|
||||
#
|
||||
|
||||
function cap
|
||||
@@ -227,11 +227,3 @@ function write_completions
|
||||
echo \n\n
|
||||
|
||||
end
|
||||
|
||||
set darcs_comp 'complete -c darcs -n "not __fish_use_subcommand" -a "(test -f _darcs/prefs/repos; and cat _darcs/prefs/repos)" --description "Darcs repo"'
|
||||
set darcs_comp $darcs_comp 'complete -c darcs -a "test predist boringfile binariesfile" -n "contains setpref (commandline -poc)" --description "Set the specified option" -x'
|
||||
|
||||
write_completions darcs $darcs_comp >share/completions/darcs.fish
|
||||
write_completions hg >share/completions/hg.fish
|
||||
write_completions svn >share/completions/svn.fish
|
||||
write_completions cvs >share/completions/cvs.fish
|
||||
18
build_tools/osx_distribution.xml
Normal file
18
build_tools/osx_distribution.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<installer-gui-script minSpecVersion="1">
|
||||
<title>fish shell</title>
|
||||
<welcome file="welcome.rtf"/>
|
||||
<background file="terminal_logo.png" scaling="proportional" alignment="bottomleft"/>
|
||||
<pkg-ref id="com.ridiculousfish.fish-shell-pkg"/>
|
||||
<options customize="never" require-scripts="false"/>
|
||||
<choices-outline>
|
||||
<line choice="default">
|
||||
<line choice="com.ridiculousfish.fish-shell-pkg"/>
|
||||
</line>
|
||||
</choices-outline>
|
||||
<choice id="default"/>
|
||||
<choice id="com.ridiculousfish.fish-shell-pkg" visible="false">
|
||||
<pkg-ref id="com.ridiculousfish.fish-shell-pkg"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.ridiculousfish.fish-shell-pkg" version="0" onConclusion="none">fish.pkg</pkg-ref>
|
||||
</installer-gui-script>
|
||||
BIN
build_tools/osx_package_resources/terminal_logo.png
Normal file
BIN
build_tools/osx_package_resources/terminal_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
25
build_tools/osx_package_resources/welcome.rtf
Normal file
25
build_tools/osx_package_resources/welcome.rtf
Normal file
@@ -0,0 +1,25 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf370
|
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Monaco;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
{\info
|
||||
{\author dlkfjslfjsfdlkfk}}\margl1440\margr1440\vieww10800\viewh8400\viewkind0
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
|
||||
\f0\fs30 \cf0 The fish shell is a smart and user friendly command line shell. For more information, visit {\field{\*\fldinst{HYPERLINK "http://fishshell.com"}}{\fldrslt http://fishshell.com}}.\
|
||||
\
|
||||
fish will be installed into
|
||||
\f1\fs26 /usr/local/
|
||||
\f0\fs30 , and fish will be added to
|
||||
\f1\fs26 /etc/shells
|
||||
\f0\fs30 if necessary.\
|
||||
\
|
||||
Your default shell will
|
||||
\i not
|
||||
\i0 be changed. To make fish your default, run:\
|
||||
\
|
||||
|
||||
\f1 chsh -s /usr/local/bin/fish
|
||||
\f0 \
|
||||
\
|
||||
Enjoy!\
|
||||
}
|
||||
@@ -21,7 +21,7 @@ tmpfile=${file}.tmp
|
||||
set -o noclobber
|
||||
|
||||
trap "rm -f $tmpfile" EXIT
|
||||
|
||||
|
||||
if ! cat $file > $tmpfile
|
||||
then
|
||||
cat 1>&2 <<EOF
|
||||
@@ -31,11 +31,16 @@ EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Append a newline if it doesn't exist
|
||||
if [ "$(tail -c1 "$tmpfile"; echo x)" != $'\nx' ]; then
|
||||
echo "" >> "$tmpfile"
|
||||
fi
|
||||
|
||||
for i
|
||||
do
|
||||
if ! grep -q "^${i}$" $tmpfile
|
||||
if ! grep -q "^${i}$" "$tmpfile"
|
||||
then
|
||||
echo $i >> $tmpfile
|
||||
echo $i >> "$tmpfile"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#!/bin/sh -x
|
||||
|
||||
./add-shell /usr/local/bin/fish > /tmp/fish_postinstall_output.log
|
||||
killall fishd || true
|
||||
|
||||
|
||||
5992
builtin.cpp
5992
builtin.cpp
File diff suppressed because it is too large
Load Diff
34
builtin.h
34
builtin.h
@@ -1,5 +1,5 @@
|
||||
/** \file builtin.h
|
||||
Prototypes for functions for executing builtin functions.
|
||||
Prototypes for functions for executing builtin functions.
|
||||
*/
|
||||
|
||||
#ifndef FISH_BUILTIN_H
|
||||
@@ -15,9 +15,9 @@ class parser_t;
|
||||
|
||||
enum
|
||||
{
|
||||
COMMAND_NOT_BUILTIN,
|
||||
BUILTIN_REGULAR,
|
||||
BUILTIN_FUNCTION
|
||||
COMMAND_NOT_BUILTIN,
|
||||
BUILTIN_REGULAR,
|
||||
BUILTIN_FUNCTION
|
||||
}
|
||||
;
|
||||
|
||||
@@ -49,7 +49,7 @@ enum
|
||||
/**
|
||||
Error message for unknown switch
|
||||
*/
|
||||
#define BUILTIN_ERR_UNKNOWN _( L"%ls: Unknown option '%ls'\n" )
|
||||
#define BUILTIN_ERR_UNKNOWN _( L"%ls: Unknown option '%ls'\n" )
|
||||
|
||||
/**
|
||||
Error message for invalid character in variable name
|
||||
@@ -67,12 +67,16 @@ enum
|
||||
#define BUILTIN_FOR_ERR_IN _( L"%ls: Second argument must be 'in'\n" )
|
||||
|
||||
/**
|
||||
Error message for insufficient number of arguments
|
||||
Error message for insufficient number of arguments
|
||||
*/
|
||||
#define BUILTIN_FOR_ERR_COUNT _( L"%ls: Expected at least two arguments, got %d\n")
|
||||
|
||||
#define BUILTIN_FOR_ERR_NAME _( L"%ls: '%ls' is not a valid variable name\n" )
|
||||
|
||||
/** Error messages for 'else if' */
|
||||
#define BUILTIN_ELSEIF_ERR_COUNT _( L"%ls: can only take 'if' and then another command as an argument\n")
|
||||
#define BUILTIN_ELSEIF_ERR_ARGUMENT _( L"%ls: any second argument must be 'if'\n")
|
||||
|
||||
/**
|
||||
Error message when too many arguments are supplied to a builtin
|
||||
*/
|
||||
@@ -109,7 +113,7 @@ extern int builtin_err_redirect;
|
||||
|
||||
|
||||
/**
|
||||
Initialize builtin data.
|
||||
Initialize builtin data.
|
||||
*/
|
||||
void builtin_init();
|
||||
|
||||
@@ -121,21 +125,21 @@ void builtin_destroy();
|
||||
/**
|
||||
Is there a builtin command with the given name?
|
||||
*/
|
||||
int builtin_exists( const wcstring &cmd );
|
||||
int builtin_exists(const wcstring &cmd);
|
||||
|
||||
/**
|
||||
Execute a builtin command
|
||||
Execute a builtin command
|
||||
|
||||
\param parser The parser being used
|
||||
\param argv Array containing the command and parameters
|
||||
\param argv Array containing the command and parameters
|
||||
of the builtin. The list is terminated by a
|
||||
null pointer. This syntax resembles the syntax
|
||||
null pointer. This syntax resembles the syntax
|
||||
for exec.
|
||||
\param io the io redirections to perform on this builtin.
|
||||
|
||||
\return the exit status of the builtin command
|
||||
*/
|
||||
int builtin_run( parser_t &parser, const wchar_t * const *argv, io_data_t *io );
|
||||
int builtin_run(parser_t &parser, const wchar_t * const *argv, const io_chain_t &io);
|
||||
|
||||
/** Returns a list of all builtin names */
|
||||
wcstring_list_t builtin_get_names(void);
|
||||
@@ -146,7 +150,7 @@ void builtin_get_names(std::vector<completion_t> &list);
|
||||
/**
|
||||
Pushes a new set of input/output to the stack. The new stdin is supplied, a new set of output strings is created.
|
||||
*/
|
||||
void builtin_push_io( parser_t &parser, int stdin_fd );
|
||||
void builtin_push_io(parser_t &parser, int stdin_fd);
|
||||
|
||||
/**
|
||||
Pops a set of input/output from the stack. The output strings are destroued, but the input file is not closed.
|
||||
@@ -157,7 +161,7 @@ void builtin_pop_io(parser_t &parser);
|
||||
/**
|
||||
Return a one-line description of the specified builtin.
|
||||
*/
|
||||
wcstring builtin_get_desc( const wcstring &b );
|
||||
wcstring builtin_get_desc(const wcstring &b);
|
||||
|
||||
|
||||
/**
|
||||
@@ -173,6 +177,6 @@ const wchar_t *builtin_complete_get_temporary_buffer();
|
||||
for the specified command.
|
||||
*/
|
||||
|
||||
wcstring builtin_help_get( parser_t &parser, const wchar_t *cmd );
|
||||
wcstring builtin_help_get(parser_t &parser, const wchar_t *cmd);
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
1024
builtin_complete.cpp
1024
builtin_complete.cpp
File diff suppressed because it is too large
Load Diff
482
builtin_jobs.cpp
482
builtin_jobs.cpp
@@ -1,5 +1,5 @@
|
||||
/** \file builtin_jobs.c
|
||||
Functions for executing the jobs builtin.
|
||||
Functions for executing the jobs builtin.
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
@@ -30,12 +30,12 @@
|
||||
*/
|
||||
enum
|
||||
{
|
||||
JOBS_DEFAULT, /**< Print lots of general info */
|
||||
JOBS_PRINT_PID, /**< Print pid of each process in job */
|
||||
JOBS_PRINT_COMMAND, /**< Print command name of each process in job */
|
||||
JOBS_PRINT_GROUP, /**< Print group id of job */
|
||||
JOBS_DEFAULT, /**< Print lots of general info */
|
||||
JOBS_PRINT_PID, /**< Print pid of each process in job */
|
||||
JOBS_PRINT_COMMAND, /**< Print command name of each process in job */
|
||||
JOBS_PRINT_GROUP, /**< Print group id of job */
|
||||
}
|
||||
;
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -43,113 +43,113 @@ enum
|
||||
/**
|
||||
Calculates the cpu usage (in percent) of the specified job.
|
||||
*/
|
||||
static int cpu_use( const job_t *j )
|
||||
static int cpu_use(const job_t *j)
|
||||
{
|
||||
double u=0;
|
||||
process_t *p;
|
||||
double u=0;
|
||||
process_t *p;
|
||||
|
||||
for( p=j->first_process; p; p=p->next )
|
||||
{
|
||||
struct timeval t;
|
||||
int jiffies;
|
||||
gettimeofday( &t, 0 );
|
||||
jiffies = proc_get_jiffies( p );
|
||||
for (p=j->first_process; p; p=p->next)
|
||||
{
|
||||
struct timeval t;
|
||||
int jiffies;
|
||||
gettimeofday(&t, 0);
|
||||
jiffies = proc_get_jiffies(p);
|
||||
|
||||
double t1 = 1000000.0*p->last_time.tv_sec+p->last_time.tv_usec;
|
||||
double t2 = 1000000.0*t.tv_sec+t.tv_usec;
|
||||
double t1 = 1000000.0*p->last_time.tv_sec+p->last_time.tv_usec;
|
||||
double t2 = 1000000.0*t.tv_sec+t.tv_usec;
|
||||
|
||||
/* fwprintf( stderr, L"t1 %f t2 %f p1 %d p2 %d\n",
|
||||
t1, t2, jiffies, p->last_jiffies );
|
||||
*/
|
||||
/* fwprintf( stderr, L"t1 %f t2 %f p1 %d p2 %d\n",
|
||||
t1, t2, jiffies, p->last_jiffies );
|
||||
*/
|
||||
|
||||
u += ((double)(jiffies-p->last_jiffies))/(t2-t1);
|
||||
}
|
||||
return u*1000000;
|
||||
u += ((double)(jiffies-p->last_jiffies))/(t2-t1);
|
||||
}
|
||||
return u*1000000;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Print information about the specified job
|
||||
*/
|
||||
static void builtin_jobs_print( const job_t *j, int mode, int header )
|
||||
static void builtin_jobs_print(const job_t *j, int mode, int header)
|
||||
{
|
||||
process_t *p;
|
||||
switch( mode )
|
||||
{
|
||||
case JOBS_DEFAULT:
|
||||
{
|
||||
process_t *p;
|
||||
switch (mode)
|
||||
{
|
||||
case JOBS_DEFAULT:
|
||||
{
|
||||
|
||||
if( header )
|
||||
{
|
||||
/*
|
||||
Print table header before first job
|
||||
*/
|
||||
stdout_buffer.append( _( L"Job\tGroup\t" ));
|
||||
if (header)
|
||||
{
|
||||
/*
|
||||
Print table header before first job
|
||||
*/
|
||||
stdout_buffer.append(_(L"Job\tGroup\t"));
|
||||
#ifdef HAVE__PROC_SELF_STAT
|
||||
stdout_buffer.append( _( L"CPU\t" ) );
|
||||
stdout_buffer.append(_(L"CPU\t"));
|
||||
#endif
|
||||
stdout_buffer.append( _( L"State\tCommand\n" ) );
|
||||
}
|
||||
stdout_buffer.append(_(L"State\tCommand\n"));
|
||||
}
|
||||
|
||||
append_format(stdout_buffer, L"%d\t%d\t", j->job_id, j->pgid );
|
||||
append_format(stdout_buffer, L"%d\t%d\t", j->job_id, j->pgid);
|
||||
|
||||
#ifdef HAVE__PROC_SELF_STAT
|
||||
append_format(stdout_buffer, L"%d%%\t", cpu_use(j) );
|
||||
append_format(stdout_buffer, L"%d%%\t", cpu_use(j));
|
||||
#endif
|
||||
stdout_buffer.append(job_is_stopped(j)?_(L"stopped"):_(L"running"));
|
||||
stdout_buffer.append(job_is_stopped(j)?_(L"stopped"):_(L"running"));
|
||||
stdout_buffer.append(L"\t");
|
||||
stdout_buffer.append(j->command_wcstr());
|
||||
stdout_buffer.append(L"\t");
|
||||
break;
|
||||
}
|
||||
stdout_buffer.append(L"\n");
|
||||
break;
|
||||
}
|
||||
|
||||
case JOBS_PRINT_GROUP:
|
||||
{
|
||||
if( header )
|
||||
{
|
||||
/*
|
||||
Print table header before first job
|
||||
*/
|
||||
stdout_buffer.append( _( L"Group\n" ));
|
||||
}
|
||||
append_format(stdout_buffer, L"%d\n", j->pgid );
|
||||
break;
|
||||
}
|
||||
case JOBS_PRINT_GROUP:
|
||||
{
|
||||
if (header)
|
||||
{
|
||||
/*
|
||||
Print table header before first job
|
||||
*/
|
||||
stdout_buffer.append(_(L"Group\n"));
|
||||
}
|
||||
append_format(stdout_buffer, L"%d\n", j->pgid);
|
||||
break;
|
||||
}
|
||||
|
||||
case JOBS_PRINT_PID:
|
||||
{
|
||||
if( header )
|
||||
{
|
||||
/*
|
||||
Print table header before first job
|
||||
*/
|
||||
stdout_buffer.append( _( L"Procces\n" ));
|
||||
}
|
||||
case JOBS_PRINT_PID:
|
||||
{
|
||||
if (header)
|
||||
{
|
||||
/*
|
||||
Print table header before first job
|
||||
*/
|
||||
stdout_buffer.append(_(L"Procces\n"));
|
||||
}
|
||||
|
||||
for( p=j->first_process; p; p=p->next )
|
||||
{
|
||||
append_format(stdout_buffer, L"%d\n", p->pid );
|
||||
}
|
||||
break;
|
||||
}
|
||||
for (p=j->first_process; p; p=p->next)
|
||||
{
|
||||
append_format(stdout_buffer, L"%d\n", p->pid);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case JOBS_PRINT_COMMAND:
|
||||
{
|
||||
if( header )
|
||||
{
|
||||
/*
|
||||
Print table header before first job
|
||||
*/
|
||||
stdout_buffer.append( _( L"Command\n" ));
|
||||
}
|
||||
case JOBS_PRINT_COMMAND:
|
||||
{
|
||||
if (header)
|
||||
{
|
||||
/*
|
||||
Print table header before first job
|
||||
*/
|
||||
stdout_buffer.append(_(L"Command\n"));
|
||||
}
|
||||
|
||||
for( p=j->first_process; p; p=p->next )
|
||||
{
|
||||
append_format(stdout_buffer, L"%ls\n", p->argv0() );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (p=j->first_process; p; p=p->next)
|
||||
{
|
||||
append_format(stdout_buffer, L"%ls\n", p->argv0());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -158,194 +158,194 @@ static void builtin_jobs_print( const job_t *j, int mode, int header )
|
||||
/**
|
||||
The jobs builtin. Used fopr printing running jobs. Defined in builtin_jobs.c.
|
||||
*/
|
||||
static int builtin_jobs( parser_t &parser, wchar_t **argv )
|
||||
static int builtin_jobs(parser_t &parser, wchar_t **argv)
|
||||
{
|
||||
int argc=0;
|
||||
int found=0;
|
||||
int mode=JOBS_DEFAULT;
|
||||
int print_last = 0;
|
||||
const job_t *j;
|
||||
int argc=0;
|
||||
int found=0;
|
||||
int mode=JOBS_DEFAULT;
|
||||
int print_last = 0;
|
||||
const job_t *j;
|
||||
|
||||
argc = builtin_count_args( argv );
|
||||
woptind=0;
|
||||
argc = builtin_count_args(argv);
|
||||
woptind=0;
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
static const struct woption
|
||||
long_options[] =
|
||||
{
|
||||
{
|
||||
L"pid", no_argument, 0, 'p'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"command", no_argument, 0, 'c'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"group", no_argument, 0, 'g'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"last", no_argument, 0, 'l'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"help", no_argument, 0, 'h'
|
||||
}
|
||||
,
|
||||
{
|
||||
0, 0, 0, 0
|
||||
}
|
||||
}
|
||||
;
|
||||
while (1)
|
||||
{
|
||||
static const struct woption
|
||||
long_options[] =
|
||||
{
|
||||
{
|
||||
L"pid", no_argument, 0, 'p'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"command", no_argument, 0, 'c'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"group", no_argument, 0, 'g'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"last", no_argument, 0, 'l'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"help", no_argument, 0, 'h'
|
||||
}
|
||||
,
|
||||
{
|
||||
0, 0, 0, 0
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
int opt_index = 0;
|
||||
int opt_index = 0;
|
||||
|
||||
int opt = wgetopt_long( argc,
|
||||
argv,
|
||||
L"pclgh",
|
||||
long_options,
|
||||
&opt_index );
|
||||
if( opt == -1 )
|
||||
break;
|
||||
int opt = wgetopt_long(argc,
|
||||
argv,
|
||||
L"pclgh",
|
||||
long_options,
|
||||
&opt_index);
|
||||
if (opt == -1)
|
||||
break;
|
||||
|
||||
switch( opt )
|
||||
{
|
||||
case 0:
|
||||
if(long_options[opt_index].flag != 0)
|
||||
break;
|
||||
switch (opt)
|
||||
{
|
||||
case 0:
|
||||
if (long_options[opt_index].flag != 0)
|
||||
break;
|
||||
append_format(stderr_buffer,
|
||||
BUILTIN_ERR_UNKNOWN,
|
||||
argv[0],
|
||||
long_options[opt_index].name );
|
||||
BUILTIN_ERR_UNKNOWN,
|
||||
argv[0],
|
||||
long_options[opt_index].name);
|
||||
|
||||
builtin_print_help( parser, argv[0], stderr_buffer );
|
||||
builtin_print_help(parser, argv[0], stderr_buffer);
|
||||
|
||||
|
||||
return 1;
|
||||
return 1;
|
||||
|
||||
|
||||
case 'p':
|
||||
mode=JOBS_PRINT_PID;
|
||||
break;
|
||||
case 'p':
|
||||
mode=JOBS_PRINT_PID;
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
mode=JOBS_PRINT_COMMAND;
|
||||
break;
|
||||
case 'c':
|
||||
mode=JOBS_PRINT_COMMAND;
|
||||
break;
|
||||
|
||||
case 'g':
|
||||
mode=JOBS_PRINT_GROUP;
|
||||
break;
|
||||
case 'g':
|
||||
mode=JOBS_PRINT_GROUP;
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
{
|
||||
print_last = 1;
|
||||
break;
|
||||
}
|
||||
case 'l':
|
||||
{
|
||||
print_last = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
case 'h':
|
||||
builtin_print_help( parser, argv[0], stdout_buffer );
|
||||
return 0;
|
||||
case 'h':
|
||||
builtin_print_help(parser, argv[0], stdout_buffer);
|
||||
return 0;
|
||||
|
||||
case '?':
|
||||
builtin_unknown_option( parser, argv[0], argv[woptind-1] );
|
||||
return 1;
|
||||
case '?':
|
||||
builtin_unknown_option(parser, argv[0], argv[woptind-1]);
|
||||
return 1;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Do not babble if not interactive
|
||||
*/
|
||||
if( builtin_out_redirect )
|
||||
{
|
||||
found=1;
|
||||
}
|
||||
/*
|
||||
Do not babble if not interactive
|
||||
*/
|
||||
if (builtin_out_redirect)
|
||||
{
|
||||
found=1;
|
||||
}
|
||||
|
||||
if( print_last )
|
||||
{
|
||||
/*
|
||||
Ignore unconstructed jobs, i.e. ourself.
|
||||
*/
|
||||
if (print_last)
|
||||
{
|
||||
/*
|
||||
Ignore unconstructed jobs, i.e. ourself.
|
||||
*/
|
||||
job_iterator_t jobs;
|
||||
const job_t *j;
|
||||
while ((j = jobs.next()))
|
||||
{
|
||||
|
||||
if( (j->flags & JOB_CONSTRUCTED) && !job_is_completed(j) )
|
||||
{
|
||||
builtin_jobs_print( j, mode, !found );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if( woptind < argc )
|
||||
{
|
||||
int i;
|
||||
if ((j->flags & JOB_CONSTRUCTED) && !job_is_completed(j))
|
||||
{
|
||||
builtin_jobs_print(j, mode, !found);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
found = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (woptind < argc)
|
||||
{
|
||||
int i;
|
||||
|
||||
for( i=woptind; i<argc; i++ )
|
||||
{
|
||||
long pid;
|
||||
wchar_t *end;
|
||||
errno=0;
|
||||
pid=wcstol( argv[i], &end, 10 );
|
||||
if( errno || *end )
|
||||
{
|
||||
append_format(stderr_buffer,
|
||||
_( L"%ls: '%ls' is not a job\n" ),
|
||||
argv[0],
|
||||
argv[i] );
|
||||
return 1;
|
||||
}
|
||||
found = 1;
|
||||
|
||||
j = job_get_from_pid( pid );
|
||||
for (i=woptind; i<argc; i++)
|
||||
{
|
||||
int pid;
|
||||
wchar_t *end;
|
||||
errno=0;
|
||||
pid=fish_wcstoi(argv[i], &end, 10);
|
||||
if (errno || *end)
|
||||
{
|
||||
append_format(stderr_buffer,
|
||||
_(L"%ls: '%ls' is not a job\n"),
|
||||
argv[0],
|
||||
argv[i]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if( j && !job_is_completed( j ) )
|
||||
{
|
||||
builtin_jobs_print( j, mode, !found );
|
||||
}
|
||||
else
|
||||
{
|
||||
append_format(stderr_buffer,
|
||||
_( L"%ls: No suitable job: %d\n" ),
|
||||
argv[0],
|
||||
pid );
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
j = job_get_from_pid(pid);
|
||||
|
||||
if (j && !job_is_completed(j))
|
||||
{
|
||||
builtin_jobs_print(j, mode, !found);
|
||||
}
|
||||
else
|
||||
{
|
||||
append_format(stderr_buffer,
|
||||
_(L"%ls: No suitable job: %d\n"),
|
||||
argv[0],
|
||||
pid);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
job_iterator_t jobs;
|
||||
const job_t *j;
|
||||
while ((j = jobs.next()))
|
||||
{
|
||||
/*
|
||||
Ignore unconstructed jobs, i.e. ourself.
|
||||
*/
|
||||
if( (j->flags & JOB_CONSTRUCTED) && !job_is_completed(j) )
|
||||
{
|
||||
builtin_jobs_print( j, mode, !found );
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
Ignore unconstructed jobs, i.e. ourself.
|
||||
*/
|
||||
if ((j->flags & JOB_CONSTRUCTED) && !job_is_completed(j))
|
||||
{
|
||||
builtin_jobs_print(j, mode, !found);
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( !found )
|
||||
{
|
||||
append_format(stdout_buffer,
|
||||
_( L"%ls: There are no jobs\n" ),
|
||||
argv[0] );
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
append_format(stdout_buffer,
|
||||
_(L"%ls: There are no jobs\n"),
|
||||
argv[0]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
790
builtin_printf.cpp
Normal file
790
builtin_printf.cpp
Normal file
@@ -0,0 +1,790 @@
|
||||
/* printf - format and print data
|
||||
Copyright (C) 1990-2007 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* Usage: printf format [argument...]
|
||||
|
||||
A front end to the printf function that lets it be used from the shell.
|
||||
|
||||
Backslash escapes:
|
||||
|
||||
\" = double quote
|
||||
\\ = backslash
|
||||
\a = alert (bell)
|
||||
\b = backspace
|
||||
\c = produce no further output
|
||||
\e = escape
|
||||
\f = form feed
|
||||
\n = new line
|
||||
\r = carriage return
|
||||
\t = horizontal tab
|
||||
\v = vertical tab
|
||||
\ooo = octal number (ooo is 1 to 3 digits)
|
||||
\xhh = hexadecimal number (hhh is 1 to 2 digits)
|
||||
\uhhhh = 16-bit Unicode character (hhhh is 4 digits)
|
||||
\Uhhhhhhhh = 32-bit Unicode character (hhhhhhhh is 8 digits)
|
||||
|
||||
Additional directive:
|
||||
|
||||
%b = print an argument string, interpreting backslash escapes,
|
||||
except that octal escapes are of the form \0 or \0ooo.
|
||||
|
||||
The `format' argument is re-used as many times as necessary
|
||||
to convert all of the given arguments.
|
||||
|
||||
David MacKenzie <djm@gnu.ai.mit.edu> */
|
||||
|
||||
/* This file has been imported from source code of printf command in GNU Coreutils version 6.9 */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
struct builtin_printf_state_t
|
||||
{
|
||||
/* The status of the operation */
|
||||
int exit_code;
|
||||
|
||||
/* Whether we should stop outputting. This gets set in the case of an error, and also with the \c escape. */
|
||||
bool early_exit;
|
||||
|
||||
builtin_printf_state_t() : exit_code(0), early_exit(false)
|
||||
{
|
||||
}
|
||||
|
||||
void verify_numeric(const wchar_t *s, const wchar_t *end, int errcode);
|
||||
|
||||
void print_direc(const wchar_t *start, size_t length, wchar_t conversion,
|
||||
bool have_field_width, int field_width,
|
||||
bool have_precision, int precision,
|
||||
wchar_t const *argument);
|
||||
|
||||
int print_formatted(const wchar_t *format, int argc, wchar_t **argv);
|
||||
|
||||
void fatal_error(const wchar_t *format, ...);
|
||||
|
||||
long print_esc(const wchar_t *escstart, bool octal_0);
|
||||
void print_esc_string(const wchar_t *str);
|
||||
void print_esc_char(wchar_t c);
|
||||
|
||||
void append_output(wchar_t c);
|
||||
void append_output(const wchar_t *c);
|
||||
void append_format_output(const wchar_t *fmt, ...);
|
||||
};
|
||||
|
||||
static bool is_octal_digit(wchar_t c)
|
||||
{
|
||||
return c != L'\0' && wcschr(L"01234567", c) != NULL;
|
||||
}
|
||||
|
||||
static bool is_hex_digit(wchar_t c)
|
||||
{
|
||||
return c != L'\0' && wcschr(L"0123456789ABCDEFabcdef", c) != NULL;
|
||||
}
|
||||
|
||||
static int hex_to_bin(const wchar_t &c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case L'0':
|
||||
return 0;
|
||||
case L'1':
|
||||
return 1;
|
||||
case L'2':
|
||||
return 2;
|
||||
case L'3':
|
||||
return 3;
|
||||
case L'4':
|
||||
return 4;
|
||||
case L'5':
|
||||
return 5;
|
||||
case L'6':
|
||||
return 6;
|
||||
case L'7':
|
||||
return 7;
|
||||
case L'8':
|
||||
return 8;
|
||||
case L'9':
|
||||
return 9;
|
||||
case L'a':
|
||||
case L'A':
|
||||
return 10;
|
||||
case L'b':
|
||||
case L'B':
|
||||
return 11;
|
||||
case L'c':
|
||||
case L'C':
|
||||
return 12;
|
||||
case L'd':
|
||||
case L'D':
|
||||
return 13;
|
||||
case L'e':
|
||||
case L'E':
|
||||
return 14;
|
||||
case L'f':
|
||||
case L'F':
|
||||
return 15;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static int octal_to_bin(wchar_t c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case L'0':
|
||||
return 0;
|
||||
case L'1':
|
||||
return 1;
|
||||
case L'2':
|
||||
return 2;
|
||||
case L'3':
|
||||
return 3;
|
||||
case L'4':
|
||||
return 4;
|
||||
case L'5':
|
||||
return 5;
|
||||
case L'6':
|
||||
return 6;
|
||||
case L'7':
|
||||
return 7;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* This message appears in N_() here rather than just in _() below because
|
||||
the sole use would have been in a #define. */
|
||||
static wchar_t const *const cfcc_msg =
|
||||
N_(L"warning: %ls: character(s) following character constant have been ignored");
|
||||
|
||||
double C_STRTOD(wchar_t const *nptr, wchar_t **endptr)
|
||||
{
|
||||
double r;
|
||||
|
||||
const wcstring saved_locale = wsetlocale(LC_NUMERIC, NULL);
|
||||
|
||||
if (!saved_locale.empty())
|
||||
{
|
||||
wsetlocale(LC_NUMERIC, L"C");
|
||||
}
|
||||
|
||||
r = wcstod(nptr, endptr);
|
||||
|
||||
if (!saved_locale.empty())
|
||||
{
|
||||
wsetlocale(LC_NUMERIC, saved_locale.c_str());
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static inline unsigned wchar_t to_uwchar_t(wchar_t ch)
|
||||
{
|
||||
return ch;
|
||||
}
|
||||
|
||||
void builtin_printf_state_t::fatal_error(const wchar_t *fmt, ...)
|
||||
{
|
||||
// Don't error twice
|
||||
if (early_exit)
|
||||
return;
|
||||
|
||||
va_list va;
|
||||
va_start(va, fmt);
|
||||
wcstring errstr = vformat_string(fmt, va);
|
||||
va_end(va);
|
||||
stderr_buffer.append(errstr);
|
||||
if (! string_suffixes_string(L"\n", errstr))
|
||||
stderr_buffer.push_back(L'\n');
|
||||
|
||||
this->exit_code = STATUS_BUILTIN_ERROR;
|
||||
this->early_exit = true;
|
||||
}
|
||||
|
||||
void builtin_printf_state_t::append_output(wchar_t c)
|
||||
{
|
||||
// Don't output if we're done
|
||||
if (early_exit)
|
||||
return;
|
||||
|
||||
stdout_buffer.push_back(c);
|
||||
}
|
||||
|
||||
void builtin_printf_state_t::append_output(const wchar_t *c)
|
||||
{
|
||||
// Don't output if we're done
|
||||
if (early_exit)
|
||||
return;
|
||||
|
||||
stdout_buffer.append(c);
|
||||
}
|
||||
|
||||
void builtin_printf_state_t::append_format_output(const wchar_t *fmt, ...)
|
||||
{
|
||||
// Don't output if we're done
|
||||
if (early_exit)
|
||||
return;
|
||||
|
||||
va_list va;
|
||||
va_start(va, fmt);
|
||||
append_formatv(stdout_buffer, fmt, va);
|
||||
va_end(va);
|
||||
}
|
||||
|
||||
|
||||
void builtin_printf_state_t::verify_numeric(const wchar_t *s, const wchar_t *end, int errcode)
|
||||
{
|
||||
if (errcode != 0)
|
||||
{
|
||||
this->fatal_error(L"%ls: %s", s, strerror(errcode));
|
||||
}
|
||||
else if (*end)
|
||||
{
|
||||
if (s == end)
|
||||
this->fatal_error(_(L"%ls: expected a numeric value"), s);
|
||||
else
|
||||
this->fatal_error(_(L"%ls: value not completely converted"), s);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static T raw_string_to_scalar_type(const wchar_t *s, wchar_t ** end);
|
||||
|
||||
// we use wcstoll instead of wcstoimax because FreeBSD 8 has busted wcstoumax and wcstoimax - see #626
|
||||
template<>
|
||||
intmax_t raw_string_to_scalar_type(const wchar_t *s, wchar_t ** end)
|
||||
{
|
||||
return wcstoll(s, end, 0);
|
||||
}
|
||||
|
||||
template<>
|
||||
uintmax_t raw_string_to_scalar_type(const wchar_t *s, wchar_t ** end)
|
||||
{
|
||||
return wcstoull(s, end, 0);
|
||||
}
|
||||
|
||||
template<>
|
||||
long double raw_string_to_scalar_type(const wchar_t *s, wchar_t ** end)
|
||||
{
|
||||
return C_STRTOD(s, end);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static T string_to_scalar_type(const wchar_t *s, builtin_printf_state_t *state)
|
||||
{
|
||||
T val;
|
||||
if (*s == L'\"' || *s == L'\'')
|
||||
{
|
||||
unsigned wchar_t ch = *++s;
|
||||
val = ch;
|
||||
}
|
||||
else
|
||||
{
|
||||
wchar_t *end = NULL;
|
||||
errno = 0;
|
||||
val = raw_string_to_scalar_type<T>(s, &end);
|
||||
state->verify_numeric(s, end, errno);
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
/* Output a single-character \ escape. */
|
||||
|
||||
void builtin_printf_state_t::print_esc_char(wchar_t c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case L'a': /* Alert. */
|
||||
this->append_output(L'\a');
|
||||
break;
|
||||
case L'b': /* Backspace. */
|
||||
this->append_output(L'\b');
|
||||
break;
|
||||
case L'c': /* Cancel the rest of the output. */
|
||||
this->early_exit = true;
|
||||
break;
|
||||
case L'e': /* Escape */
|
||||
this->append_output(L'\x1B');
|
||||
break;
|
||||
case L'f': /* Form feed. */
|
||||
this->append_output(L'\f');
|
||||
break;
|
||||
case L'n': /* New line. */
|
||||
this->append_output(L'\n');
|
||||
break;
|
||||
case L'r': /* Carriage return. */
|
||||
this->append_output(L'\r');
|
||||
break;
|
||||
case L't': /* Horizontal tab. */
|
||||
this->append_output(L'\t');
|
||||
break;
|
||||
case L'v': /* Vertical tab. */
|
||||
this->append_output(L'\v');
|
||||
break;
|
||||
default:
|
||||
this->append_output(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Print a \ escape sequence starting at ESCSTART.
|
||||
Return the number of characters in the escape sequence
|
||||
besides the backslash.
|
||||
If OCTAL_0 is nonzero, octal escapes are of the form \0ooo, where o
|
||||
is an octal digit; otherwise they are of the form \ooo. */
|
||||
long builtin_printf_state_t::print_esc(const wchar_t *escstart, bool octal_0)
|
||||
{
|
||||
const wchar_t *p = escstart + 1;
|
||||
int esc_value = 0; /* Value of \nnn escape. */
|
||||
int esc_length; /* Length of \nnn escape. */
|
||||
|
||||
if (*p == L'x')
|
||||
{
|
||||
/* A hexadecimal \xhh escape sequence must have 1 or 2 hex. digits. */
|
||||
for (esc_length = 0, ++p; esc_length < 2 && is_hex_digit(*p); ++esc_length, ++p)
|
||||
esc_value = esc_value * 16 + hex_to_bin(*p);
|
||||
if (esc_length == 0)
|
||||
this->fatal_error(_(L"missing hexadecimal number in escape"));
|
||||
this->append_output(esc_value);
|
||||
}
|
||||
else if (is_octal_digit(*p))
|
||||
{
|
||||
/* Parse \0ooo (if octal_0 && *p == L'0') or \ooo (otherwise).
|
||||
Allow \ooo if octal_0 && *p != L'0'; this is an undocumented
|
||||
extension to POSIX that is compatible with Bash 2.05b. */
|
||||
for (esc_length = 0, p += octal_0 && *p == L'0'; esc_length < 3 && is_octal_digit(*p); ++esc_length, ++p)
|
||||
esc_value = esc_value * 8 + octal_to_bin(*p);
|
||||
this->append_output(esc_value);
|
||||
}
|
||||
else if (*p && wcschr(L"\"\\abcefnrtv", *p))
|
||||
{
|
||||
print_esc_char(*p++);
|
||||
}
|
||||
else if (*p == L'u' || *p == L'U')
|
||||
{
|
||||
wchar_t esc_char = *p;
|
||||
p++;
|
||||
uint32_t uni_value = 0;
|
||||
for (size_t esc_length = 0; esc_length < (esc_char == L'u' ? 4 : 8); esc_length++)
|
||||
{
|
||||
if (! is_hex_digit(*p))
|
||||
{
|
||||
/* Escape sequence must be done. Complain if we didn't get anything */
|
||||
if (esc_length == 0)
|
||||
{
|
||||
this->fatal_error(_(L"Missing hexadecimal number in Unicode escape"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
uni_value = uni_value * 16 + hex_to_bin(*p);
|
||||
p++;
|
||||
}
|
||||
|
||||
/* PCA GNU printf respects the limitations described in ISO N717, about which universal characters "shall not" be specified. I believe this limitation is for the benefit of compilers; I see no reason to impose it in builtin_printf.
|
||||
|
||||
If __STDC_ISO_10646__ is defined, then it means wchar_t can and does hold Unicode code points, so just use that. If not defined, use the %lc printf conversion; this probably won't do anything good if your wide character set is not Unicode, but such platforms are exceedingly rare.
|
||||
*/
|
||||
if (uni_value > 0x10FFFF)
|
||||
{
|
||||
this->fatal_error(_(L"Unicode character out of range: \\%c%0*x"), esc_char, (esc_char == L'u' ? 4 : 8), uni_value);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(__STDC_ISO_10646__)
|
||||
this->append_output(uni_value);
|
||||
#else
|
||||
this->append_format_output(L"%lc", uni_value);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this->append_output(L'\\');
|
||||
if (*p)
|
||||
{
|
||||
this->append_output(*p);
|
||||
p++;
|
||||
}
|
||||
}
|
||||
return p - escstart - 1;
|
||||
}
|
||||
|
||||
/* Print string STR, evaluating \ escapes. */
|
||||
|
||||
void builtin_printf_state_t::print_esc_string(const wchar_t *str)
|
||||
{
|
||||
for (; *str; str++)
|
||||
if (*str == L'\\')
|
||||
str += print_esc(str, true);
|
||||
else
|
||||
this->append_output(*str);
|
||||
}
|
||||
|
||||
/* Evaluate a printf conversion specification. START is the start of
|
||||
the directive, LENGTH is its length, and CONVERSION specifies the
|
||||
type of conversion. LENGTH does not include any length modifier or
|
||||
the conversion specifier itself. FIELD_WIDTH and PRECISION are the
|
||||
field width and precision for '*' values, if HAVE_FIELD_WIDTH and
|
||||
HAVE_PRECISION are true, respectively. ARGUMENT is the argument to
|
||||
be formatted. */
|
||||
|
||||
void builtin_printf_state_t::print_direc(const wchar_t *start, size_t length, wchar_t conversion,
|
||||
bool have_field_width, int field_width,
|
||||
bool have_precision, int precision,
|
||||
wchar_t const *argument)
|
||||
{
|
||||
// Start with everything except the conversion specifier
|
||||
wcstring fmt(start, length);
|
||||
|
||||
/* Create a copy of the % directive, with an intmax_t-wide width modifier substituted for any existing integer length modifier. */
|
||||
switch (conversion)
|
||||
{
|
||||
case L'd':
|
||||
case L'i':
|
||||
case L'u':
|
||||
fmt.append(L"ll");
|
||||
break;
|
||||
case L'a':
|
||||
case L'e':
|
||||
case L'f':
|
||||
case L'g':
|
||||
case L'A':
|
||||
case L'E':
|
||||
case L'F':
|
||||
case L'G':
|
||||
fmt.append(L"L");
|
||||
break;
|
||||
case L's':
|
||||
fmt.append(L"l");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Append the conversion itself
|
||||
fmt.push_back(conversion);
|
||||
|
||||
switch (conversion)
|
||||
{
|
||||
case L'd':
|
||||
case L'i':
|
||||
{
|
||||
intmax_t arg = string_to_scalar_type<intmax_t>(argument, this);
|
||||
if (! have_field_width)
|
||||
{
|
||||
if (! have_precision)
|
||||
this->append_format_output(fmt.c_str(), arg);
|
||||
else
|
||||
this->append_format_output(fmt.c_str(), precision, arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! have_precision)
|
||||
this->append_format_output(fmt.c_str(), field_width, arg);
|
||||
else
|
||||
this->append_format_output(fmt.c_str(), field_width, precision, arg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case L'o':
|
||||
case L'u':
|
||||
case L'x':
|
||||
case L'X':
|
||||
{
|
||||
uintmax_t arg = string_to_scalar_type<uintmax_t>(argument, this);
|
||||
if (!have_field_width)
|
||||
{
|
||||
if (!have_precision)
|
||||
this->append_format_output(fmt.c_str(), arg);
|
||||
else
|
||||
this->append_format_output(fmt.c_str(), precision, arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!have_precision)
|
||||
this->append_format_output(fmt.c_str(), field_width, arg);
|
||||
else
|
||||
this->append_format_output(fmt.c_str(), field_width, precision, arg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case L'a':
|
||||
case L'A':
|
||||
case L'e':
|
||||
case L'E':
|
||||
case L'f':
|
||||
case L'F':
|
||||
case L'g':
|
||||
case L'G':
|
||||
{
|
||||
long double arg = string_to_scalar_type<long double>(argument, this);
|
||||
if (!have_field_width)
|
||||
{
|
||||
if (!have_precision)
|
||||
this->append_format_output(fmt.c_str(), arg);
|
||||
else
|
||||
this->append_format_output(fmt.c_str(), precision, arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!have_precision)
|
||||
this->append_format_output(fmt.c_str(), field_width, arg);
|
||||
else
|
||||
this->append_format_output(fmt.c_str(), field_width, precision, arg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case L'c':
|
||||
if (!have_field_width)
|
||||
this->append_format_output(fmt.c_str(), *argument);
|
||||
else
|
||||
this->append_format_output(fmt.c_str(), field_width, *argument);
|
||||
break;
|
||||
case L's':
|
||||
if (!have_field_width)
|
||||
{
|
||||
if (!have_precision)
|
||||
{
|
||||
this->append_format_output(fmt.c_str(), argument);
|
||||
}
|
||||
else
|
||||
this->append_format_output(fmt.c_str(), precision, argument);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!have_precision)
|
||||
this->append_format_output(fmt.c_str(), field_width, argument);
|
||||
else
|
||||
this->append_format_output(fmt.c_str(), field_width, precision, argument);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* For each character in str, set the corresponding boolean in the array to the given flag */
|
||||
static inline void modify_allowed_format_specifiers(bool ok[UCHAR_MAX + 1], const char *str, bool flag)
|
||||
{
|
||||
for (const char *c = str; *c != '\0'; c++)
|
||||
{
|
||||
unsigned char idx = static_cast<unsigned char>(*c);
|
||||
ok[idx] = flag;
|
||||
}
|
||||
}
|
||||
|
||||
/* Print the text in FORMAT, using ARGV (with ARGC elements) for
|
||||
arguments to any `%' directives.
|
||||
Return the number of elements of ARGV used. */
|
||||
|
||||
int builtin_printf_state_t::print_formatted(const wchar_t *format, int argc, wchar_t **argv)
|
||||
{
|
||||
int save_argc = argc; /* Preserve original value. */
|
||||
const wchar_t *f; /* Pointer into `format'. */
|
||||
const wchar_t *direc_start; /* Start of % directive. */
|
||||
size_t direc_length; /* Length of % directive. */
|
||||
bool have_field_width; /* True if FIELD_WIDTH is valid. */
|
||||
int field_width = 0; /* Arg to first '*'. */
|
||||
bool have_precision; /* True if PRECISION is valid. */
|
||||
int precision = 0; /* Arg to second '*'. */
|
||||
bool ok[UCHAR_MAX + 1] = { }; /* ok['x'] is true if %x is allowed. */
|
||||
|
||||
for (f = format; *f != L'\0'; ++f)
|
||||
{
|
||||
switch (*f)
|
||||
{
|
||||
case L'%':
|
||||
direc_start = f++;
|
||||
direc_length = 1;
|
||||
have_field_width = have_precision = false;
|
||||
if (*f == L'%')
|
||||
{
|
||||
this->append_output(L'%');
|
||||
break;
|
||||
}
|
||||
if (*f == L'b')
|
||||
{
|
||||
/* FIXME: Field width and precision are not supported
|
||||
for %b, even though POSIX requires it. */
|
||||
if (argc > 0)
|
||||
{
|
||||
print_esc_string(*argv);
|
||||
++argv;
|
||||
--argc;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
modify_allowed_format_specifiers(ok, "aAcdeEfFgGiosuxX", true);
|
||||
|
||||
for (;; f++, direc_length++)
|
||||
{
|
||||
switch (*f)
|
||||
{
|
||||
case L'I':
|
||||
case L'\'':
|
||||
modify_allowed_format_specifiers(ok, "aAceEosxX", false);
|
||||
break;
|
||||
case '-':
|
||||
case '+':
|
||||
case ' ':
|
||||
break;
|
||||
case L'#':
|
||||
modify_allowed_format_specifiers(ok, "cdisu", false);
|
||||
break;
|
||||
case '0':
|
||||
modify_allowed_format_specifiers(ok, "cs", false);
|
||||
break;
|
||||
default:
|
||||
goto no_more_flag_characters;
|
||||
}
|
||||
}
|
||||
no_more_flag_characters:
|
||||
;
|
||||
|
||||
if (*f == L'*')
|
||||
{
|
||||
++f;
|
||||
++direc_length;
|
||||
if (argc > 0)
|
||||
{
|
||||
intmax_t width = string_to_scalar_type<intmax_t>(*argv, this);
|
||||
if (INT_MIN <= width && width <= INT_MAX)
|
||||
field_width = static_cast<int>(width);
|
||||
else
|
||||
this->fatal_error(_(L"invalid field width: %ls"), *argv);
|
||||
++argv;
|
||||
--argc;
|
||||
}
|
||||
else
|
||||
{
|
||||
field_width = 0;
|
||||
}
|
||||
have_field_width = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (iswdigit(*f))
|
||||
{
|
||||
++f;
|
||||
++direc_length;
|
||||
}
|
||||
}
|
||||
if (*f == L'.')
|
||||
{
|
||||
++f;
|
||||
++direc_length;
|
||||
modify_allowed_format_specifiers(ok, "c", false);
|
||||
if (*f == L'*')
|
||||
{
|
||||
++f;
|
||||
++direc_length;
|
||||
if (argc > 0)
|
||||
{
|
||||
intmax_t prec = string_to_scalar_type<intmax_t>(*argv, this);
|
||||
if (prec < 0)
|
||||
{
|
||||
/* A negative precision is taken as if the
|
||||
precision were omitted, so -1 is safe
|
||||
here even if prec < INT_MIN. */
|
||||
precision = -1;
|
||||
}
|
||||
else if (INT_MAX < prec)
|
||||
this->fatal_error(_(L"invalid precision: %ls"), *argv);
|
||||
else
|
||||
{
|
||||
precision = static_cast<int>(prec);
|
||||
}
|
||||
++argv;
|
||||
--argc;
|
||||
}
|
||||
else
|
||||
{
|
||||
precision = 0;
|
||||
}
|
||||
have_precision = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (iswdigit(*f))
|
||||
{
|
||||
++f;
|
||||
++direc_length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (*f == L'l' || *f == L'L' || *f == L'h' || *f == L'j' || *f == L't' || *f == L'z')
|
||||
++f;
|
||||
|
||||
{
|
||||
unsigned wchar_t conversion = *f;
|
||||
if (! ok[conversion])
|
||||
{
|
||||
this->fatal_error(_(L"%.*ls: invalid conversion specification"), (int)(f + 1 - direc_start), direc_start);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
print_direc(direc_start, direc_length, *f,
|
||||
have_field_width, field_width,
|
||||
have_precision, precision,
|
||||
(argc <= 0 ? L"" : (argc--, *argv++)));
|
||||
break;
|
||||
|
||||
case L'\\':
|
||||
f += print_esc(f, false);
|
||||
break;
|
||||
|
||||
default:
|
||||
this->append_output(*f);
|
||||
}
|
||||
}
|
||||
return save_argc - argc;
|
||||
}
|
||||
|
||||
static int builtin_printf(parser_t &parser, wchar_t **argv)
|
||||
{
|
||||
builtin_printf_state_t state;
|
||||
|
||||
wchar_t *format;
|
||||
int args_used;
|
||||
int argc = builtin_count_args(argv);
|
||||
|
||||
if (argc <= 1)
|
||||
{
|
||||
state.fatal_error(_(L"printf: not enough arguments"));
|
||||
return STATUS_BUILTIN_ERROR;
|
||||
}
|
||||
|
||||
format = argv[1];
|
||||
argc -= 2;
|
||||
argv += 2;
|
||||
|
||||
do
|
||||
{
|
||||
args_used = state.print_formatted(format, argc, argv);
|
||||
argc -= args_used;
|
||||
argv += args_used;
|
||||
}
|
||||
while (args_used > 0 && argc > 0 && ! state.early_exit);
|
||||
return state.exit_code;
|
||||
}
|
||||
1287
builtin_set.cpp
1287
builtin_set.cpp
File diff suppressed because it is too large
Load Diff
243
builtin_set_color.cpp
Normal file
243
builtin_set_color.cpp
Normal file
@@ -0,0 +1,243 @@
|
||||
/** \file builtin_set_color.cpp Functions defining the set_color builtin
|
||||
|
||||
Functions used for implementing the set_color builtin.
|
||||
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include "builtin.h"
|
||||
#include "color.h"
|
||||
#include "output.h"
|
||||
|
||||
#if HAVE_NCURSES_H
|
||||
#include <ncurses.h>
|
||||
#else
|
||||
#include <curses.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_TERM_H
|
||||
#include <term.h>
|
||||
#elif HAVE_NCURSES_TERM_H
|
||||
#include <ncurses/term.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* We know about these buffers */
|
||||
extern wcstring stdout_buffer, stderr_buffer;
|
||||
|
||||
/**
|
||||
Error message for invalid path operations
|
||||
*/
|
||||
#define BUILTIN_SET_PATH_ERROR L"%ls: Warning: path component %ls may not be valid in %ls.\n"
|
||||
|
||||
/**
|
||||
Hint for invalid path operation with a colon
|
||||
*/
|
||||
#define BUILTIN_SET_PATH_HINT L"%ls: Did you mean 'set %ls $%ls %ls'?\n"
|
||||
|
||||
/**
|
||||
Error for mismatch between index count and elements
|
||||
*/
|
||||
#define BUILTIN_SET_ARG_COUNT L"%ls: The number of variable indexes does not match the number of values\n"
|
||||
|
||||
static void print_colors(void)
|
||||
{
|
||||
const wcstring_list_t result = rgb_color_t::named_color_names();
|
||||
size_t i;
|
||||
for (i=0; i < result.size(); i++)
|
||||
{
|
||||
stdout_buffer.append(result.at(i));
|
||||
stdout_buffer.push_back(L'\n');
|
||||
}
|
||||
}
|
||||
|
||||
/* function we set as the output writer */
|
||||
static std::string builtin_set_color_output;
|
||||
static int set_color_builtin_outputter(char c)
|
||||
{
|
||||
ASSERT_IS_MAIN_THREAD();
|
||||
builtin_set_color_output.push_back(c);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
set_color builtin
|
||||
*/
|
||||
static int builtin_set_color(parser_t &parser, wchar_t **argv)
|
||||
{
|
||||
/** Variables used for parsing the argument list */
|
||||
const struct woption long_options[] =
|
||||
{
|
||||
{ L"background", required_argument, 0, 'b'},
|
||||
{ L"help", no_argument, 0, 'h' },
|
||||
{ L"bold", no_argument, 0, 'o' },
|
||||
{ L"underline", no_argument, 0, 'u' },
|
||||
{ L"version", no_argument, 0, 'v' },
|
||||
{ L"print-colors", no_argument, 0, 'c' },
|
||||
{ 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
const wchar_t *short_options = L"b:hvocu";
|
||||
|
||||
int argc = builtin_count_args(argv);
|
||||
|
||||
const wchar_t *bgcolor = NULL;
|
||||
bool bold = false, underline=false;
|
||||
int errret;
|
||||
|
||||
/* Parse options to obtain the requested operation and the modifiers */
|
||||
woptind = 0;
|
||||
while (1)
|
||||
{
|
||||
int c = wgetopt_long(argc, argv, short_options, long_options, 0);
|
||||
|
||||
if (c == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
bgcolor = woptarg;
|
||||
break;
|
||||
|
||||
case 'h':
|
||||
builtin_print_help(parser, argv[0], stdout_buffer);
|
||||
return STATUS_BUILTIN_OK;
|
||||
|
||||
case 'o':
|
||||
bold = true;
|
||||
break;
|
||||
|
||||
case 'u':
|
||||
underline = true;
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
print_colors();
|
||||
return STATUS_BUILTIN_OK;
|
||||
|
||||
case '?':
|
||||
return STATUS_BUILTIN_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
/* Remaining argument is foreground color */
|
||||
const wchar_t *fgcolor = NULL;
|
||||
if (woptind < argc)
|
||||
{
|
||||
if (woptind + 1 == argc)
|
||||
{
|
||||
fgcolor = argv[woptind];
|
||||
}
|
||||
else
|
||||
{
|
||||
append_format(stderr_buffer,
|
||||
_(L"%ls: Too many arguments\n"),
|
||||
argv[0]);
|
||||
return STATUS_BUILTIN_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (fgcolor == NULL && bgcolor == NULL && !bold && !underline)
|
||||
{
|
||||
append_format(stderr_buffer,
|
||||
_(L"%ls: Expected an argument\n"),
|
||||
argv[0]);
|
||||
return STATUS_BUILTIN_ERROR;
|
||||
}
|
||||
|
||||
const rgb_color_t fg = rgb_color_t(fgcolor ? fgcolor : L"");
|
||||
if (fgcolor && (fg.is_none() || fg.is_ignore()))
|
||||
{
|
||||
append_format(stderr_buffer, _(L"%ls: Unknown color '%ls'\n"), argv[0], fgcolor);
|
||||
return STATUS_BUILTIN_ERROR;
|
||||
}
|
||||
|
||||
const rgb_color_t bg = rgb_color_t(bgcolor ? bgcolor : L"");
|
||||
if (bgcolor && (bg.is_none() || bg.is_ignore()))
|
||||
{
|
||||
append_format(stderr_buffer, _(L"%ls: Unknown color '%ls'\n"), argv[0], bgcolor);
|
||||
return STATUS_BUILTIN_ERROR;
|
||||
}
|
||||
|
||||
/* Make sure that the term exists */
|
||||
if (cur_term == NULL && setupterm(0, STDOUT_FILENO, &errret) == ERR)
|
||||
{
|
||||
append_format(stderr_buffer, _(L"%ls: Could not set up terminal\n"), argv[0]);
|
||||
return STATUS_BUILTIN_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
Test if we have at least basic support for setting fonts, colors
|
||||
and related bits - otherwise just give up...
|
||||
*/
|
||||
if (! exit_attribute_mode)
|
||||
{
|
||||
return STATUS_BUILTIN_ERROR;
|
||||
}
|
||||
|
||||
|
||||
/* Save old output function so we can restore it */
|
||||
int (* const saved_writer_func)(char) = output_get_writer();
|
||||
|
||||
/* Set our output function, which writes to a std::string */
|
||||
builtin_set_color_output.clear();
|
||||
output_set_writer(set_color_builtin_outputter);
|
||||
|
||||
if (bold)
|
||||
{
|
||||
if (enter_bold_mode)
|
||||
writembs(tparm(enter_bold_mode));
|
||||
}
|
||||
|
||||
if (underline)
|
||||
{
|
||||
if (enter_underline_mode)
|
||||
writembs(enter_underline_mode);
|
||||
}
|
||||
|
||||
if (bgcolor != NULL)
|
||||
{
|
||||
if (bg.is_normal())
|
||||
{
|
||||
write_background_color(0);
|
||||
writembs(tparm(exit_attribute_mode));
|
||||
}
|
||||
}
|
||||
|
||||
if (fgcolor != NULL)
|
||||
{
|
||||
if (fg.is_normal() || fg.is_reset())
|
||||
{
|
||||
write_foreground_color(0);
|
||||
writembs(tparm(exit_attribute_mode));
|
||||
}
|
||||
else
|
||||
{
|
||||
write_foreground_color(index_for_color(fg));
|
||||
}
|
||||
}
|
||||
|
||||
if (bgcolor != NULL)
|
||||
{
|
||||
if (! bg.is_normal() && ! bg.is_reset())
|
||||
{
|
||||
write_background_color(index_for_color(bg));
|
||||
}
|
||||
}
|
||||
|
||||
/* Restore saved writer function */
|
||||
output_set_writer(saved_writer_func);
|
||||
|
||||
/* Output the collected string */
|
||||
std::string local_output;
|
||||
std::swap(builtin_set_color_output, local_output);
|
||||
stdout_buffer.append(str2wcstring(local_output));
|
||||
|
||||
return STATUS_BUILTIN_OK;
|
||||
}
|
||||
1557
builtin_test.cpp
1557
builtin_test.cpp
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
/** \file builtin_ulimit.c Functions defining the ulimit builtin
|
||||
|
||||
Functions used for implementing the ulimit builtin.
|
||||
Functions used for implementing the ulimit builtin.
|
||||
|
||||
*/
|
||||
#include "config.h"
|
||||
@@ -27,99 +27,99 @@ Functions used for implementing the ulimit builtin.
|
||||
*/
|
||||
struct resource_t
|
||||
{
|
||||
/**
|
||||
Resource id
|
||||
*/
|
||||
int resource;
|
||||
/**
|
||||
Description of resource
|
||||
*/
|
||||
const wchar_t *desc;
|
||||
/**
|
||||
Switch used on commandline to specify resource
|
||||
*/
|
||||
wchar_t switch_char;
|
||||
/**
|
||||
The implicit multiplier used when setting getting values
|
||||
*/
|
||||
int multiplier;
|
||||
/**
|
||||
Resource id
|
||||
*/
|
||||
int resource;
|
||||
/**
|
||||
Description of resource
|
||||
*/
|
||||
const wchar_t *desc;
|
||||
/**
|
||||
Switch used on commandline to specify resource
|
||||
*/
|
||||
wchar_t switch_char;
|
||||
/**
|
||||
The implicit multiplier used when setting getting values
|
||||
*/
|
||||
int multiplier;
|
||||
}
|
||||
;
|
||||
;
|
||||
|
||||
/**
|
||||
Array of resource_t structs, describing all known resource types.
|
||||
*/
|
||||
static const struct resource_t resource_arr[] =
|
||||
{
|
||||
{
|
||||
RLIMIT_CORE, L"Maximum size of core files created", L'c', 1024
|
||||
}
|
||||
,
|
||||
{
|
||||
RLIMIT_DATA, L"Maximum size of a process’s data segment", L'd', 1024
|
||||
}
|
||||
,
|
||||
{
|
||||
RLIMIT_FSIZE, L"Maximum size of files created by the shell", L'f', 1024
|
||||
}
|
||||
,
|
||||
{
|
||||
RLIMIT_CORE, L"Maximum size of core files created", L'c', 1024
|
||||
}
|
||||
,
|
||||
{
|
||||
RLIMIT_DATA, L"Maximum size of a process’s data segment", L'd', 1024
|
||||
}
|
||||
,
|
||||
{
|
||||
RLIMIT_FSIZE, L"Maximum size of files created by the shell", L'f', 1024
|
||||
}
|
||||
,
|
||||
#ifdef RLIMIT_MEMLOCK
|
||||
{
|
||||
RLIMIT_MEMLOCK, L"Maximum size that may be locked into memory", L'l', 1024
|
||||
}
|
||||
,
|
||||
{
|
||||
RLIMIT_MEMLOCK, L"Maximum size that may be locked into memory", L'l', 1024
|
||||
}
|
||||
,
|
||||
#endif
|
||||
#ifdef RLIMIT_RSS
|
||||
{
|
||||
RLIMIT_RSS, L"Maximum resident set size", L'm', 1024
|
||||
}
|
||||
,
|
||||
{
|
||||
RLIMIT_RSS, L"Maximum resident set size", L'm', 1024
|
||||
}
|
||||
,
|
||||
#endif
|
||||
{
|
||||
RLIMIT_NOFILE, L"Maximum number of open file descriptors", L'n', 1
|
||||
}
|
||||
,
|
||||
{
|
||||
RLIMIT_STACK, L"Maximum stack size", L's', 1024
|
||||
}
|
||||
,
|
||||
{
|
||||
RLIMIT_CPU, L"Maximum amount of cpu time in seconds", L't', 1
|
||||
}
|
||||
,
|
||||
{
|
||||
RLIMIT_NOFILE, L"Maximum number of open file descriptors", L'n', 1
|
||||
}
|
||||
,
|
||||
{
|
||||
RLIMIT_STACK, L"Maximum stack size", L's', 1024
|
||||
}
|
||||
,
|
||||
{
|
||||
RLIMIT_CPU, L"Maximum amount of cpu time in seconds", L't', 1
|
||||
}
|
||||
,
|
||||
#ifdef RLIMIT_NPROC
|
||||
{
|
||||
RLIMIT_NPROC, L"Maximum number of processes available to a single user", L'u', 1
|
||||
}
|
||||
,
|
||||
{
|
||||
RLIMIT_NPROC, L"Maximum number of processes available to a single user", L'u', 1
|
||||
}
|
||||
,
|
||||
#endif
|
||||
#ifdef RLIMIT_AS
|
||||
{
|
||||
RLIMIT_AS, L"Maximum amount of virtual memory available to the shell", L'v', 1024
|
||||
}
|
||||
,
|
||||
{
|
||||
RLIMIT_AS, L"Maximum amount of virtual memory available to the shell", L'v', 1024
|
||||
}
|
||||
,
|
||||
#endif
|
||||
{
|
||||
0, 0, 0, 0
|
||||
}
|
||||
{
|
||||
0, 0, 0, 0
|
||||
}
|
||||
}
|
||||
;
|
||||
;
|
||||
|
||||
/**
|
||||
Get the implicit multiplication factor for the specified resource limit
|
||||
*/
|
||||
static int get_multiplier( int what )
|
||||
static int get_multiplier(int what)
|
||||
{
|
||||
int i;
|
||||
|
||||
for( i=0; resource_arr[i].desc; i++ )
|
||||
{
|
||||
if( resource_arr[i].resource == what )
|
||||
{
|
||||
return resource_arr[i].multiplier;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
int i;
|
||||
|
||||
for (i=0; resource_arr[i].desc; i++)
|
||||
{
|
||||
if (resource_arr[i].resource == what)
|
||||
{
|
||||
return resource_arr[i].multiplier;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,85 +127,85 @@ static int get_multiplier( int what )
|
||||
does _not_ multiply the limit value by the multiplier constant used
|
||||
by the commandline ulimit.
|
||||
*/
|
||||
static rlim_t get( int resource, int hard )
|
||||
static rlim_t get(int resource, int hard)
|
||||
{
|
||||
struct rlimit ls;
|
||||
|
||||
getrlimit( resource, &ls );
|
||||
|
||||
return hard ? ls.rlim_max:ls.rlim_cur;
|
||||
struct rlimit ls;
|
||||
|
||||
getrlimit(resource, &ls);
|
||||
|
||||
return hard ? ls.rlim_max:ls.rlim_cur;
|
||||
}
|
||||
|
||||
/**
|
||||
Print the value of the specified resource limit
|
||||
*/
|
||||
static void print( int resource, int hard )
|
||||
static void print(int resource, int hard)
|
||||
{
|
||||
rlim_t l = get( resource, hard );
|
||||
rlim_t l = get(resource, hard);
|
||||
|
||||
if (l == RLIM_INFINITY)
|
||||
stdout_buffer.append(L"unlimited\n");
|
||||
else
|
||||
append_format(stdout_buffer, L"%d\n", l / get_multiplier(resource));
|
||||
|
||||
if( l == RLIM_INFINITY )
|
||||
stdout_buffer.append( L"unlimited\n" );
|
||||
else
|
||||
append_format(stdout_buffer, L"%d\n", l / get_multiplier( resource ) );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
Print values of all resource limits
|
||||
*/
|
||||
static void print_all( int hard )
|
||||
static void print_all(int hard)
|
||||
{
|
||||
int i;
|
||||
int w=0;
|
||||
|
||||
for( i=0; resource_arr[i].desc; i++ )
|
||||
{
|
||||
w=maxi( w, my_wcswidth(resource_arr[i].desc));
|
||||
}
|
||||
|
||||
for( i=0; resource_arr[i].desc; i++ )
|
||||
{
|
||||
struct rlimit ls;
|
||||
rlim_t l;
|
||||
getrlimit( resource_arr[i].resource, &ls );
|
||||
l = hard ? ls.rlim_max:ls.rlim_cur;
|
||||
int i;
|
||||
int w=0;
|
||||
|
||||
for (i=0; resource_arr[i].desc; i++)
|
||||
{
|
||||
w=maxi(w, my_wcswidth(resource_arr[i].desc));
|
||||
}
|
||||
|
||||
for (i=0; resource_arr[i].desc; i++)
|
||||
{
|
||||
struct rlimit ls;
|
||||
rlim_t l;
|
||||
getrlimit(resource_arr[i].resource, &ls);
|
||||
l = hard ? ls.rlim_max:ls.rlim_cur;
|
||||
|
||||
const wchar_t *unit = ((resource_arr[i].resource==RLIMIT_CPU)?L"(seconds, ":(get_multiplier(resource_arr[i].resource)==1?L"(":L"(kB, "));
|
||||
|
||||
append_format(stdout_buffer,
|
||||
L"%-*ls %10ls-%lc) ",
|
||||
w,
|
||||
resource_arr[i].desc,
|
||||
unit,
|
||||
resource_arr[i].switch_char);
|
||||
|
||||
if (l == RLIM_INFINITY)
|
||||
{
|
||||
stdout_buffer.append(L"unlimited\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
append_format(stdout_buffer, L"%d\n", l/get_multiplier(resource_arr[i].resource));
|
||||
}
|
||||
}
|
||||
|
||||
const wchar_t *unit = ((resource_arr[i].resource==RLIMIT_CPU)?L"(seconds, ":(get_multiplier(resource_arr[i].resource)==1?L"(":L"(kB, "));
|
||||
|
||||
append_format(stdout_buffer,
|
||||
L"%-*ls %10ls-%lc) ",
|
||||
w,
|
||||
resource_arr[i].desc,
|
||||
unit,
|
||||
resource_arr[i].switch_char);
|
||||
|
||||
if( l == RLIM_INFINITY )
|
||||
{
|
||||
stdout_buffer.append( L"unlimited\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
append_format(stdout_buffer, L"%d\n", l/get_multiplier(resource_arr[i].resource) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the description for the specified resource limit
|
||||
*/
|
||||
static const wchar_t *get_desc( int what )
|
||||
static const wchar_t *get_desc(int what)
|
||||
{
|
||||
int i;
|
||||
|
||||
for( i=0; resource_arr[i].desc; i++ )
|
||||
{
|
||||
if( resource_arr[i].resource == what )
|
||||
{
|
||||
return resource_arr[i].desc;
|
||||
}
|
||||
}
|
||||
return L"Not a resource";
|
||||
int i;
|
||||
|
||||
for (i=0; resource_arr[i].desc; i++)
|
||||
{
|
||||
if (resource_arr[i].resource == what)
|
||||
{
|
||||
return resource_arr[i].desc;
|
||||
}
|
||||
}
|
||||
return L"Not a resource";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -213,300 +213,300 @@ static const wchar_t *get_desc( int what )
|
||||
does _not_ multiply the limit value by the multiplier constant used
|
||||
by the commandline ulimit.
|
||||
*/
|
||||
static int set( int resource, int hard, int soft, rlim_t value )
|
||||
static int set(int resource, int hard, int soft, rlim_t value)
|
||||
{
|
||||
struct rlimit ls;
|
||||
getrlimit( resource, &ls );
|
||||
|
||||
if( hard )
|
||||
{
|
||||
ls.rlim_max = value;
|
||||
}
|
||||
|
||||
if( soft )
|
||||
{
|
||||
ls.rlim_cur = value;
|
||||
|
||||
/*
|
||||
Do not attempt to set the soft limit higher than the hard limit
|
||||
*/
|
||||
if( ( value == RLIM_INFINITY && ls.rlim_max != RLIM_INFINITY ) ||
|
||||
( value != RLIM_INFINITY && ls.rlim_max != RLIM_INFINITY && value > ls.rlim_max))
|
||||
{
|
||||
ls.rlim_cur = ls.rlim_max;
|
||||
}
|
||||
}
|
||||
|
||||
if( setrlimit( resource, &ls ) )
|
||||
{
|
||||
if( errno == EPERM )
|
||||
append_format(stderr_buffer, L"ulimit: Permission denied when changing resource of type '%ls'\n", get_desc( resource ) );
|
||||
else
|
||||
builtin_wperror( L"ulimit" );
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
struct rlimit ls;
|
||||
getrlimit(resource, &ls);
|
||||
|
||||
if (hard)
|
||||
{
|
||||
ls.rlim_max = value;
|
||||
}
|
||||
|
||||
if (soft)
|
||||
{
|
||||
ls.rlim_cur = value;
|
||||
|
||||
/*
|
||||
Do not attempt to set the soft limit higher than the hard limit
|
||||
*/
|
||||
if ((value == RLIM_INFINITY && ls.rlim_max != RLIM_INFINITY) ||
|
||||
(value != RLIM_INFINITY && ls.rlim_max != RLIM_INFINITY && value > ls.rlim_max))
|
||||
{
|
||||
ls.rlim_cur = ls.rlim_max;
|
||||
}
|
||||
}
|
||||
|
||||
if (setrlimit(resource, &ls))
|
||||
{
|
||||
if (errno == EPERM)
|
||||
append_format(stderr_buffer, L"ulimit: Permission denied when changing resource of type '%ls'\n", get_desc(resource));
|
||||
else
|
||||
builtin_wperror(L"ulimit");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
The ulimit builtin, used for setting resource limits. Defined in
|
||||
builtin_ulimit.c.
|
||||
*/
|
||||
static int builtin_ulimit( parser_t &parser, wchar_t ** argv )
|
||||
static int builtin_ulimit(parser_t &parser, wchar_t ** argv)
|
||||
{
|
||||
int hard=0;
|
||||
int soft=0;
|
||||
|
||||
int what = RLIMIT_FSIZE;
|
||||
int report_all = 0;
|
||||
int hard=0;
|
||||
int soft=0;
|
||||
|
||||
int argc = builtin_count_args( argv );
|
||||
|
||||
woptind=0;
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
static const struct woption
|
||||
long_options[] =
|
||||
{
|
||||
{
|
||||
L"all", no_argument, 0, 'a'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"hard", no_argument, 0, 'H'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"soft", no_argument, 0, 'S'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"core-size", no_argument, 0, 'c'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"data-size", no_argument, 0, 'd'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"file-size", no_argument, 0, 'f'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"lock-size", no_argument, 0, 'l'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"resident-set-size", no_argument, 0, 'm'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"file-descriptor-count", no_argument, 0, 'n'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"stack-size", no_argument, 0, 's'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"cpu-time", no_argument, 0, 't'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"process-count", no_argument, 0, 'u'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"virtual-memory-size", no_argument, 0, 'v'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"help", no_argument, 0, 'h'
|
||||
}
|
||||
,
|
||||
{
|
||||
0, 0, 0, 0
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
int what = RLIMIT_FSIZE;
|
||||
int report_all = 0;
|
||||
|
||||
int opt_index = 0;
|
||||
|
||||
int opt = wgetopt_long( argc,
|
||||
argv,
|
||||
L"aHScdflmnstuvh",
|
||||
long_options,
|
||||
&opt_index );
|
||||
if( opt == -1 )
|
||||
break;
|
||||
|
||||
switch( opt )
|
||||
{
|
||||
case 0:
|
||||
if(long_options[opt_index].flag != 0)
|
||||
break;
|
||||
int argc = builtin_count_args(argv);
|
||||
|
||||
woptind=0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
static const struct woption
|
||||
long_options[] =
|
||||
{
|
||||
{
|
||||
L"all", no_argument, 0, 'a'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"hard", no_argument, 0, 'H'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"soft", no_argument, 0, 'S'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"core-size", no_argument, 0, 'c'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"data-size", no_argument, 0, 'd'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"file-size", no_argument, 0, 'f'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"lock-size", no_argument, 0, 'l'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"resident-set-size", no_argument, 0, 'm'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"file-descriptor-count", no_argument, 0, 'n'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"stack-size", no_argument, 0, 's'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"cpu-time", no_argument, 0, 't'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"process-count", no_argument, 0, 'u'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"virtual-memory-size", no_argument, 0, 'v'
|
||||
}
|
||||
,
|
||||
{
|
||||
L"help", no_argument, 0, 'h'
|
||||
}
|
||||
,
|
||||
{
|
||||
0, 0, 0, 0
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
int opt_index = 0;
|
||||
|
||||
int opt = wgetopt_long(argc,
|
||||
argv,
|
||||
L"aHScdflmnstuvh",
|
||||
long_options,
|
||||
&opt_index);
|
||||
if (opt == -1)
|
||||
break;
|
||||
|
||||
switch (opt)
|
||||
{
|
||||
case 0:
|
||||
if (long_options[opt_index].flag != 0)
|
||||
break;
|
||||
append_format(stderr_buffer,
|
||||
BUILTIN_ERR_UNKNOWN,
|
||||
argv[0],
|
||||
long_options[opt_index].name );
|
||||
builtin_print_help( parser, argv[0], stderr_buffer );
|
||||
BUILTIN_ERR_UNKNOWN,
|
||||
argv[0],
|
||||
long_options[opt_index].name);
|
||||
builtin_print_help(parser, argv[0], stderr_buffer);
|
||||
|
||||
return 1;
|
||||
|
||||
case L'a':
|
||||
report_all=1;
|
||||
break;
|
||||
return 1;
|
||||
|
||||
case L'H':
|
||||
hard=1;
|
||||
break;
|
||||
case L'a':
|
||||
report_all=1;
|
||||
break;
|
||||
|
||||
case L'S':
|
||||
soft=1;
|
||||
break;
|
||||
case L'H':
|
||||
hard=1;
|
||||
break;
|
||||
|
||||
case L'c':
|
||||
what=RLIMIT_CORE;
|
||||
break;
|
||||
|
||||
case L'd':
|
||||
what=RLIMIT_DATA;
|
||||
break;
|
||||
|
||||
case L'f':
|
||||
what=RLIMIT_FSIZE;
|
||||
break;
|
||||
case L'S':
|
||||
soft=1;
|
||||
break;
|
||||
|
||||
case L'c':
|
||||
what=RLIMIT_CORE;
|
||||
break;
|
||||
|
||||
case L'd':
|
||||
what=RLIMIT_DATA;
|
||||
break;
|
||||
|
||||
case L'f':
|
||||
what=RLIMIT_FSIZE;
|
||||
break;
|
||||
#ifdef RLIMIT_MEMLOCK
|
||||
case L'l':
|
||||
what=RLIMIT_MEMLOCK;
|
||||
break;
|
||||
case L'l':
|
||||
what=RLIMIT_MEMLOCK;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef RLIMIT_RSS
|
||||
case L'm':
|
||||
what=RLIMIT_RSS;
|
||||
break;
|
||||
#ifdef RLIMIT_RSS
|
||||
case L'm':
|
||||
what=RLIMIT_RSS;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case L'n':
|
||||
what=RLIMIT_NOFILE;
|
||||
break;
|
||||
|
||||
case L's':
|
||||
what=RLIMIT_STACK;
|
||||
break;
|
||||
|
||||
case L't':
|
||||
what=RLIMIT_CPU;
|
||||
break;
|
||||
|
||||
#ifdef RLIMIT_NPROC
|
||||
case L'u':
|
||||
what=RLIMIT_NPROC;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef RLIMIT_AS
|
||||
case L'v':
|
||||
what=RLIMIT_AS;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case L'h':
|
||||
builtin_print_help( parser, argv[0], stdout_buffer );
|
||||
return 0;
|
||||
|
||||
case L'?':
|
||||
builtin_unknown_option( parser, argv[0], argv[woptind-1] );
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
case L'n':
|
||||
what=RLIMIT_NOFILE;
|
||||
break;
|
||||
|
||||
if( report_all )
|
||||
{
|
||||
if( argc - woptind == 0 )
|
||||
{
|
||||
print_all( hard );
|
||||
}
|
||||
else
|
||||
{
|
||||
case L's':
|
||||
what=RLIMIT_STACK;
|
||||
break;
|
||||
|
||||
case L't':
|
||||
what=RLIMIT_CPU;
|
||||
break;
|
||||
|
||||
#ifdef RLIMIT_NPROC
|
||||
case L'u':
|
||||
what=RLIMIT_NPROC;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef RLIMIT_AS
|
||||
case L'v':
|
||||
what=RLIMIT_AS;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case L'h':
|
||||
builtin_print_help(parser, argv[0], stdout_buffer);
|
||||
return 0;
|
||||
|
||||
case L'?':
|
||||
builtin_unknown_option(parser, argv[0], argv[woptind-1]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (report_all)
|
||||
{
|
||||
if (argc - woptind == 0)
|
||||
{
|
||||
print_all(hard);
|
||||
}
|
||||
else
|
||||
{
|
||||
stderr_buffer.append(argv[0]);
|
||||
stderr_buffer.append(L": Too many arguments\n");
|
||||
builtin_print_help( parser, argv[0], stderr_buffer );
|
||||
return 1;
|
||||
}
|
||||
builtin_print_help(parser, argv[0], stderr_buffer);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch( argc - woptind )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
/*
|
||||
Show current limit value
|
||||
*/
|
||||
print( what, hard );
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
/*
|
||||
Change current limit value
|
||||
*/
|
||||
rlim_t new_limit;
|
||||
wchar_t *end;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Set both hard and soft limits if nothing else was specified
|
||||
*/
|
||||
if( !(hard+soft) )
|
||||
{
|
||||
hard=soft=1;
|
||||
}
|
||||
|
||||
if( wcscasecmp( argv[woptind], L"unlimited" )==0)
|
||||
{
|
||||
new_limit = RLIM_INFINITY;
|
||||
}
|
||||
else if( wcscasecmp( argv[woptind], L"hard" )==0)
|
||||
{
|
||||
new_limit = get( what, 1 );
|
||||
}
|
||||
else if( wcscasecmp( argv[woptind], L"soft" )==0)
|
||||
{
|
||||
new_limit = get( what, soft );
|
||||
}
|
||||
else
|
||||
{
|
||||
errno=0;
|
||||
new_limit = wcstol( argv[woptind], &end, 10 );
|
||||
if( errno || *end )
|
||||
{
|
||||
append_format(stderr_buffer,
|
||||
L"%ls: Invalid limit '%ls'\n",
|
||||
argv[0],
|
||||
argv[woptind] );
|
||||
builtin_print_help( parser, argv[0], stderr_buffer );
|
||||
return 1;
|
||||
}
|
||||
new_limit *= get_multiplier( what );
|
||||
}
|
||||
|
||||
return set( what, hard, soft, new_limit );
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
switch (argc - woptind)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
/*
|
||||
Show current limit value
|
||||
*/
|
||||
print(what, hard);
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
/*
|
||||
Change current limit value
|
||||
*/
|
||||
rlim_t new_limit;
|
||||
wchar_t *end;
|
||||
|
||||
/*
|
||||
Set both hard and soft limits if nothing else was specified
|
||||
*/
|
||||
if (!(hard+soft))
|
||||
{
|
||||
hard=soft=1;
|
||||
}
|
||||
|
||||
if (wcscasecmp(argv[woptind], L"unlimited")==0)
|
||||
{
|
||||
new_limit = RLIM_INFINITY;
|
||||
}
|
||||
else if (wcscasecmp(argv[woptind], L"hard")==0)
|
||||
{
|
||||
new_limit = get(what, 1);
|
||||
}
|
||||
else if (wcscasecmp(argv[woptind], L"soft")==0)
|
||||
{
|
||||
new_limit = get(what, soft);
|
||||
}
|
||||
else
|
||||
{
|
||||
errno=0;
|
||||
new_limit = wcstol(argv[woptind], &end, 10);
|
||||
if (errno || *end)
|
||||
{
|
||||
append_format(stderr_buffer,
|
||||
L"%ls: Invalid limit '%ls'\n",
|
||||
argv[0],
|
||||
argv[woptind]);
|
||||
builtin_print_help(parser, argv[0], stderr_buffer);
|
||||
return 1;
|
||||
}
|
||||
new_limit *= get_multiplier(what);
|
||||
}
|
||||
|
||||
return set(what, hard, soft, new_limit);
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
stderr_buffer.append(argv[0]);
|
||||
stderr_buffer.append(L": Too many arguments\n");
|
||||
builtin_print_help( parser, argv[0], stderr_buffer );
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
return 0;
|
||||
builtin_print_help(parser, argv[0], stderr_buffer);
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
290
color.cpp
290
color.cpp
@@ -4,55 +4,94 @@
|
||||
#include "color.h"
|
||||
#include "fallback.h"
|
||||
|
||||
bool rgb_color_t::try_parse_special(const wcstring &special) {
|
||||
bool rgb_color_t::try_parse_special(const wcstring &special)
|
||||
{
|
||||
bzero(&data, sizeof data);
|
||||
const wchar_t *name = special.c_str();
|
||||
if (! wcscasecmp(name, L"normal")) {
|
||||
if (! wcscasecmp(name, L"normal"))
|
||||
{
|
||||
this->type = type_normal;
|
||||
} else if (! wcscasecmp(name, L"reset")) {
|
||||
}
|
||||
else if (! wcscasecmp(name, L"reset"))
|
||||
{
|
||||
this->type = type_reset;
|
||||
} else if (! wcscasecmp(name, L"ignore")) {
|
||||
}
|
||||
else if (! wcscasecmp(name, L"ignore"))
|
||||
{
|
||||
this->type = type_ignore;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
this->type = type_none;
|
||||
}
|
||||
return this->type != type_none;
|
||||
}
|
||||
|
||||
static int parse_hex_digit(wchar_t x) {
|
||||
switch (x) {
|
||||
case L'0': return 0x0;
|
||||
case L'1': return 0x1;
|
||||
case L'2': return 0x2;
|
||||
case L'3': return 0x3;
|
||||
case L'4': return 0x4;
|
||||
case L'5': return 0x5;
|
||||
case L'6': return 0x6;
|
||||
case L'7': return 0x7;
|
||||
case L'8': return 0x8;
|
||||
case L'9': return 0x9;
|
||||
case L'a':case L'A': return 0xA;
|
||||
case L'b':case L'B': return 0xB;
|
||||
case L'c':case L'C': return 0xC;
|
||||
case L'd':case L'D': return 0xD;
|
||||
case L'e':case L'E': return 0xE;
|
||||
case L'f':case L'F': return 0xF;
|
||||
default: return -1;
|
||||
static int parse_hex_digit(wchar_t x)
|
||||
{
|
||||
switch (x)
|
||||
{
|
||||
case L'0':
|
||||
return 0x0;
|
||||
case L'1':
|
||||
return 0x1;
|
||||
case L'2':
|
||||
return 0x2;
|
||||
case L'3':
|
||||
return 0x3;
|
||||
case L'4':
|
||||
return 0x4;
|
||||
case L'5':
|
||||
return 0x5;
|
||||
case L'6':
|
||||
return 0x6;
|
||||
case L'7':
|
||||
return 0x7;
|
||||
case L'8':
|
||||
return 0x8;
|
||||
case L'9':
|
||||
return 0x9;
|
||||
case L'a':
|
||||
case L'A':
|
||||
return 0xA;
|
||||
case L'b':
|
||||
case L'B':
|
||||
return 0xB;
|
||||
case L'c':
|
||||
case L'C':
|
||||
return 0xC;
|
||||
case L'd':
|
||||
case L'D':
|
||||
return 0xD;
|
||||
case L'e':
|
||||
case L'E':
|
||||
return 0xE;
|
||||
case L'f':
|
||||
case L'F':
|
||||
return 0xF;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned char convert_color(const unsigned char rgb[3], const uint32_t *colors, size_t color_count) {
|
||||
static unsigned long squared_difference(long p1, long p2)
|
||||
{
|
||||
unsigned long diff = (unsigned long)labs(p1 - p2);
|
||||
return diff * diff;
|
||||
}
|
||||
|
||||
static unsigned char convert_color(const unsigned char rgb[3], const uint32_t *colors, size_t color_count)
|
||||
{
|
||||
long r = rgb[0], g = rgb[1], b = rgb[2];
|
||||
unsigned long best_distance = (unsigned long)(-1);
|
||||
unsigned char best_index = (unsigned char)(-1);
|
||||
for (unsigned char idx = 0; idx < color_count; idx++) {
|
||||
for (unsigned char idx = 0; idx < color_count; idx++)
|
||||
{
|
||||
uint32_t color = colors[idx];
|
||||
long test_r = (color >> 16) & 0xFF, test_g = (color >> 8) & 0xFF, test_b = (color >> 0) & 0xFF;
|
||||
unsigned long distance = 0;
|
||||
distance += (r - test_r) * (r - test_r);
|
||||
distance += (g - test_g) * (g - test_g);
|
||||
distance += (b - test_b) * (b - test_b);
|
||||
if (distance <= best_distance) {
|
||||
unsigned long distance = squared_difference(r, test_r) + squared_difference(g, test_g) + squared_difference(b, test_b);
|
||||
if (distance <= best_distance)
|
||||
{
|
||||
best_index = idx;
|
||||
best_distance = distance;
|
||||
}
|
||||
@@ -61,7 +100,8 @@ static unsigned char convert_color(const unsigned char rgb[3], const uint32_t *c
|
||||
|
||||
}
|
||||
|
||||
bool rgb_color_t::try_parse_rgb(const wcstring &name) {
|
||||
bool rgb_color_t::try_parse_rgb(const wcstring &name)
|
||||
{
|
||||
bzero(&data, sizeof data);
|
||||
/* We support the following style of rgb formats (case insensitive):
|
||||
#FA3
|
||||
@@ -69,46 +109,54 @@ bool rgb_color_t::try_parse_rgb(const wcstring &name) {
|
||||
FA3
|
||||
F3A035
|
||||
*/
|
||||
|
||||
|
||||
size_t digit_idx = 0, len = name.size();
|
||||
|
||||
|
||||
/* Skip any leading # */
|
||||
if (len > 0 && name.at(0) == L'#')
|
||||
digit_idx++;
|
||||
|
||||
|
||||
bool success = false;
|
||||
size_t i;
|
||||
if (len - digit_idx == 3) {
|
||||
if (len - digit_idx == 3)
|
||||
{
|
||||
// type FA3
|
||||
for (i=0; i < 3; i++) {
|
||||
for (i=0; i < 3; i++)
|
||||
{
|
||||
int val = parse_hex_digit(name.at(digit_idx++));
|
||||
if (val < 0) break;
|
||||
data.rgb[i] = val*16+val;
|
||||
}
|
||||
success = (i == 3);
|
||||
} else if (len - digit_idx == 6) {
|
||||
}
|
||||
else if (len - digit_idx == 6)
|
||||
{
|
||||
// type F3A035
|
||||
for (i=0; i < 3; i++) {
|
||||
for (i=0; i < 3; i++)
|
||||
{
|
||||
int hi = parse_hex_digit(name.at(digit_idx++));
|
||||
int lo = parse_hex_digit(name.at(digit_idx++));
|
||||
if (lo < 0 || hi < 0) break;
|
||||
data.rgb[i] = hi*16+lo;
|
||||
}
|
||||
success = (i == 3);
|
||||
}
|
||||
if (success) {
|
||||
}
|
||||
if (success)
|
||||
{
|
||||
this->type = type_rgb;
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
struct named_color_t {
|
||||
struct named_color_t
|
||||
{
|
||||
const wchar_t * name;
|
||||
unsigned char idx;
|
||||
unsigned char rgb[3];
|
||||
};
|
||||
|
||||
static const named_color_t named_colors[11] = {
|
||||
static const named_color_t named_colors[11] =
|
||||
{
|
||||
{L"black", 0, {0, 0, 0}},
|
||||
{L"red", 1, {0xFF, 0, 0}},
|
||||
{L"green", 2, {0, 0xFF, 0}},
|
||||
@@ -122,11 +170,26 @@ static const named_color_t named_colors[11] = {
|
||||
{L"normal", 8, {0xFF, 0xFF, 0XFF}}
|
||||
};
|
||||
|
||||
bool rgb_color_t::try_parse_named(const wcstring &str) {
|
||||
wcstring_list_t rgb_color_t::named_color_names(void)
|
||||
{
|
||||
size_t count = sizeof named_colors / sizeof *named_colors;
|
||||
wcstring_list_t result;
|
||||
result.reserve(count);
|
||||
for (size_t i=0; i < count; i++)
|
||||
{
|
||||
result.push_back(named_colors[i].name);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool rgb_color_t::try_parse_named(const wcstring &str)
|
||||
{
|
||||
bzero(&data, sizeof data);
|
||||
size_t max = sizeof named_colors / sizeof *named_colors;
|
||||
for (size_t idx=0; idx < max; idx++) {
|
||||
if (0 == wcscasecmp(str.c_str(), named_colors[idx].name)) {
|
||||
for (size_t idx=0; idx < max; idx++)
|
||||
{
|
||||
if (0 == wcscasecmp(str.c_str(), named_colors[idx].name))
|
||||
{
|
||||
data.name_idx = named_colors[idx].idx;
|
||||
this->type = type_named;
|
||||
return true;
|
||||
@@ -135,45 +198,69 @@ bool rgb_color_t::try_parse_named(const wcstring &str) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static const wchar_t *name_for_color_idx(unsigned char idx) {
|
||||
static const wchar_t *name_for_color_idx(unsigned char idx)
|
||||
{
|
||||
size_t max = sizeof named_colors / sizeof *named_colors;
|
||||
for (size_t i=0; i < max; i++) {
|
||||
if (named_colors[i].idx == idx) {
|
||||
for (size_t i=0; i < max; i++)
|
||||
{
|
||||
if (named_colors[i].idx == idx)
|
||||
{
|
||||
return named_colors[i].name;
|
||||
}
|
||||
}
|
||||
return L"unknown";
|
||||
}
|
||||
|
||||
rgb_color_t::rgb_color_t(unsigned char t, unsigned char i) : type(t), flags(), data() {
|
||||
rgb_color_t::rgb_color_t(unsigned char t, unsigned char i) : type(t), flags(), data()
|
||||
{
|
||||
data.name_idx = i;
|
||||
}
|
||||
|
||||
rgb_color_t rgb_color_t::normal() { return rgb_color_t(type_normal); }
|
||||
rgb_color_t rgb_color_t::reset() { return rgb_color_t(type_reset); }
|
||||
rgb_color_t rgb_color_t::ignore() { return rgb_color_t(type_ignore); }
|
||||
rgb_color_t rgb_color_t::none() { return rgb_color_t(type_none); }
|
||||
rgb_color_t rgb_color_t::white() { return rgb_color_t(type_named, 7); }
|
||||
rgb_color_t rgb_color_t::black() { return rgb_color_t(type_named, 0); }
|
||||
rgb_color_t rgb_color_t::normal()
|
||||
{
|
||||
return rgb_color_t(type_normal);
|
||||
}
|
||||
rgb_color_t rgb_color_t::reset()
|
||||
{
|
||||
return rgb_color_t(type_reset);
|
||||
}
|
||||
rgb_color_t rgb_color_t::ignore()
|
||||
{
|
||||
return rgb_color_t(type_ignore);
|
||||
}
|
||||
rgb_color_t rgb_color_t::none()
|
||||
{
|
||||
return rgb_color_t(type_none);
|
||||
}
|
||||
rgb_color_t rgb_color_t::white()
|
||||
{
|
||||
return rgb_color_t(type_named, 7);
|
||||
}
|
||||
rgb_color_t rgb_color_t::black()
|
||||
{
|
||||
return rgb_color_t(type_named, 0);
|
||||
}
|
||||
|
||||
static unsigned char term8_color_for_rgb(const unsigned char rgb[3]) {
|
||||
const uint32_t kColors[] = {
|
||||
static unsigned char term8_color_for_rgb(const unsigned char rgb[3])
|
||||
{
|
||||
const uint32_t kColors[] =
|
||||
{
|
||||
0x000000, //Black
|
||||
0xFF0000, //Red
|
||||
0x00FF00, //Green
|
||||
0x725000, //Brown
|
||||
0xFFFF00, //Yellow
|
||||
0x0000FF, //Blue
|
||||
0xFF00FF, //Magenta
|
||||
0xFF00FF, //Purple
|
||||
0x00FFFF, //Cyan
|
||||
0xFFFFFF, //White
|
||||
};
|
||||
return convert_color(rgb, kColors, sizeof kColors / sizeof *kColors);
|
||||
}
|
||||
|
||||
static unsigned char term256_color_for_rgb(const unsigned char rgb[3]) {
|
||||
const uint32_t kColors[240] = {
|
||||
static unsigned char term256_color_for_rgb(const unsigned char rgb[3])
|
||||
{
|
||||
const uint32_t kColors[240] =
|
||||
{
|
||||
0x000000, 0x00005f, 0x000087, 0x0000af, 0x0000d7, 0x0000ff, 0x005f00, 0x005f5f,
|
||||
0x005f87, 0x005faf, 0x005fd7, 0x005fff, 0x008700, 0x00875f, 0x008787, 0x0087af,
|
||||
0x0087d7, 0x0087ff, 0x00af00, 0x00af5f, 0x00af87, 0x00afaf, 0x00afd7, 0x00afff,
|
||||
@@ -183,67 +270,82 @@ static unsigned char term256_color_for_rgb(const unsigned char rgb[3]) {
|
||||
0x5f8700, 0x5f875f, 0x5f8787, 0x5f87af, 0x5f87d7, 0x5f87ff, 0x5faf00, 0x5faf5f,
|
||||
0x5faf87, 0x5fafaf, 0x5fafd7, 0x5fafff, 0x5fd700, 0x5fd75f, 0x5fd787, 0x5fd7af,
|
||||
0x5fd7d7, 0x5fd7ff, 0x5fff00, 0x5fff5f, 0x5fff87, 0x5fffaf, 0x5fffd7, 0x5fffff,
|
||||
0x870000, 0x87005f, 0x870087, 0x8700af, 0x8700d7, 0x8700ff, 0x875f00, 0x875f5f,
|
||||
0x875f87, 0x875faf, 0x875fd7, 0x875fff, 0x878700, 0x87875f, 0x878787, 0x8787af,
|
||||
0x8787d7, 0x8787ff, 0x87af00, 0x87af5f, 0x87af87, 0x87afaf, 0x87afd7, 0x87afff,
|
||||
0x87d700, 0x87d75f, 0x87d787, 0x87d7af, 0x87d7d7, 0x87d7ff, 0x87ff00, 0x87ff5f,
|
||||
0x87ff87, 0x87ffaf, 0x87ffd7, 0x87ffff, 0xaf0000, 0xaf005f, 0xaf0087, 0xaf00af,
|
||||
0xaf00d7, 0xaf00ff, 0xaf5f00, 0xaf5f5f, 0xaf5f87, 0xaf5faf, 0xaf5fd7, 0xaf5fff,
|
||||
0xaf8700, 0xaf875f, 0xaf8787, 0xaf87af, 0xaf87d7, 0xaf87ff, 0xafaf00, 0xafaf5f,
|
||||
0xafaf87, 0xafafaf, 0xafafd7, 0xafafff, 0xafd700, 0xafd75f, 0xafd787, 0xafd7af,
|
||||
0xafd7d7, 0xafd7ff, 0xafff00, 0xafff5f, 0xafff87, 0xafffaf, 0xafffd7, 0xafffff,
|
||||
0xd70000, 0xd7005f, 0xd70087, 0xd700af, 0xd700d7, 0xd700ff, 0xd75f00, 0xd75f5f,
|
||||
0xd75f87, 0xd75faf, 0xd75fd7, 0xd75fff, 0xd78700, 0xd7875f, 0xd78787, 0xd787af,
|
||||
0xd787d7, 0xd787ff, 0xd7af00, 0xd7af5f, 0xd7af87, 0xd7afaf, 0xd7afd7, 0xd7afff,
|
||||
0xd7d700, 0xd7d75f, 0xd7d787, 0xd7d7af, 0xd7d7d7, 0xd7d7ff, 0xd7ff00, 0xd7ff5f,
|
||||
0xd7ff87, 0xd7ffaf, 0xd7ffd7, 0xd7ffff, 0xff0000, 0xff005f, 0xff0087, 0xff00af,
|
||||
0xff00d7, 0xff00ff, 0xff5f00, 0xff5f5f, 0xff5f87, 0xff5faf, 0xff5fd7, 0xff5fff,
|
||||
0xff8700, 0xff875f, 0xff8787, 0xff87af, 0xff87d7, 0xff87ff, 0xffaf00, 0xffaf5f,
|
||||
0xffaf87, 0xffafaf, 0xffafd7, 0xffafff, 0xffd700, 0xffd75f, 0xffd787, 0xffd7af,
|
||||
0xffd7d7, 0xffd7ff, 0xffff00, 0xffff5f, 0xffff87, 0xffffaf, 0xffffd7, 0xffffff,
|
||||
0x080808, 0x121212, 0x1c1c1c, 0x262626, 0x303030, 0x3a3a3a, 0x444444, 0x4e4e4e,
|
||||
0x585858, 0x626262, 0x6c6c6c, 0x767676, 0x808080, 0x8a8a8a, 0x949494, 0x9e9e9e,
|
||||
0x870000, 0x87005f, 0x870087, 0x8700af, 0x8700d7, 0x8700ff, 0x875f00, 0x875f5f,
|
||||
0x875f87, 0x875faf, 0x875fd7, 0x875fff, 0x878700, 0x87875f, 0x878787, 0x8787af,
|
||||
0x8787d7, 0x8787ff, 0x87af00, 0x87af5f, 0x87af87, 0x87afaf, 0x87afd7, 0x87afff,
|
||||
0x87d700, 0x87d75f, 0x87d787, 0x87d7af, 0x87d7d7, 0x87d7ff, 0x87ff00, 0x87ff5f,
|
||||
0x87ff87, 0x87ffaf, 0x87ffd7, 0x87ffff, 0xaf0000, 0xaf005f, 0xaf0087, 0xaf00af,
|
||||
0xaf00d7, 0xaf00ff, 0xaf5f00, 0xaf5f5f, 0xaf5f87, 0xaf5faf, 0xaf5fd7, 0xaf5fff,
|
||||
0xaf8700, 0xaf875f, 0xaf8787, 0xaf87af, 0xaf87d7, 0xaf87ff, 0xafaf00, 0xafaf5f,
|
||||
0xafaf87, 0xafafaf, 0xafafd7, 0xafafff, 0xafd700, 0xafd75f, 0xafd787, 0xafd7af,
|
||||
0xafd7d7, 0xafd7ff, 0xafff00, 0xafff5f, 0xafff87, 0xafffaf, 0xafffd7, 0xafffff,
|
||||
0xd70000, 0xd7005f, 0xd70087, 0xd700af, 0xd700d7, 0xd700ff, 0xd75f00, 0xd75f5f,
|
||||
0xd75f87, 0xd75faf, 0xd75fd7, 0xd75fff, 0xd78700, 0xd7875f, 0xd78787, 0xd787af,
|
||||
0xd787d7, 0xd787ff, 0xd7af00, 0xd7af5f, 0xd7af87, 0xd7afaf, 0xd7afd7, 0xd7afff,
|
||||
0xd7d700, 0xd7d75f, 0xd7d787, 0xd7d7af, 0xd7d7d7, 0xd7d7ff, 0xd7ff00, 0xd7ff5f,
|
||||
0xd7ff87, 0xd7ffaf, 0xd7ffd7, 0xd7ffff, 0xff0000, 0xff005f, 0xff0087, 0xff00af,
|
||||
0xff00d7, 0xff00ff, 0xff5f00, 0xff5f5f, 0xff5f87, 0xff5faf, 0xff5fd7, 0xff5fff,
|
||||
0xff8700, 0xff875f, 0xff8787, 0xff87af, 0xff87d7, 0xff87ff, 0xffaf00, 0xffaf5f,
|
||||
0xffaf87, 0xffafaf, 0xffafd7, 0xffafff, 0xffd700, 0xffd75f, 0xffd787, 0xffd7af,
|
||||
0xffd7d7, 0xffd7ff, 0xffff00, 0xffff5f, 0xffff87, 0xffffaf, 0xffffd7, 0xffffff,
|
||||
0x080808, 0x121212, 0x1c1c1c, 0x262626, 0x303030, 0x3a3a3a, 0x444444, 0x4e4e4e,
|
||||
0x585858, 0x626262, 0x6c6c6c, 0x767676, 0x808080, 0x8a8a8a, 0x949494, 0x9e9e9e,
|
||||
0xa8a8a8, 0xb2b2b2, 0xbcbcbc, 0xc6c6c6, 0xd0d0d0, 0xdadada, 0xe4e4e4, 0xeeeeee
|
||||
};
|
||||
return 16 + convert_color(rgb, kColors, sizeof kColors / sizeof *kColors);
|
||||
}
|
||||
|
||||
unsigned char rgb_color_t::to_term256_index() const {
|
||||
unsigned char rgb_color_t::to_term256_index() const
|
||||
{
|
||||
assert(type == type_rgb);
|
||||
return term256_color_for_rgb(data.rgb);
|
||||
}
|
||||
|
||||
unsigned char rgb_color_t::to_name_index() const {
|
||||
if (type == type_named) {
|
||||
unsigned char rgb_color_t::to_name_index() const
|
||||
{
|
||||
assert(type == type_named || type == type_rgb);
|
||||
if (type == type_named)
|
||||
{
|
||||
return data.name_idx;
|
||||
} else if (type == type_rgb) {
|
||||
}
|
||||
else if (type == type_rgb)
|
||||
{
|
||||
return term8_color_for_rgb(data.rgb);
|
||||
} else {
|
||||
throw "Bad type for to_name_index";
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This is an error */
|
||||
return (unsigned char)(-1);
|
||||
}
|
||||
}
|
||||
|
||||
void rgb_color_t::parse(const wcstring &str) {
|
||||
void rgb_color_t::parse(const wcstring &str)
|
||||
{
|
||||
bool success = false;
|
||||
if (! success) success = try_parse_special(str);
|
||||
if (! success) success = try_parse_named(str);
|
||||
if (! success) success = try_parse_rgb(str);
|
||||
if (! success) {
|
||||
if (! success)
|
||||
{
|
||||
bzero(this->data.rgb, sizeof this->data.rgb);
|
||||
this->type = type_none;
|
||||
}
|
||||
}
|
||||
|
||||
rgb_color_t::rgb_color_t(const wcstring &str) {
|
||||
rgb_color_t::rgb_color_t(const wcstring &str)
|
||||
{
|
||||
this->parse(str);
|
||||
}
|
||||
|
||||
rgb_color_t::rgb_color_t(const std::string &str) {
|
||||
rgb_color_t::rgb_color_t(const std::string &str)
|
||||
{
|
||||
this->parse(str2wcstring(str));
|
||||
}
|
||||
|
||||
wcstring rgb_color_t::description() const {
|
||||
switch (type) {
|
||||
wcstring rgb_color_t::description() const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case type_none:
|
||||
return L"none";
|
||||
case type_named:
|
||||
|
||||
132
color.h
132
color.h
@@ -10,10 +10,12 @@
|
||||
|
||||
|
||||
/* A type that represents a color. We work hard to keep it at a size of 4 bytes. */
|
||||
class rgb_color_t {
|
||||
class rgb_color_t
|
||||
{
|
||||
|
||||
/* Types */
|
||||
enum {
|
||||
enum
|
||||
{
|
||||
type_none,
|
||||
type_named,
|
||||
type_rgb,
|
||||
@@ -22,22 +24,24 @@ class rgb_color_t {
|
||||
type_ignore
|
||||
};
|
||||
unsigned char type:4;
|
||||
|
||||
|
||||
/* Flags */
|
||||
enum {
|
||||
enum
|
||||
{
|
||||
flag_bold = 1 << 0,
|
||||
flag_underline = 1 << 1
|
||||
};
|
||||
unsigned char flags:4;
|
||||
|
||||
union {
|
||||
|
||||
union
|
||||
{
|
||||
unsigned char name_idx; //0-10
|
||||
unsigned char rgb[3];
|
||||
} data;
|
||||
|
||||
|
||||
/** Try parsing a special color name like "normal" */
|
||||
bool try_parse_special(const wcstring &str);
|
||||
|
||||
|
||||
/** Try parsing an rgb color like "#F0A030" */
|
||||
bool try_parse_rgb(const wcstring &str);
|
||||
|
||||
@@ -49,85 +53,125 @@ class rgb_color_t {
|
||||
|
||||
/** Private constructor */
|
||||
explicit rgb_color_t(unsigned char t, unsigned char i=0);
|
||||
|
||||
public:
|
||||
|
||||
|
||||
public:
|
||||
|
||||
/** Default constructor of type none */
|
||||
explicit rgb_color_t() : type(type_none), flags(), data() {}
|
||||
|
||||
|
||||
/** Parse a color from a string */
|
||||
explicit rgb_color_t(const wcstring &str);
|
||||
explicit rgb_color_t(const std::string &str);
|
||||
|
||||
/** Returns white */
|
||||
/** Returns white */
|
||||
static rgb_color_t white();
|
||||
|
||||
|
||||
/** Returns black */
|
||||
static rgb_color_t black();
|
||||
|
||||
|
||||
/** Returns the reset special color */
|
||||
static rgb_color_t reset();
|
||||
|
||||
|
||||
/** Returns the normal special color */
|
||||
static rgb_color_t normal();
|
||||
|
||||
|
||||
/** Returns the ignore special color */
|
||||
static rgb_color_t ignore();
|
||||
|
||||
|
||||
/** Returns the none special color */
|
||||
static rgb_color_t none();
|
||||
|
||||
|
||||
/** Returns whether the color is the ignore special color */
|
||||
bool is_ignore(void) const { return type == type_ignore; }
|
||||
bool is_ignore(void) const
|
||||
{
|
||||
return type == type_ignore;
|
||||
}
|
||||
|
||||
/** Returns whether the color is the normal special color */
|
||||
bool is_normal(void) const { return type == type_normal; }
|
||||
|
||||
bool is_normal(void) const
|
||||
{
|
||||
return type == type_normal;
|
||||
}
|
||||
|
||||
/** Returns whether the color is the reset special color */
|
||||
bool is_reset(void) const { return type == type_reset; }
|
||||
|
||||
bool is_reset(void) const
|
||||
{
|
||||
return type == type_reset;
|
||||
}
|
||||
|
||||
/** Returns whether the color is the none special color */
|
||||
bool is_none(void) const { return type == type_none; }
|
||||
|
||||
bool is_none(void) const
|
||||
{
|
||||
return type == type_none;
|
||||
}
|
||||
|
||||
/** Returns whether the color is a named color (like "magenta") */
|
||||
bool is_named(void) const { return type == type_named; }
|
||||
|
||||
bool is_named(void) const
|
||||
{
|
||||
return type == type_named;
|
||||
}
|
||||
|
||||
/** Returns whether the color is specified via RGB components */
|
||||
bool is_rgb(void) const { return type == type_rgb; }
|
||||
|
||||
bool is_rgb(void) const
|
||||
{
|
||||
return type == type_rgb;
|
||||
}
|
||||
|
||||
/** Returns whether the color is special, that is, not rgb or named */
|
||||
bool is_special(void) const { return type != type_named && type != type_rgb; }
|
||||
bool is_special(void) const
|
||||
{
|
||||
return type != type_named && type != type_rgb;
|
||||
}
|
||||
|
||||
/** Returns a description of the color */
|
||||
wcstring description() const;
|
||||
|
||||
/** Returns the name index for the given color. Requires that the color be named or RGB. */
|
||||
unsigned char to_name_index() const;
|
||||
|
||||
|
||||
/** Returns the term256 index for the given color. Requires that the color be named or RGB. */
|
||||
unsigned char to_term256_index() const;
|
||||
|
||||
|
||||
/** Returns whether the color is bold */
|
||||
bool is_bold() const { return flags & flag_bold; }
|
||||
|
||||
bool is_bold() const
|
||||
{
|
||||
return !!(flags & flag_bold);
|
||||
}
|
||||
|
||||
/** Set whether the color is bold */
|
||||
void set_bold(bool x) { if (x) flags |= flag_bold; else flags &= ~flag_bold; }
|
||||
|
||||
void set_bold(bool x)
|
||||
{
|
||||
if (x) flags |= flag_bold;
|
||||
else flags &= ~flag_bold;
|
||||
}
|
||||
|
||||
/** Returns whether the color is underlined */
|
||||
bool is_underline() const { return !! (flags & flag_underline); }
|
||||
|
||||
bool is_underline() const
|
||||
{
|
||||
return !!(flags & flag_underline);
|
||||
}
|
||||
|
||||
/** Set whether the color is underlined */
|
||||
void set_underline(bool x) { if (x) flags |= flag_underline; else flags &= ~flag_underline; }
|
||||
|
||||
void set_underline(bool x)
|
||||
{
|
||||
if (x) flags |= flag_underline;
|
||||
else flags &= ~flag_underline;
|
||||
}
|
||||
|
||||
/** Compare two colors for equality */
|
||||
bool operator==(const rgb_color_t &other) const {
|
||||
bool operator==(const rgb_color_t &other) const
|
||||
{
|
||||
return type == other.type && ! memcmp(&data, &other.data, sizeof data);
|
||||
}
|
||||
|
||||
|
||||
/** Compare two colors for inequality */
|
||||
bool operator!=(const rgb_color_t &other) const {
|
||||
bool operator!=(const rgb_color_t &other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
/** Returns the names of all named colors */
|
||||
static wcstring_list_t named_color_names(void);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
3168
common.cpp
3168
common.cpp
File diff suppressed because it is too large
Load Diff
529
common.h
529
common.h
@@ -22,6 +22,12 @@
|
||||
#include <assert.h>
|
||||
#include "util.h"
|
||||
|
||||
/**
|
||||
Avoid writing the type name twice in a common "static_cast-initialization".
|
||||
Caveat: This doesn't work with type names containing commas!
|
||||
*/
|
||||
#define CAST_INIT(type, dst, src) type dst = static_cast<type >(src)
|
||||
|
||||
class completion_t;
|
||||
|
||||
/* Common string type */
|
||||
@@ -63,14 +69,19 @@ typedef std::vector<wcstring> wcstring_list_t;
|
||||
*/
|
||||
#define UNESCAPE_INCOMPLETE 2
|
||||
|
||||
/**
|
||||
Escape all characters, including magic characters like the semicolon
|
||||
*/
|
||||
#define ESCAPE_ALL 1
|
||||
/**
|
||||
Do not try to use 'simplified' quoted escapes, and do not use empty quotes as the empty string
|
||||
*/
|
||||
#define ESCAPE_NO_QUOTED 2
|
||||
/* Flags for the escape() and escape_string() functions */
|
||||
enum
|
||||
{
|
||||
/** Escape all characters, including magic characters like the semicolon */
|
||||
ESCAPE_ALL = 1 << 0,
|
||||
|
||||
/** Do not try to use 'simplified' quoted escapes, and do not use empty quotes as the empty string */
|
||||
ESCAPE_NO_QUOTED = 1 << 1,
|
||||
|
||||
/** Do not escape tildes */
|
||||
ESCAPE_NO_TILDE = 1 << 2
|
||||
};
|
||||
typedef unsigned int escape_flags_t;
|
||||
|
||||
/**
|
||||
Helper macro for errors
|
||||
@@ -78,12 +89,12 @@ typedef std::vector<wcstring> wcstring_list_t;
|
||||
#define VOMIT_ON_FAILURE(a) do { if (0 != (a)) { int err = errno; fprintf(stderr, "%s failed on line %d in file %s: %d (%s)\n", #a, __LINE__, __FILE__, err, strerror(err)); abort(); }} while (0)
|
||||
|
||||
/** Exits without invoking destructors (via _exit), useful for code after fork. */
|
||||
void exit_without_destructors(int code) __attribute__ ((noreturn));
|
||||
void exit_without_destructors(int code) __attribute__((noreturn));
|
||||
|
||||
/**
|
||||
/**
|
||||
Save the shell mode on startup so we can restore them on exit
|
||||
*/
|
||||
extern struct termios shell_modes;
|
||||
extern struct termios shell_modes;
|
||||
|
||||
/**
|
||||
The character to use where the text has been truncated. Is an
|
||||
@@ -91,6 +102,9 @@ extern struct termios shell_modes;
|
||||
*/
|
||||
extern wchar_t ellipsis_char;
|
||||
|
||||
/* Character representing an omitted newline at the end of text */
|
||||
extern wchar_t omitted_newline_char;
|
||||
|
||||
/**
|
||||
The verbosity level of fish. If a call to debug has a severity
|
||||
level higher than \c debug_level, it will not be printed.
|
||||
@@ -111,14 +125,14 @@ extern const wchar_t *program_name;
|
||||
/**
|
||||
This macro is used to check that an input argument is not null. It
|
||||
is a bit lika a non-fatal form of assert. Instead of exit-ing on
|
||||
failiure, the current function is ended at once. The second
|
||||
parameter is the return value of the current function on failiure.
|
||||
failure, the current function is ended at once. The second
|
||||
parameter is the return value of the current function on failure.
|
||||
*/
|
||||
#define CHECK( arg, retval ) \
|
||||
if( !(arg) ) \
|
||||
if (!(arg)) \
|
||||
{ \
|
||||
debug( 0, \
|
||||
_( L"function %s called with null value for argument %s. " ), \
|
||||
"function %s called with null value for argument %s. ", \
|
||||
__func__, \
|
||||
#arg ); \
|
||||
bugreport(); \
|
||||
@@ -131,12 +145,12 @@ extern const wchar_t *program_name;
|
||||
*/
|
||||
#define FATAL_EXIT() \
|
||||
{ \
|
||||
int exit_read_count;char exit_read_buff; \
|
||||
char exit_read_buff; \
|
||||
show_stackframe(); \
|
||||
exit_read_count=read( 0, &exit_read_buff, 1 ); \
|
||||
read( 0, &exit_read_buff, 1 ); \
|
||||
exit_without_destructors( 1 ); \
|
||||
} \
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Exit program at once, leaving an error message about running out of memory.
|
||||
@@ -144,8 +158,8 @@ extern const wchar_t *program_name;
|
||||
#define DIE_MEM() \
|
||||
{ \
|
||||
fwprintf( stderr, \
|
||||
L"fish: Out of memory on line %d of file %s, shutting down fish\n", \
|
||||
__LINE__, \
|
||||
L"fish: Out of memory on line %ld of file %s, shutting down fish\n", \
|
||||
(long)__LINE__, \
|
||||
__FILE__ ); \
|
||||
FATAL_EXIT(); \
|
||||
}
|
||||
@@ -154,30 +168,30 @@ extern const wchar_t *program_name;
|
||||
Check if signals are blocked. If so, print an error message and
|
||||
return from the function performing this check.
|
||||
*/
|
||||
#define CHECK_BLOCK( retval ) \
|
||||
if( signal_is_blocked() ) \
|
||||
#define CHECK_BLOCK(retval) \
|
||||
if (signal_is_blocked()) \
|
||||
{ \
|
||||
debug( 0, \
|
||||
_( L"function %s called while blocking signals. " ), \
|
||||
"function %s called while blocking signals. ", \
|
||||
__func__); \
|
||||
bugreport(); \
|
||||
show_stackframe(); \
|
||||
return retval; \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Shorthand for wgettext call
|
||||
*/
|
||||
#define _(wstr) wgettext((const wchar_t *)wstr)
|
||||
#define _(wstr) wgettext(wstr)
|
||||
|
||||
/**
|
||||
Noop, used to tell xgettext that a string should be translated,
|
||||
even though it is not directly sent to wgettext.
|
||||
even though it is not directly sent to wgettext.
|
||||
*/
|
||||
#define N_(wstr) wstr
|
||||
|
||||
/**
|
||||
Check if the specified stringelement is a part of the specified string list
|
||||
Check if the specified string element is a part of the specified string list
|
||||
*/
|
||||
#define contains( str,... ) contains_internal( str, __VA_ARGS__, NULL )
|
||||
|
||||
@@ -187,53 +201,28 @@ extern const wchar_t *program_name;
|
||||
void show_stackframe();
|
||||
|
||||
|
||||
wcstring_list_t completions_to_wcstring_list( const std::vector<completion_t> &completions );
|
||||
|
||||
/**
|
||||
Read a line from the stream f into the buffer buff of length len. If
|
||||
buff is to small, it will be reallocated, and both buff and len will
|
||||
be updated to reflect this. Returns the number of bytes read or -1
|
||||
on failiure.
|
||||
Read a line from the stream f into the string. Returns
|
||||
the number of bytes read or -1 on failure.
|
||||
|
||||
If the carriage return character is encountered, it is
|
||||
ignored. fgetws() considers the line to end if reading the file
|
||||
results in either a newline (L'\n') character, the null (L'\\0')
|
||||
character or the end of file (WEOF) character.
|
||||
*/
|
||||
int fgetws2( wchar_t **buff, int *len, FILE *f );
|
||||
int fgetws2(wcstring *s, FILE *f);
|
||||
|
||||
void sort_strings( std::vector<wcstring> &strings);
|
||||
|
||||
void sort_completions( std::vector<completion_t> &strings);
|
||||
|
||||
/**
|
||||
Returns a newly allocated wide character string equivalent of the
|
||||
specified multibyte character string
|
||||
|
||||
This function encodes illegal character sequences in a reversible
|
||||
way using the private use area.
|
||||
*/
|
||||
wchar_t *str2wcs( const char *in );
|
||||
|
||||
/**
|
||||
Returns a newly allocated wide character string equivalent of the
|
||||
Returns a wide character string equivalent of the
|
||||
specified multibyte character string
|
||||
|
||||
|
||||
This function encodes illegal character sequences in a reversible
|
||||
way using the private use area.
|
||||
*/
|
||||
wcstring str2wcstring( const char *in );
|
||||
wcstring str2wcstring( const std::string &in );
|
||||
|
||||
/**
|
||||
Converts the narrow character string \c in into it's wide
|
||||
equivalent, stored in \c out. \c out must have enough space to fit
|
||||
the entire string.
|
||||
|
||||
This function encodes illegal character sequences in a reversible
|
||||
way using the private use area.
|
||||
*/
|
||||
wchar_t *str2wcs_internal( const char *in, wchar_t *out );
|
||||
wcstring str2wcstring(const char *in);
|
||||
wcstring str2wcstring(const char *in, size_t len);
|
||||
wcstring str2wcstring(const std::string &in);
|
||||
|
||||
/**
|
||||
Returns a newly allocated multibyte character string equivalent of
|
||||
@@ -242,7 +231,8 @@ wchar_t *str2wcs_internal( const char *in, wchar_t *out );
|
||||
This function decodes illegal character sequences in a reversible
|
||||
way using the private use area.
|
||||
*/
|
||||
char *wcs2str( const wchar_t *in );
|
||||
char *wcs2str(const wchar_t *in);
|
||||
char *wcs2str(const wcstring &in);
|
||||
std::string wcs2string(const wcstring &input);
|
||||
|
||||
/** Test if a string prefixes another. Returns true if a is a prefix of b */
|
||||
@@ -253,10 +243,81 @@ bool string_prefixes_string(const wchar_t *proposed_prefix, const wcstring &valu
|
||||
bool string_suffixes_string(const wcstring &proposed_suffix, const wcstring &value);
|
||||
bool string_suffixes_string(const wchar_t *proposed_suffix, const wcstring &value);
|
||||
|
||||
|
||||
/** Test if a string prefixes another without regard to case. Returns true if a is a prefix of b */
|
||||
bool string_prefixes_string_case_insensitive(const wcstring &proposed_prefix, const wcstring &value);
|
||||
|
||||
enum fuzzy_match_type_t
|
||||
{
|
||||
/* We match the string exactly: FOOBAR matches FOOBAR */
|
||||
fuzzy_match_exact = 0,
|
||||
|
||||
/* We match a prefix of the string: FO matches FOOBAR */
|
||||
fuzzy_match_prefix,
|
||||
|
||||
/* We match the string exactly, but in a case insensitive way: foobar matches FOOBAR */
|
||||
fuzzy_match_case_insensitive,
|
||||
|
||||
/* We match a prefix of the string, in a case insensitive way: foo matches FOOBAR */
|
||||
fuzzy_match_prefix_case_insensitive,
|
||||
|
||||
/* We match a substring of the string: OOBA matches FOOBAR */
|
||||
fuzzy_match_substring,
|
||||
|
||||
/* A subsequence match with insertions only: FBR matches FOOBAR */
|
||||
fuzzy_match_subsequence_insertions_only,
|
||||
|
||||
/* We don't match the string */
|
||||
fuzzy_match_none
|
||||
};
|
||||
|
||||
/* Indicates where a match type requires replacing the entire token */
|
||||
static inline bool match_type_requires_full_replacement(fuzzy_match_type_t t)
|
||||
{
|
||||
switch (t)
|
||||
{
|
||||
case fuzzy_match_exact:
|
||||
case fuzzy_match_prefix:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* Indicates where a match shares a prefix with the string it matches */
|
||||
static inline bool match_type_shares_prefix(fuzzy_match_type_t t)
|
||||
{
|
||||
switch (t)
|
||||
{
|
||||
case fuzzy_match_exact:
|
||||
case fuzzy_match_prefix:
|
||||
case fuzzy_match_case_insensitive:
|
||||
case fuzzy_match_prefix_case_insensitive:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/** Test if string is a fuzzy match to another */
|
||||
struct string_fuzzy_match_t
|
||||
{
|
||||
enum fuzzy_match_type_t type;
|
||||
|
||||
/* Strength of the match. The value depends on the type. Lower is stronger. */
|
||||
size_t match_distance_first;
|
||||
size_t match_distance_second;
|
||||
|
||||
/* Constructor */
|
||||
string_fuzzy_match_t(enum fuzzy_match_type_t t, size_t distance_first = 0, size_t distance_second = 0);
|
||||
|
||||
/* Return -1, 0, 1 if this match is (respectively) better than, equal to, or worse than rhs */
|
||||
int compare(const string_fuzzy_match_t &rhs) const;
|
||||
};
|
||||
|
||||
/* Compute a fuzzy match for a string. If maximum_match is not fuzzy_match_none, limit the type to matches at or below that type. */
|
||||
string_fuzzy_match_t string_fuzzy_match_string(const wcstring &string, const wcstring &match_against, fuzzy_match_type_t limit_type = fuzzy_match_none);
|
||||
|
||||
|
||||
/** Test if a list contains a string using a linear search. */
|
||||
bool list_contains_string(const wcstring_list_t &list, const wcstring &str);
|
||||
|
||||
@@ -273,16 +334,6 @@ void assert_is_background_thread(const char *who);
|
||||
void assert_is_locked(void *mutex, const char *who, const char *caller);
|
||||
#define ASSERT_IS_LOCKED(x) assert_is_locked((void *)(&x), #x, __FUNCTION__)
|
||||
|
||||
/**
|
||||
Converts the wide character string \c in into it's narrow
|
||||
equivalent, stored in \c out. \c out must have enough space to fit
|
||||
the entire string.
|
||||
|
||||
This function decodes illegal character sequences in a reversible
|
||||
way using the private use area.
|
||||
*/
|
||||
char *wcs2str_internal( const wchar_t *in, char *out );
|
||||
|
||||
/** Format the specified size (in bytes, kilobytes, etc.) into the specified stringbuffer. */
|
||||
wcstring format_size(long long sz);
|
||||
|
||||
@@ -298,7 +349,8 @@ void format_long_safe(wchar_t buff[128], long val);
|
||||
|
||||
|
||||
template<typename T>
|
||||
T from_string(const wcstring &x) {
|
||||
T from_string(const wcstring &x)
|
||||
{
|
||||
T result;
|
||||
std::wstringstream stream(x);
|
||||
stream >> result;
|
||||
@@ -306,7 +358,8 @@ T from_string(const wcstring &x) {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T from_string(const std::string &x) {
|
||||
T from_string(const std::string &x)
|
||||
{
|
||||
T result = T();
|
||||
std::stringstream stream(x);
|
||||
stream >> result;
|
||||
@@ -314,7 +367,8 @@ T from_string(const std::string &x) {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
wcstring to_string(const T &x) {
|
||||
wcstring to_string(const T &x)
|
||||
{
|
||||
std::wstringstream stream;
|
||||
stream << x;
|
||||
return stream.str();
|
||||
@@ -322,150 +376,122 @@ wcstring to_string(const T &x) {
|
||||
|
||||
/* wstringstream is a huge memory pig. Let's provide some specializations where we can. */
|
||||
template<>
|
||||
inline wcstring to_string(const long &x) {
|
||||
inline wcstring to_string(const long &x)
|
||||
{
|
||||
wchar_t buff[128];
|
||||
format_long_safe(buff, x);
|
||||
return wcstring(buff);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline bool from_string(const std::string &x) {
|
||||
inline bool from_string(const std::string &x)
|
||||
{
|
||||
return ! x.empty() && strchr("YTyt1", x.at(0));
|
||||
}
|
||||
|
||||
template<>
|
||||
inline bool from_string(const wcstring &x) {
|
||||
inline bool from_string(const wcstring &x)
|
||||
{
|
||||
return ! x.empty() && wcschr(L"YTyt1", x.at(0));
|
||||
}
|
||||
|
||||
template<>
|
||||
inline wcstring to_string(const int &x) {
|
||||
inline wcstring to_string(const int &x)
|
||||
{
|
||||
return to_string(static_cast<long>(x));
|
||||
}
|
||||
|
||||
wchar_t **make_null_terminated_array(const wcstring_list_t &lst);
|
||||
char **make_null_terminated_array(const std::vector<std::string> &lst);
|
||||
|
||||
/* Helper class for managing a null-terminated array of null-terminated strings (of some char type) */
|
||||
template <typename CharType_t>
|
||||
class null_terminated_array_t {
|
||||
class null_terminated_array_t
|
||||
{
|
||||
CharType_t **array;
|
||||
|
||||
typedef std::basic_string<CharType_t> string_t;
|
||||
typedef std::vector<string_t> string_list_t;
|
||||
|
||||
void swap(null_terminated_array_t<CharType_t> &him) { std::swap(array, him.array); }
|
||||
/* No assignment or copying */
|
||||
void operator=(null_terminated_array_t rhs);
|
||||
null_terminated_array_t(const null_terminated_array_t &);
|
||||
|
||||
/* Silly function to get the length of a null terminated array of...something */
|
||||
template <typename T>
|
||||
static size_t count_not_null(const T *arr) {
|
||||
size_t len;
|
||||
for (len=0; arr[len] != T(0); len++)
|
||||
;
|
||||
return len;
|
||||
}
|
||||
typedef std::vector<std::basic_string<CharType_t> > string_list_t;
|
||||
|
||||
size_t size() const {
|
||||
return count_not_null(array);
|
||||
}
|
||||
|
||||
void free(void) {
|
||||
if (array != NULL) {
|
||||
for (size_t i = 0; array[i] != NULL; i++) {
|
||||
delete [] array[i];
|
||||
size_t size() const
|
||||
{
|
||||
size_t len = 0;
|
||||
if (array != NULL)
|
||||
{
|
||||
while (array[len] != NULL)
|
||||
{
|
||||
len++;
|
||||
}
|
||||
delete [] array;
|
||||
array = NULL;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
void free(void)
|
||||
{
|
||||
::free((void *)array);
|
||||
array = NULL;
|
||||
}
|
||||
|
||||
public:
|
||||
null_terminated_array_t() : array(NULL) { }
|
||||
null_terminated_array_t(const string_list_t &argv) : array(NULL) { this->set(argv); }
|
||||
~null_terminated_array_t() { this->free(); }
|
||||
|
||||
/** operator=. Notice the pass-by-value parameter. */
|
||||
null_terminated_array_t& operator=(null_terminated_array_t rhs) {
|
||||
if (this != &rhs)
|
||||
this->swap(rhs);
|
||||
return *this;
|
||||
null_terminated_array_t(const string_list_t &argv) : array(make_null_terminated_array(argv))
|
||||
{
|
||||
}
|
||||
|
||||
/* Copy constructor. */
|
||||
null_terminated_array_t(const null_terminated_array_t &him) : array(NULL) {
|
||||
this->set(him.array);
|
||||
}
|
||||
|
||||
void set(const string_list_t &argv) {
|
||||
/* Get rid of the old argv */
|
||||
this->free();
|
||||
|
||||
/* Allocate our null-terminated array of null-terminated strings */
|
||||
size_t i, count = argv.size();
|
||||
this->array = new CharType_t * [count + 1];
|
||||
for (i=0; i < count; i++) {
|
||||
const string_t &str = argv.at(i);
|
||||
this->array[i] = new CharType_t [1 + str.size()];
|
||||
std::copy(str.begin(), str.end(), this->array[i]);
|
||||
this->array[i][str.size()] = CharType_t(0);
|
||||
}
|
||||
this->array[count] = NULL;
|
||||
}
|
||||
|
||||
void set(const CharType_t * const *new_array) {
|
||||
if (new_array == array)
|
||||
return;
|
||||
|
||||
/* Get rid of the old argv */
|
||||
~null_terminated_array_t()
|
||||
{
|
||||
this->free();
|
||||
|
||||
/* Copy the new one */
|
||||
if (new_array) {
|
||||
size_t i, count = count_not_null(new_array);
|
||||
this->array = new CharType_t * [count + 1];
|
||||
for (i=0; i < count; i++) {
|
||||
size_t len = count_not_null(new_array[i]);
|
||||
this->array[i] = new CharType_t [1 + len];
|
||||
std::copy(new_array[i], new_array[i] + len, this->array[i]);
|
||||
this->array[i][len] = CharType_t(0);
|
||||
}
|
||||
this->array[count] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
CharType_t **get() { return array; }
|
||||
const CharType_t * const *get() const { return array; }
|
||||
|
||||
string_list_t to_list() const {
|
||||
string_list_t lst;
|
||||
if (array != NULL) {
|
||||
size_t count = this->size();
|
||||
lst.reserve(count);
|
||||
lst.insert(lst.end(), array, array + count);
|
||||
}
|
||||
return lst;
|
||||
|
||||
void set(const string_list_t &argv)
|
||||
{
|
||||
this->free();
|
||||
this->array = make_null_terminated_array(argv);
|
||||
}
|
||||
|
||||
const CharType_t * const *get() const
|
||||
{
|
||||
return array;
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
this->free();
|
||||
}
|
||||
};
|
||||
|
||||
/* Helper function to convert from a null_terminated_array_t<wchar_t> to a null_terminated_array_t<char_t> */
|
||||
null_terminated_array_t<char> convert_wide_array_to_narrow(const null_terminated_array_t<wchar_t> &arr);
|
||||
void convert_wide_array_to_narrow(const null_terminated_array_t<wchar_t> &arr, null_terminated_array_t<char> *output);
|
||||
|
||||
/* Helper class to cache a narrow version of a wcstring in a malloc'd buffer, so that we can read it after fork() */
|
||||
class narrow_string_rep_t {
|
||||
private:
|
||||
class narrow_string_rep_t
|
||||
{
|
||||
private:
|
||||
const char *str;
|
||||
|
||||
public:
|
||||
~narrow_string_rep_t() {
|
||||
|
||||
/* No copying */
|
||||
narrow_string_rep_t &operator=(const narrow_string_rep_t &);
|
||||
narrow_string_rep_t(const narrow_string_rep_t &x);
|
||||
|
||||
public:
|
||||
~narrow_string_rep_t()
|
||||
{
|
||||
free((void *)str);
|
||||
}
|
||||
|
||||
|
||||
narrow_string_rep_t() : str(NULL) {}
|
||||
|
||||
void set(const wcstring &s) {
|
||||
|
||||
void set(const wcstring &s)
|
||||
{
|
||||
free((void *)str);
|
||||
str = wcs2str(s.c_str());
|
||||
}
|
||||
|
||||
const char *get() const {
|
||||
|
||||
const char *get() const
|
||||
{
|
||||
return str;
|
||||
}
|
||||
};
|
||||
@@ -473,9 +499,15 @@ class narrow_string_rep_t {
|
||||
bool is_forked_child();
|
||||
|
||||
/* Basic scoped lock class */
|
||||
class scoped_lock {
|
||||
class scoped_lock
|
||||
{
|
||||
pthread_mutex_t *lock_obj;
|
||||
bool locked;
|
||||
|
||||
/* No copying */
|
||||
scoped_lock &operator=(const scoped_lock &);
|
||||
scoped_lock(const scoped_lock &);
|
||||
|
||||
public:
|
||||
void lock(void);
|
||||
void unlock(void);
|
||||
@@ -483,31 +515,64 @@ class scoped_lock {
|
||||
~scoped_lock();
|
||||
};
|
||||
|
||||
class wcstokenizer {
|
||||
wchar_t *buffer, *str, *state;
|
||||
const wcstring sep;
|
||||
|
||||
|
||||
/**
|
||||
A scoped manager to save the current value of some variable, and optionally
|
||||
set it to a new value. On destruction it restores the variable to its old
|
||||
value.
|
||||
|
||||
This can be handy when there are multiple code paths to exit a block.
|
||||
*/
|
||||
template <typename T>
|
||||
class scoped_push
|
||||
{
|
||||
T * const ref;
|
||||
T saved_value;
|
||||
bool restored;
|
||||
|
||||
public:
|
||||
wcstokenizer(const wcstring &s, const wcstring &separator) : sep(separator) {
|
||||
wchar_t *wcsdup(const wchar_t *s);
|
||||
buffer = wcsdup(s.c_str());
|
||||
str = buffer;
|
||||
state = NULL;
|
||||
scoped_push(T *r): ref(r), saved_value(*r), restored(false)
|
||||
{
|
||||
}
|
||||
|
||||
bool next(wcstring &result) {
|
||||
wchar_t *tmp = wcstok(str, sep.c_str(), &state);
|
||||
str = NULL;
|
||||
if (tmp) result = tmp;
|
||||
return tmp != NULL;
|
||||
scoped_push(T *r, const T &new_value) : ref(r), saved_value(*r), restored(false)
|
||||
{
|
||||
*r = new_value;
|
||||
}
|
||||
|
||||
~wcstokenizer() {
|
||||
free(buffer);
|
||||
|
||||
~scoped_push()
|
||||
{
|
||||
restore();
|
||||
}
|
||||
|
||||
void restore()
|
||||
{
|
||||
if (!restored)
|
||||
{
|
||||
std::swap(*ref, saved_value);
|
||||
restored = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
/* Wrapper around wcstok */
|
||||
class wcstokenizer
|
||||
{
|
||||
wchar_t *buffer, *str, *state;
|
||||
const wcstring sep;
|
||||
|
||||
/* No copying */
|
||||
wcstokenizer &operator=(const wcstokenizer &);
|
||||
wcstokenizer(const wcstokenizer &);
|
||||
|
||||
public:
|
||||
wcstokenizer(const wcstring &s, const wcstring &separator);
|
||||
bool next(wcstring &result);
|
||||
~wcstokenizer();
|
||||
};
|
||||
|
||||
/**
|
||||
Appends a path component, with a / if necessary
|
||||
*/
|
||||
void append_path_component(wcstring &path, const wcstring &component);
|
||||
@@ -515,43 +580,44 @@ void append_path_component(wcstring &path, const wcstring &component);
|
||||
wcstring format_string(const wchar_t *format, ...);
|
||||
wcstring vformat_string(const wchar_t *format, va_list va_orig);
|
||||
void append_format(wcstring &str, const wchar_t *format, ...);
|
||||
void append_formatv(wcstring &str, const wchar_t *format, va_list ap);
|
||||
|
||||
/**
|
||||
Returns a newly allocated wide character string array equivalent of
|
||||
the specified multibyte character string array
|
||||
*/
|
||||
char **wcsv2strv( const wchar_t * const *in );
|
||||
char **wcsv2strv(const wchar_t * const *in);
|
||||
|
||||
/**
|
||||
Test if the given string is a valid variable name.
|
||||
Test if the given string is a valid variable name.
|
||||
|
||||
\return null if this is a valid name, and a pointer to the first invalid character otherwise
|
||||
*/
|
||||
|
||||
wchar_t *wcsvarname( const wchar_t *str );
|
||||
wchar_t *wcsvarname(const wchar_t *str);
|
||||
|
||||
|
||||
/**
|
||||
Test if the given string is a valid function name.
|
||||
Test if the given string is a valid function name.
|
||||
|
||||
\return null if this is a valid name, and a pointer to the first invalid character otherwise
|
||||
*/
|
||||
|
||||
const wchar_t *wcsfuncname( const wchar_t *str );
|
||||
const wchar_t *wcsfuncname(const wchar_t *str);
|
||||
|
||||
/**
|
||||
Test if the given string is valid in a variable name
|
||||
Test if the given string is valid in a variable name
|
||||
|
||||
\return 1 if this is a valid name, 0 otherwise
|
||||
*/
|
||||
|
||||
int wcsvarchr( wchar_t chr );
|
||||
int wcsvarchr(wchar_t chr);
|
||||
|
||||
|
||||
/**
|
||||
A wcswidth workalike. Fish uses this since the regular wcswidth seems flaky.
|
||||
*/
|
||||
int my_wcswidth( const wchar_t *c );
|
||||
int my_wcswidth(const wchar_t *c);
|
||||
|
||||
/**
|
||||
This functions returns the end of the quoted substring beginning at
|
||||
@@ -560,7 +626,7 @@ int my_wcswidth( const wchar_t *c );
|
||||
|
||||
\param in the position of the opening quote
|
||||
*/
|
||||
wchar_t *quote_end( const wchar_t *in );
|
||||
wchar_t *quote_end(const wchar_t *in);
|
||||
|
||||
/**
|
||||
A call to this function will reset the error counter. Some
|
||||
@@ -576,35 +642,35 @@ void error_reset();
|
||||
This function behaves exactly like a wide character equivalent of
|
||||
the C function setlocale, except that it will also try to detect if
|
||||
the user is using a Unicode character set, and if so, use the
|
||||
unicode ellipsis character as ellipsis, instead of '$'.
|
||||
unicode ellipsis character as ellipsis, instead of '$'.
|
||||
*/
|
||||
wcstring wsetlocale( int category, const wchar_t *locale );
|
||||
wcstring wsetlocale(int category, const wchar_t *locale);
|
||||
|
||||
/**
|
||||
Checks if \c needle is included in the list of strings specified. A warning is printed if needle is zero.
|
||||
|
||||
\param needle the string to search for in the list
|
||||
\param needle the string to search for in the list
|
||||
|
||||
\return zero if needle is not found, of if needle is null, non-zero otherwise
|
||||
*/
|
||||
__sentinel bool contains_internal( const wchar_t *needle, ... );
|
||||
__sentinel bool contains_internal( const wcstring &needle, ... );
|
||||
__sentinel bool contains_internal(const wchar_t *needle, ...);
|
||||
__sentinel bool contains_internal(const wcstring &needle, ...);
|
||||
|
||||
/**
|
||||
Call read while blocking the SIGCHLD signal. Should only be called
|
||||
if you _know_ there is data available for reading, or the program
|
||||
will hang until there is data.
|
||||
*/
|
||||
int read_blocked(int fd, void *buf, size_t count);
|
||||
long read_blocked(int fd, void *buf, size_t count);
|
||||
|
||||
/**
|
||||
Loop a write request while failiure is non-critical. Return -1 and set errno
|
||||
Loop a write request while failure is non-critical. Return -1 and set errno
|
||||
in case of critical error.
|
||||
*/
|
||||
ssize_t write_loop(int fd, const char *buff, size_t count);
|
||||
|
||||
/**
|
||||
Loop a read request while failiure is non-critical. Return -1 and set errno
|
||||
Loop a read request while failure is non-critical. Return -1 and set errno
|
||||
in case of critical error.
|
||||
*/
|
||||
ssize_t read_loop(int fd, void *buff, size_t count);
|
||||
@@ -618,9 +684,9 @@ ssize_t read_loop(int fd, void *buff, size_t count);
|
||||
Because debug is often called to tell the user about an error,
|
||||
before using wperror to give a specific error message, debug will
|
||||
never ever modify the value of errno.
|
||||
|
||||
|
||||
\param level the priority of the message. Lower number means higher priority. Messages with a priority_number higher than \c debug_level will be ignored..
|
||||
\param msg the message format string.
|
||||
\param msg the message format string.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -628,19 +694,20 @@ ssize_t read_loop(int fd, void *buff, size_t count);
|
||||
|
||||
will print the string 'fish: Pi = 3.141', given that debug_level is 1 or higher, and that program_name is 'fish'.
|
||||
*/
|
||||
void debug( int level, const wchar_t *msg, ... );
|
||||
void debug(int level, const char *msg, ...);
|
||||
void debug(int level, const wchar_t *msg, ...);
|
||||
|
||||
/**
|
||||
Replace special characters with backslash escape sequences. Newline is
|
||||
replaced with \n, etc.
|
||||
replaced with \n, etc.
|
||||
|
||||
\param in The string to be escaped
|
||||
\param escape_all Whether all characters wich hold special meaning in fish (Pipe, semicolon, etc,) should be escaped, or only unprintable characters
|
||||
\return The escaped string, or 0 if there is not enough memory
|
||||
*/
|
||||
|
||||
wchar_t *escape( const wchar_t *in, int escape_all );
|
||||
wcstring escape_string( const wcstring &in, int escape_all );
|
||||
wchar_t *escape(const wchar_t *in, escape_flags_t flags);
|
||||
wcstring escape_string(const wcstring &in, escape_flags_t flags);
|
||||
|
||||
/**
|
||||
Expand backslashed escapes and substitute them with their unescaped
|
||||
@@ -653,14 +720,14 @@ wcstring escape_string( const wcstring &in, int escape_all );
|
||||
an invalid sequence is specified, 0 is returned.
|
||||
|
||||
*/
|
||||
wchar_t *unescape( const wchar_t * in,
|
||||
int escape_special );
|
||||
wchar_t *unescape(const wchar_t * in,
|
||||
int escape_special);
|
||||
|
||||
bool unescape_string( wcstring &str,
|
||||
int escape_special );
|
||||
bool unescape_string(wcstring &str,
|
||||
int escape_special);
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
Returns the width of the terminal window, so that not all
|
||||
functions that use these values continually have to keep track of
|
||||
it separately.
|
||||
@@ -682,20 +749,20 @@ int common_get_height();
|
||||
saving it in an internal variable used by common_get_wisth and
|
||||
common_get_height().
|
||||
*/
|
||||
void common_handle_winch( int signal );
|
||||
void common_handle_winch(int signal);
|
||||
|
||||
/**
|
||||
Write paragraph of output to the specified stringbuffer, and redo
|
||||
the linebreaks to fit the current screen.
|
||||
*/
|
||||
void write_screen( const wcstring &msg, wcstring &buff );
|
||||
void write_screen(const wcstring &msg, wcstring &buff);
|
||||
|
||||
/**
|
||||
Tokenize the specified string into the specified wcstring_list_t.
|
||||
Tokenize the specified string into the specified wcstring_list_t.
|
||||
\param val the input string. The contents of this string is not changed.
|
||||
\param out the list in which to place the elements.
|
||||
\param out the list in which to place the elements.
|
||||
*/
|
||||
void tokenize_variable_array( const wcstring &val, wcstring_list_t &out);
|
||||
void tokenize_variable_array(const wcstring &val, wcstring_list_t &out);
|
||||
|
||||
/**
|
||||
Make sure the specified direcotry exists. If needed, try to create
|
||||
@@ -703,7 +770,7 @@ void tokenize_variable_array( const wcstring &val, wcstring_list_t &out);
|
||||
|
||||
\return 0 if, at the time of function return the directory exists, -1 otherwise.
|
||||
*/
|
||||
int create_directory( const wcstring &d );
|
||||
int create_directory(const wcstring &d);
|
||||
|
||||
/**
|
||||
Print a short message about how to file a bug report to stderr
|
||||
@@ -732,6 +799,10 @@ void configure_thread_assertions_for_testing();
|
||||
/** Set up a guard to complain if we try to do certain things (like take a lock) after calling fork */
|
||||
void setup_fork_guards(void);
|
||||
|
||||
/** Save the value of tcgetpgrp so we can restore it on exit */
|
||||
void save_term_foreground_process_group(void);
|
||||
void restore_term_foreground_process_group(void);
|
||||
|
||||
/** Return whether we are the child of a fork */
|
||||
bool is_forked_child(void);
|
||||
void assert_is_not_forked_child(const char *who);
|
||||
@@ -739,8 +810,10 @@ void assert_is_not_forked_child(const char *who);
|
||||
#define ASSERT_IS_NOT_FORKED_CHILD() ASSERT_IS_NOT_FORKED_CHILD_TRAMPOLINE(__FUNCTION__)
|
||||
|
||||
extern "C" {
|
||||
__attribute__((noinline)) void debug_thread_error(void);
|
||||
__attribute__((noinline)) void debug_thread_error(void);
|
||||
}
|
||||
|
||||
/** Return the path of an appropriate runtime data directory */
|
||||
std::string common_get_runtime_path();
|
||||
|
||||
#endif
|
||||
|
||||
2552
complete.cpp
2552
complete.cpp
File diff suppressed because it is too large
Load Diff
281
complete.h
281
complete.h
@@ -1,8 +1,8 @@
|
||||
/** \file complete.h
|
||||
Prototypes for functions related to tab-completion.
|
||||
Prototypes for functions related to tab-completion.
|
||||
|
||||
These functions are used for storing and retrieving tab-completion
|
||||
data, as well as for performing tab-completion.
|
||||
These functions are used for storing and retrieving tab-completion
|
||||
data, as well as for performing tab-completion.
|
||||
*/
|
||||
|
||||
#ifndef FISH_COMPLETE_H
|
||||
@@ -17,89 +17,76 @@
|
||||
|
||||
#include "util.h"
|
||||
#include "common.h"
|
||||
/**
|
||||
Use all completions
|
||||
*/
|
||||
/**
|
||||
* Use all completions
|
||||
*/
|
||||
#define SHARED 0
|
||||
/**
|
||||
Do not use file completion
|
||||
*/
|
||||
/**
|
||||
* Do not use file completion
|
||||
*/
|
||||
#define NO_FILES 1
|
||||
/**
|
||||
Require a parameter after completion
|
||||
*/
|
||||
/**
|
||||
* Require a parameter after completion
|
||||
*/
|
||||
#define NO_COMMON 2
|
||||
/**
|
||||
Only use the argument list specifies with completion after
|
||||
option. This is the same as (NO_FILES & NO_COMMON)
|
||||
*/
|
||||
/**
|
||||
* Only use the argument list specifies with completion after
|
||||
* option. This is the same as (NO_FILES & NO_COMMON)
|
||||
*/
|
||||
#define EXCLUSIVE 3
|
||||
|
||||
/**
|
||||
Command is a path
|
||||
*/
|
||||
/**
|
||||
* Command is a path
|
||||
*/
|
||||
#define PATH 1
|
||||
/**
|
||||
Command is not a path
|
||||
*/
|
||||
/**
|
||||
* Command is not a path
|
||||
*/
|
||||
#define COMMAND 0
|
||||
|
||||
/**
|
||||
Separator between completion and description
|
||||
*/
|
||||
/**
|
||||
* Separator between completion and description
|
||||
*/
|
||||
#define COMPLETE_SEP L'\004'
|
||||
|
||||
/**
|
||||
Separator between completion and description
|
||||
*/
|
||||
/**
|
||||
* Separator between completion and description
|
||||
*/
|
||||
#define COMPLETE_SEP_STR L"\004"
|
||||
|
||||
/**
|
||||
Separator between completion items in fish_pager. This is used for
|
||||
completion grouping, e.g. when putting completions with the same
|
||||
descriptions on the same line.
|
||||
*/
|
||||
* Separator between completion items in fish_pager. This is used for
|
||||
* completion grouping, e.g. when putting completions with the same
|
||||
* descriptions on the same line.
|
||||
*/
|
||||
#define COMPLETE_ITEM_SEP L'\uf500'
|
||||
|
||||
/**
|
||||
Character that separates the completion and description on
|
||||
programmable completions
|
||||
*/
|
||||
* Character that separates the completion and description on
|
||||
* programmable completions
|
||||
*/
|
||||
#define PROG_COMPLETE_SEP L'\t'
|
||||
|
||||
enum {
|
||||
enum
|
||||
{
|
||||
/**
|
||||
Do not insert space afterwards if this is the only completion. (The
|
||||
default is to try insert a space)
|
||||
*/
|
||||
COMPLETE_NO_SPACE = 1 << 0,
|
||||
|
||||
/**
|
||||
This compeltion is case insensitive.
|
||||
/** This is not the suffix of a token, but replaces it entirely */
|
||||
COMPLETE_REPLACES_TOKEN = 1 << 2,
|
||||
|
||||
Warning: The contents of the completion_t structure is actually
|
||||
different if this flag is set! Specifically, the completion string
|
||||
contains the _entire_ completion token, not only the current
|
||||
*/
|
||||
COMPLETE_NO_CASE = 1 << 1,
|
||||
|
||||
/**
|
||||
This compeltion is the whole argument, not just the remainder. This
|
||||
flag must never be set on completions returned from the complete()
|
||||
function. It is strictly for internal use in the completion code.
|
||||
*/
|
||||
COMPLETE_WHOLE_ARGUMENT = 1 << 2,
|
||||
|
||||
/**
|
||||
This completion may or may not want a space at the end - guess by
|
||||
checking the last character of the completion.
|
||||
*/
|
||||
/** This completion may or may not want a space at the end - guess by
|
||||
checking the last character of the completion. */
|
||||
COMPLETE_AUTO_SPACE = 1 << 3,
|
||||
|
||||
/**
|
||||
This completion should be inserted as-is, without escaping.
|
||||
*/
|
||||
COMPLETE_DONT_ESCAPE = 1 << 4
|
||||
/** This completion should be inserted as-is, without escaping. */
|
||||
COMPLETE_DONT_ESCAPE = 1 << 4,
|
||||
|
||||
/** If you do escape, don't escape tildes */
|
||||
COMPLETE_DONT_ESCAPE_TILDES = 1 << 5
|
||||
};
|
||||
typedef int complete_flags_t;
|
||||
|
||||
@@ -109,65 +96,68 @@ class completion_t
|
||||
|
||||
private:
|
||||
/* No public default constructor */
|
||||
completion_t(){ }
|
||||
completion_t();
|
||||
public:
|
||||
|
||||
/**
|
||||
The completion string
|
||||
*/
|
||||
wcstring completion;
|
||||
/* Destructor. Not inlining it saves code size. */
|
||||
~completion_t();
|
||||
|
||||
/**
|
||||
The description for this completion
|
||||
*/
|
||||
wcstring description;
|
||||
/** The completion string */
|
||||
wcstring completion;
|
||||
|
||||
/**
|
||||
Flags determining the completion behaviour.
|
||||
/** The description for this completion */
|
||||
wcstring description;
|
||||
|
||||
Determines whether a space should be inserted after this
|
||||
compeltion if it is the only possible completion using the
|
||||
COMPLETE_NO_SPACE flag.
|
||||
/** The type of fuzzy match */
|
||||
string_fuzzy_match_t match;
|
||||
|
||||
The COMPLETE_NO_CASE can be used to signal that this completion
|
||||
is case insensitive.
|
||||
*/
|
||||
int flags;
|
||||
/**
|
||||
Flags determining the completion behaviour.
|
||||
|
||||
Determines whether a space should be inserted after this
|
||||
completion if it is the only possible completion using the
|
||||
COMPLETE_NO_SPACE flag.
|
||||
|
||||
The COMPLETE_NO_CASE can be used to signal that this completion
|
||||
is case insensitive.
|
||||
*/
|
||||
int flags;
|
||||
|
||||
/* Construction. Note: defining these so that they are not inlined reduces the executable size. */
|
||||
completion_t(const wcstring &comp, const wcstring &desc = L"", string_fuzzy_match_t match = string_fuzzy_match_t(fuzzy_match_exact), int flags_val = 0);
|
||||
completion_t(const completion_t &);
|
||||
completion_t &operator=(const completion_t &);
|
||||
|
||||
completion_t(const wcstring &comp, const wcstring &desc = L"", int flags_val = 0) : completion(comp), description(desc), flags(flags_val) {
|
||||
if( flags & COMPLETE_AUTO_SPACE )
|
||||
{
|
||||
flags = flags & ~COMPLETE_AUTO_SPACE;
|
||||
size_t len = completion.size();
|
||||
if (len > 0 && ( wcschr( L"/=@:", comp.at(len-1)) != 0 ))
|
||||
flags |= COMPLETE_NO_SPACE;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
bool operator < (const completion_t& rhs) const { return this->completion < rhs.completion; }
|
||||
bool operator == (const completion_t& rhs) const { return this->completion == rhs.completion; }
|
||||
bool operator != (const completion_t& rhs) const { return ! (*this == rhs); }
|
||||
/* Compare two completions. No operating overlaoding to make this always explicit (there's potentially multiple ways to compare completions). */
|
||||
static bool is_alphabetically_less_than(const completion_t &a, const completion_t &b);
|
||||
static bool is_alphabetically_equal_to(const completion_t &a, const completion_t &b);
|
||||
};
|
||||
|
||||
enum complete_type_t {
|
||||
COMPLETE_DEFAULT,
|
||||
COMPLETE_AUTOSUGGEST
|
||||
enum
|
||||
{
|
||||
COMPLETION_REQUEST_DEFAULT = 0,
|
||||
COMPLETION_REQUEST_AUTOSUGGESTION = 1 << 0, // indicates the completion is for an autosuggestion
|
||||
COMPLETION_REQUEST_DESCRIPTIONS = 1 << 1, // indicates that we want descriptions
|
||||
COMPLETION_REQUEST_FUZZY_MATCH = 1 << 2 // indicates that we don't require a prefix match
|
||||
};
|
||||
typedef uint32_t completion_request_flags_t;
|
||||
|
||||
/** Given a list of completions, returns a list of their completion fields */
|
||||
wcstring_list_t completions_to_wcstring_list(const std::vector<completion_t> &completions);
|
||||
|
||||
/**
|
||||
|
||||
Add a completion.
|
||||
Add a completion.
|
||||
|
||||
All supplied values are copied, they should be freed by or otherwise
|
||||
disposed by the caller.
|
||||
|
||||
Examples:
|
||||
|
||||
Examples:
|
||||
|
||||
The command 'gcc -o' requires that a file follows it, so the
|
||||
NO_COMMON option is suitable. This can be done using the following
|
||||
line:
|
||||
|
||||
|
||||
complete -c gcc -s o -r
|
||||
|
||||
The command 'grep -d' required that one of the strings 'read',
|
||||
@@ -180,74 +170,83 @@ enum complete_type_t {
|
||||
|
||||
\param cmd Command to complete.
|
||||
\param cmd_type If cmd_type is PATH, cmd will be interpreted as the absolute
|
||||
path of the program (optionally containing wildcards), otherwise it
|
||||
will be interpreted as the command name.
|
||||
\param short_opt The single character name of an option. (-a is a short option, --all and -funroll are long options)
|
||||
\param long_opt The multi character name of an option. (-a is a short option, --all and -funroll are long options)
|
||||
\param long_mode Whether to use old style, single dash long options.
|
||||
path of the program (optionally containing wildcards), otherwise it
|
||||
will be interpreted as the command name.
|
||||
\param short_opt The single character name of an option. (-a is a short option,
|
||||
--all and -funroll are long options)
|
||||
\param long_opt The multi character name of an option. (-a is a short option,
|
||||
--all and -funroll are long options)
|
||||
\param long_mode Whether to use old style, single dash long options.
|
||||
\param result_mode Whether to search further completions when this
|
||||
completion has been succesfully matched. If result_mode is SHARED,
|
||||
any other completions may also be used. If result_mode is NO_FILES,
|
||||
file completion should not be used, but other completions may be
|
||||
used. If result_mode is NO_COMMON, on option may follow it - only a
|
||||
parameter. If result_mode is EXCLUSIVE, no option may follow it, and
|
||||
file completion is not performed.
|
||||
completion has been succesfully matched. If result_mode is SHARED,
|
||||
any other completions may also be used. If result_mode is NO_FILES,
|
||||
file completion should not be used, but other completions may be
|
||||
used. If result_mode is NO_COMMON, on option may follow it - only a
|
||||
parameter. If result_mode is EXCLUSIVE, no option may follow it, and
|
||||
file completion is not performed.
|
||||
\param comp A space separated list of completions which may contain subshells.
|
||||
\param desc A description of the completion.
|
||||
\param condition a command to be run to check it this completion should be used. If \c condition is empty, the completion is always used.
|
||||
\param condition a command to be run to check it this completion should be used.
|
||||
If \c condition is empty, the completion is always used.
|
||||
\param flags A set of completion flags
|
||||
*/
|
||||
void complete_add( const wchar_t *cmd,
|
||||
bool cmd_is_path,
|
||||
wchar_t short_opt,
|
||||
const wchar_t *long_opt,
|
||||
int long_mode,
|
||||
int result_mode,
|
||||
const wchar_t *condition,
|
||||
const wchar_t *comp,
|
||||
const wchar_t *desc,
|
||||
int flags );
|
||||
void complete_add(const wchar_t *cmd,
|
||||
bool cmd_is_path,
|
||||
wchar_t short_opt,
|
||||
const wchar_t *long_opt,
|
||||
int long_mode,
|
||||
int result_mode,
|
||||
const wchar_t *condition,
|
||||
const wchar_t *comp,
|
||||
const wchar_t *desc,
|
||||
int flags);
|
||||
/**
|
||||
Sets whether the completion list for this command is complete. If
|
||||
true, any options not matching one of the provided options will be
|
||||
flagged as an error by syntax highlighting.
|
||||
*/
|
||||
void complete_set_authoritative( const wchar_t *cmd, bool cmd_type, bool authoritative );
|
||||
void complete_set_authoritative(const wchar_t *cmd, bool cmd_type, bool authoritative);
|
||||
|
||||
/**
|
||||
Remove a previously defined completion
|
||||
*/
|
||||
void complete_remove( const wchar_t *cmd,
|
||||
bool cmd_is_path,
|
||||
wchar_t short_opt,
|
||||
const wchar_t *long_opt );
|
||||
void complete_remove(const wchar_t *cmd,
|
||||
bool cmd_is_path,
|
||||
wchar_t short_opt,
|
||||
const wchar_t *long_opt);
|
||||
|
||||
|
||||
/** Find all completions of the command cmd, insert them into out. If to_load is not NULL, append all commands that we would autoload, but did not (presumably because this is not the main thread) */
|
||||
void complete( const wcstring &cmd, std::vector<completion_t> &comp, complete_type_t type, wcstring_list_t *to_load = NULL );
|
||||
/** Find all completions of the command cmd, insert them into out. If to_load is
|
||||
* not NULL, append all commands that we would autoload, but did not (presumably
|
||||
* because this is not the main thread)
|
||||
*/
|
||||
void complete(const wcstring &cmd,
|
||||
std::vector<completion_t> &comp,
|
||||
completion_request_flags_t flags,
|
||||
wcstring_list_t *to_load = NULL);
|
||||
|
||||
/**
|
||||
Print a list of all current completions into the string.
|
||||
Print a list of all current completions into the string.
|
||||
|
||||
\param out The string to write completions to
|
||||
*/
|
||||
void complete_print( wcstring &out );
|
||||
void complete_print(wcstring &out);
|
||||
|
||||
/**
|
||||
Tests if the specified option is defined for the specified command
|
||||
*/
|
||||
int complete_is_valid_option( const wchar_t *str,
|
||||
const wchar_t *opt,
|
||||
wcstring_list_t *inErrorsOrNull,
|
||||
bool allow_autoload );
|
||||
int complete_is_valid_option(const wcstring &str,
|
||||
const wcstring &opt,
|
||||
wcstring_list_t *inErrorsOrNull,
|
||||
bool allow_autoload);
|
||||
|
||||
/**
|
||||
Tests if the specified argument is valid for the specified option
|
||||
and command
|
||||
*/
|
||||
int complete_is_valid_argument( const wchar_t *str,
|
||||
const wchar_t *opt,
|
||||
const wchar_t *arg );
|
||||
bool complete_is_valid_argument(const wcstring &str,
|
||||
const wcstring &opt,
|
||||
const wcstring &arg);
|
||||
|
||||
|
||||
/**
|
||||
@@ -257,9 +256,11 @@ int complete_is_valid_argument( const wchar_t *str,
|
||||
with internal dependencies.
|
||||
|
||||
\param cmd the command for which to load command-specific completions
|
||||
\param reload should the commands completions be reloaded, even if they where previously loaded. (This is set to true on actual completions, so that changed completion are updated in running shells)
|
||||
\param reload should the commands completions be reloaded, even if they where
|
||||
previously loaded. (This is set to true on actual completions, so that
|
||||
changed completion are updated in running shells)
|
||||
*/
|
||||
void complete_load( const wcstring &cmd, bool reload );
|
||||
void complete_load(const wcstring &cmd, bool reload);
|
||||
|
||||
/**
|
||||
Create a new completion entry
|
||||
@@ -270,7 +271,9 @@ void complete_load( const wcstring &cmd, bool reload );
|
||||
\param flags completion flags
|
||||
|
||||
*/
|
||||
void completion_allocate(std::vector<completion_t> &completions, const wcstring &comp, const wcstring &desc, int flags);
|
||||
void append_completion(std::vector<completion_t> &completions, const wcstring &comp, const wcstring &desc = L"", int flags = 0, string_fuzzy_match_t match = string_fuzzy_match_t(fuzzy_match_exact));
|
||||
|
||||
/* Function used for testing */
|
||||
void complete_set_variable_names(const wcstring_list_t *names);
|
||||
|
||||
#endif
|
||||
|
||||
570
config.guess
vendored
570
config.guess
vendored
@@ -1,10 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
|
||||
# Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
# 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2006-02-27'
|
||||
timestamp='2012-02-10'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -17,9 +17,7 @@ timestamp='2006-02-27'
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
@@ -27,16 +25,16 @@ timestamp='2006-02-27'
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
|
||||
# Originally written by Per Bothner <per@bothner.com>.
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted ChangeLog entry.
|
||||
# Originally written by Per Bothner. Please send patches (context
|
||||
# diff format) to <config-patches@gnu.org> and include a ChangeLog
|
||||
# entry.
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
# exits with 0. Otherwise, it exits with 1.
|
||||
#
|
||||
# The plan is that this can be called by configure scripts if you
|
||||
# don't specify an explicit build system type.
|
||||
# You can get the latest version of this script from:
|
||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
|
||||
|
||||
me=`echo "$0" | sed -e 's,.*/,,'`
|
||||
|
||||
@@ -56,7 +54,8 @@ version="\
|
||||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
@@ -144,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
*:NetBSD:*:*)
|
||||
# NetBSD (nbsd) targets should (where applicable) match one or
|
||||
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
|
||||
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
|
||||
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
|
||||
# switched to ELF, *-*-netbsd* would select the old
|
||||
# object file format. This provides both forward
|
||||
@@ -161,6 +160,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
arm*) machine=arm-unknown ;;
|
||||
sh3el) machine=shl-unknown ;;
|
||||
sh3eb) machine=sh-unknown ;;
|
||||
sh5el) machine=sh5le-unknown ;;
|
||||
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
|
||||
esac
|
||||
# The Operating System including object format, if it has switched
|
||||
@@ -169,7 +169,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
|
||||
eval $set_cc_for_build
|
||||
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep __ELF__ >/dev/null
|
||||
| grep -q __ELF__
|
||||
then
|
||||
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
|
||||
# Return netbsd for either. FIX?
|
||||
@@ -179,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
os=netbsd
|
||||
os=netbsd
|
||||
;;
|
||||
esac
|
||||
# The OS release
|
||||
@@ -211,7 +211,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
|
||||
exit ;;
|
||||
macppc:MirBSD:*:*)
|
||||
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
|
||||
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:MirBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
|
||||
@@ -222,7 +222,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
|
||||
;;
|
||||
*5.*)
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
|
||||
;;
|
||||
esac
|
||||
# According to Compaq, /usr/sbin/psrinfo has been available on
|
||||
@@ -268,7 +268,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
# A Xn.n version is an unreleased experimental baselevel.
|
||||
# 1.2 uses "1.2" for uname -r.
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
exit ;;
|
||||
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
|
||||
exitcode=$?
|
||||
trap '' 0
|
||||
exit $exitcode ;;
|
||||
Alpha\ *:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# Should we change UNAME_MACHINE based on the output of uname instead
|
||||
@@ -294,7 +297,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
echo s390-ibm-zvmoe
|
||||
exit ;;
|
||||
*:OS400:*:*)
|
||||
echo powerpc-ibm-os400
|
||||
echo powerpc-ibm-os400
|
||||
exit ;;
|
||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
@@ -323,14 +326,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
case `/usr/bin/uname -p` in
|
||||
sparc) echo sparc-icl-nx7; exit ;;
|
||||
esac ;;
|
||||
s390x:SunOS:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
sun4H:SunOS:5.*:*)
|
||||
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
i86pc:SunOS:5.*:*)
|
||||
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
|
||||
echo i386-pc-auroraux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
|
||||
eval $set_cc_for_build
|
||||
SUN_ARCH="i386"
|
||||
# If there is a compiler, see if it is configured for 64-bit objects.
|
||||
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
|
||||
# This test works for both compilers.
|
||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
||||
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
|
||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
||||
grep IS_64BIT_ARCH >/dev/null
|
||||
then
|
||||
SUN_ARCH="x86_64"
|
||||
fi
|
||||
fi
|
||||
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
sun4*:SunOS:6*:*)
|
||||
# According to config.sub, this is the proper way to canonicalize
|
||||
@@ -374,23 +396,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
# MiNT. But MiNT is downward compatible to TOS, so this should
|
||||
# be no problem.
|
||||
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
exit ;;
|
||||
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
|
||||
echo m68k-milan-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
echo m68k-milan-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
|
||||
echo m68k-hades-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
echo m68k-hades-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
|
||||
echo m68k-unknown-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
echo m68k-unknown-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
m68k:machten:*:*)
|
||||
echo m68k-apple-machten${UNAME_RELEASE}
|
||||
exit ;;
|
||||
@@ -460,8 +482,8 @@ EOF
|
||||
echo m88k-motorola-sysv3
|
||||
exit ;;
|
||||
AViiON:dgux:*:*)
|
||||
# DG/UX returns AViiON for all architectures
|
||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
||||
# DG/UX returns AViiON for all architectures
|
||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
||||
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
|
||||
then
|
||||
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
|
||||
@@ -474,7 +496,7 @@ EOF
|
||||
else
|
||||
echo i586-dg-dgux${UNAME_RELEASE}
|
||||
fi
|
||||
exit ;;
|
||||
exit ;;
|
||||
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
|
||||
echo m88k-dolphin-sysv3
|
||||
exit ;;
|
||||
@@ -531,7 +553,7 @@ EOF
|
||||
echo rs6000-ibm-aix3.2
|
||||
fi
|
||||
exit ;;
|
||||
*:AIX:*:[45])
|
||||
*:AIX:*:[4567])
|
||||
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
|
||||
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
|
||||
IBM_ARCH=rs6000
|
||||
@@ -574,52 +596,52 @@ EOF
|
||||
9000/[678][0-9][0-9])
|
||||
if [ -x /usr/bin/getconf ]; then
|
||||
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
|
||||
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
|
||||
case "${sc_cpu_version}" in
|
||||
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
|
||||
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
|
||||
532) # CPU_PA_RISC2_0
|
||||
case "${sc_kernel_bits}" in
|
||||
32) HP_ARCH="hppa2.0n" ;;
|
||||
64) HP_ARCH="hppa2.0w" ;;
|
||||
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
|
||||
case "${sc_cpu_version}" in
|
||||
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
|
||||
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
|
||||
532) # CPU_PA_RISC2_0
|
||||
case "${sc_kernel_bits}" in
|
||||
32) HP_ARCH="hppa2.0n" ;;
|
||||
64) HP_ARCH="hppa2.0w" ;;
|
||||
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
|
||||
esac ;;
|
||||
esac
|
||||
esac ;;
|
||||
esac
|
||||
fi
|
||||
if [ "${HP_ARCH}" = "" ]; then
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
|
||||
#define _HPUX_SOURCE
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#define _HPUX_SOURCE
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main ()
|
||||
{
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
long bits = sysconf(_SC_KERNEL_BITS);
|
||||
#endif
|
||||
long cpu = sysconf (_SC_CPU_VERSION);
|
||||
int main ()
|
||||
{
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
long bits = sysconf(_SC_KERNEL_BITS);
|
||||
#endif
|
||||
long cpu = sysconf (_SC_CPU_VERSION);
|
||||
|
||||
switch (cpu)
|
||||
{
|
||||
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
|
||||
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
|
||||
case CPU_PA_RISC2_0:
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
switch (bits)
|
||||
{
|
||||
case 64: puts ("hppa2.0w"); break;
|
||||
case 32: puts ("hppa2.0n"); break;
|
||||
default: puts ("hppa2.0"); break;
|
||||
} break;
|
||||
#else /* !defined(_SC_KERNEL_BITS) */
|
||||
puts ("hppa2.0"); break;
|
||||
#endif
|
||||
default: puts ("hppa1.0"); break;
|
||||
}
|
||||
exit (0);
|
||||
}
|
||||
switch (cpu)
|
||||
{
|
||||
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
|
||||
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
|
||||
case CPU_PA_RISC2_0:
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
switch (bits)
|
||||
{
|
||||
case 64: puts ("hppa2.0w"); break;
|
||||
case 32: puts ("hppa2.0n"); break;
|
||||
default: puts ("hppa2.0"); break;
|
||||
} break;
|
||||
#else /* !defined(_SC_KERNEL_BITS) */
|
||||
puts ("hppa2.0"); break;
|
||||
#endif
|
||||
default: puts ("hppa1.0"); break;
|
||||
}
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
|
||||
test -z "$HP_ARCH" && HP_ARCH=hppa
|
||||
@@ -639,7 +661,7 @@ EOF
|
||||
# => hppa64-hp-hpux11.23
|
||||
|
||||
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
|
||||
grep __LP64__ >/dev/null
|
||||
grep -q __LP64__
|
||||
then
|
||||
HP_ARCH="hppa2.0w"
|
||||
else
|
||||
@@ -710,22 +732,22 @@ EOF
|
||||
exit ;;
|
||||
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
|
||||
echo c1-convex-bsd
|
||||
exit ;;
|
||||
exit ;;
|
||||
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
|
||||
if getsysinfo -f scalar_acc
|
||||
then echo c32-convex-bsd
|
||||
else echo c2-convex-bsd
|
||||
fi
|
||||
exit ;;
|
||||
exit ;;
|
||||
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
|
||||
echo c34-convex-bsd
|
||||
exit ;;
|
||||
exit ;;
|
||||
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
|
||||
echo c38-convex-bsd
|
||||
exit ;;
|
||||
exit ;;
|
||||
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
|
||||
echo c4-convex-bsd
|
||||
exit ;;
|
||||
exit ;;
|
||||
CRAY*Y-MP:*:*:*)
|
||||
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit ;;
|
||||
@@ -749,14 +771,14 @@ EOF
|
||||
exit ;;
|
||||
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
|
||||
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit ;;
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit ;;
|
||||
5000:UNIX_System_V:4.*:*)
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
|
||||
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
|
||||
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit ;;
|
||||
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
@@ -768,38 +790,48 @@ EOF
|
||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:FreeBSD:*:*)
|
||||
case ${UNAME_MACHINE} in
|
||||
pc98)
|
||||
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
||||
case ${UNAME_PROCESSOR} in
|
||||
amd64)
|
||||
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
esac
|
||||
exit ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
exit ;;
|
||||
i*:MINGW*:*)
|
||||
*:MINGW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw32
|
||||
exit ;;
|
||||
i*:MSYS_NT-*:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw32
|
||||
i*:MSYS*:*)
|
||||
echo ${UNAME_MACHINE}-pc-msys
|
||||
exit ;;
|
||||
i*:windows32*:*)
|
||||
# uname -m includes "-pc" on this system.
|
||||
echo ${UNAME_MACHINE}-mingw32
|
||||
# uname -m includes "-pc" on this system.
|
||||
echo ${UNAME_MACHINE}-mingw32
|
||||
exit ;;
|
||||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit ;;
|
||||
x86:Interix*:[345]*)
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
EM64T:Interix*:[345]*)
|
||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:Interix*:*)
|
||||
case ${UNAME_MACHINE} in
|
||||
x86)
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
authenticamd | genuineintel | EM64T)
|
||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
IA64)
|
||||
echo ia64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
esac ;;
|
||||
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
||||
echo i${UNAME_MACHINE}-pc-mks
|
||||
exit ;;
|
||||
8664:Windows_NT:*)
|
||||
echo x86_64-pc-mks
|
||||
exit ;;
|
||||
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
|
||||
@@ -829,82 +861,13 @@ EOF
|
||||
i*86:Minix:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit ;;
|
||||
arm*:Linux:*:*)
|
||||
aarch64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
cris:Linux:*:*)
|
||||
echo cris-axis-linux-gnu
|
||||
exit ;;
|
||||
crisv32:Linux:*:*)
|
||||
echo crisv32-axis-linux-gnu
|
||||
exit ;;
|
||||
frv:Linux:*:*)
|
||||
echo frv-unknown-linux-gnu
|
||||
exit ;;
|
||||
ia64:Linux:*:*)
|
||||
aarch64_be:Linux:*:*)
|
||||
UNAME_MACHINE=aarch64_be
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
m32r*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
m68*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
mips:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#undef CPU
|
||||
#undef mips
|
||||
#undef mipsel
|
||||
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
||||
CPU=mipsel
|
||||
#else
|
||||
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
||||
CPU=mips
|
||||
#else
|
||||
CPU=
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#undef CPU
|
||||
#undef mips64
|
||||
#undef mips64el
|
||||
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
||||
CPU=mips64el
|
||||
#else
|
||||
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
||||
CPU=mips64
|
||||
#else
|
||||
CPU=
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
or32:Linux:*:*)
|
||||
echo or32-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-gnu
|
||||
exit ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
EV5) UNAME_MACHINE=alphaev5 ;;
|
||||
@@ -914,11 +877,90 @@ EOF
|
||||
EV6) UNAME_MACHINE=alphaev6 ;;
|
||||
EV67) UNAME_MACHINE=alphaev67 ;;
|
||||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||
esac
|
||||
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
|
||||
esac
|
||||
objdump --private-headers /bin/sh | grep -q ld.so.1
|
||||
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
|
||||
exit ;;
|
||||
arm*:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_EABI__
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
else
|
||||
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_PCS_VFP
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
|
||||
fi
|
||||
fi
|
||||
exit ;;
|
||||
avr32*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
cris:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-axis-linux-gnu
|
||||
exit ;;
|
||||
crisv32:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-axis-linux-gnu
|
||||
exit ;;
|
||||
frv:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
hexagon:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
LIBC=gnu
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#ifdef __dietlibc__
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
exit ;;
|
||||
ia64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
m32r*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
m68*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
mips:Linux:*:* | mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#undef CPU
|
||||
#undef ${UNAME_MACHINE}
|
||||
#undef ${UNAME_MACHINE}el
|
||||
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
||||
CPU=${UNAME_MACHINE}el
|
||||
#else
|
||||
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
||||
CPU=${UNAME_MACHINE}
|
||||
#else
|
||||
CPU=
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
or32:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
padre:Linux:*:*)
|
||||
echo sparc-unknown-linux-gnu
|
||||
exit ;;
|
||||
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
||||
echo hppa64-unknown-linux-gnu
|
||||
exit ;;
|
||||
parisc:Linux:*:* | hppa:Linux:*:*)
|
||||
# Look for CPU level
|
||||
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
|
||||
@@ -927,14 +969,17 @@ EOF
|
||||
*) echo hppa-unknown-linux-gnu ;;
|
||||
esac
|
||||
exit ;;
|
||||
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
||||
echo hppa64-unknown-linux-gnu
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
exit ;;
|
||||
s390:Linux:*:* | s390x:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-linux
|
||||
exit ;;
|
||||
sh64*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
sh*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
@@ -942,75 +987,18 @@ EOF
|
||||
sparc:Linux:*:* | sparc64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
tile*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
vax:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-dec-linux-gnu
|
||||
exit ;;
|
||||
x86_64:Linux:*:*)
|
||||
echo x86_64-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
xtensa*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us. cd to the root directory to prevent
|
||||
# problems with other programs or directories called `ld' in the path.
|
||||
# Set LC_ALL=C to ensure ld outputs messages in English.
|
||||
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
|
||||
| sed -ne '/supported targets:/!d
|
||||
s/[ ][ ]*/ /g
|
||||
s/.*supported targets: *//
|
||||
s/ .*//
|
||||
p'`
|
||||
case "$ld_supported_targets" in
|
||||
elf32-i386)
|
||||
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
|
||||
;;
|
||||
a.out-i386-linux)
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
|
||||
exit ;;
|
||||
coff-i386)
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
|
||||
exit ;;
|
||||
"")
|
||||
# Either a pre-BFD a.out linker (linux-gnuoldld) or
|
||||
# one that does not give us useful --help.
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
|
||||
exit ;;
|
||||
esac
|
||||
# Determine whether the default compiler is a.out or elf
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <features.h>
|
||||
#ifdef __ELF__
|
||||
# ifdef __GLIBC__
|
||||
# if __GLIBC__ >= 2
|
||||
LIBC=gnu
|
||||
# else
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
# else
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
#else
|
||||
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__sun)
|
||||
LIBC=gnu
|
||||
#else
|
||||
LIBC=gnuaout
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __dietlibc__
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^LIBC/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${LIBC}" != x && {
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
exit
|
||||
}
|
||||
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
|
||||
;;
|
||||
i*86:DYNIX/ptx:4*:*)
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
|
||||
# earlier versions are messed up and put the nodename in both
|
||||
@@ -1018,11 +1006,11 @@ EOF
|
||||
echo i386-sequent-sysv4
|
||||
exit ;;
|
||||
i*86:UNIX_SV:4.2MP:2.*)
|
||||
# Unixware is an offshoot of SVR4, but it has its own version
|
||||
# number series starting with 2...
|
||||
# I am not positive that other SVR4 systems won't match this,
|
||||
# Unixware is an offshoot of SVR4, but it has its own version
|
||||
# number series starting with 2...
|
||||
# I am not positive that other SVR4 systems won't match this,
|
||||
# I just have to hope. -- rms.
|
||||
# Use sysv4.2uw... so that sysv4* matches it.
|
||||
# Use sysv4.2uw... so that sysv4* matches it.
|
||||
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
|
||||
exit ;;
|
||||
i*86:OS/2:*:*)
|
||||
@@ -1039,7 +1027,7 @@ EOF
|
||||
i*86:syllable:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-syllable
|
||||
exit ;;
|
||||
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
|
||||
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit ;;
|
||||
i*86:*DOS:*:*)
|
||||
@@ -1054,7 +1042,7 @@ EOF
|
||||
fi
|
||||
exit ;;
|
||||
i*86:*:5:[678]*)
|
||||
# UnixWare 7.x, OpenUNIX and OpenServer 6.
|
||||
# UnixWare 7.x, OpenUNIX and OpenServer 6.
|
||||
case `/bin/uname -X | grep "^Machine"` in
|
||||
*486*) UNAME_MACHINE=i486 ;;
|
||||
*Pentium) UNAME_MACHINE=i586 ;;
|
||||
@@ -1082,10 +1070,13 @@ EOF
|
||||
exit ;;
|
||||
pc:*:*:*)
|
||||
# Left here for compatibility:
|
||||
# uname -m prints for DJGPP always 'pc', but it prints nothing about
|
||||
# the processor, so we play safe by assuming i386.
|
||||
echo i386-pc-msdosdjgpp
|
||||
exit ;;
|
||||
# uname -m prints for DJGPP always 'pc', but it prints nothing about
|
||||
# the processor, so we play safe by assuming i586.
|
||||
# Note: whatever this is, it MUST be the same as what config.sub
|
||||
# prints for the "djgpp" host, or else GDB configury will decide that
|
||||
# this is a cross-build.
|
||||
echo i586-pc-msdosdjgpp
|
||||
exit ;;
|
||||
Intel:Mach:3*:*)
|
||||
echo i386-pc-mach3
|
||||
exit ;;
|
||||
@@ -1120,8 +1111,18 @@ EOF
|
||||
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
|
||||
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
|
||||
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& { echo i486-ncr-sysv4; exit; } ;;
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& { echo i486-ncr-sysv4; exit; } ;;
|
||||
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
|
||||
OS_REL='.3'
|
||||
test -r /etc/.relid \
|
||||
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
|
||||
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
|
||||
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; }
|
||||
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
|
||||
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
|
||||
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
|
||||
echo m68k-unknown-lynxos${UNAME_RELEASE}
|
||||
exit ;;
|
||||
@@ -1134,7 +1135,7 @@ EOF
|
||||
rs6000:LynxOS:2.*:*)
|
||||
echo rs6000-unknown-lynxos${UNAME_RELEASE}
|
||||
exit ;;
|
||||
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
|
||||
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
|
||||
echo powerpc-unknown-lynxos${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SM[BE]S:UNIX_SV:*:*)
|
||||
@@ -1154,10 +1155,10 @@ EOF
|
||||
echo ns32k-sni-sysv
|
||||
fi
|
||||
exit ;;
|
||||
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||
echo i586-unisys-sysv4
|
||||
exit ;;
|
||||
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||
echo i586-unisys-sysv4
|
||||
exit ;;
|
||||
*:UNIX_System_V:4*:FTX*)
|
||||
# From Gerald Hewes <hewes@openmarket.com>.
|
||||
# How about differentiating between stratus architectures? -djm
|
||||
@@ -1183,11 +1184,11 @@ EOF
|
||||
exit ;;
|
||||
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
|
||||
if [ -d /usr/nec ]; then
|
||||
echo mips-nec-sysv${UNAME_RELEASE}
|
||||
echo mips-nec-sysv${UNAME_RELEASE}
|
||||
else
|
||||
echo mips-unknown-sysv${UNAME_RELEASE}
|
||||
echo mips-unknown-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit ;;
|
||||
exit ;;
|
||||
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
|
||||
echo powerpc-be-beos
|
||||
exit ;;
|
||||
@@ -1197,6 +1198,9 @@ EOF
|
||||
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
|
||||
echo i586-pc-beos
|
||||
exit ;;
|
||||
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
|
||||
echo i586-pc-haiku
|
||||
exit ;;
|
||||
SX-4:SUPER-UX:*:*)
|
||||
echo sx4-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
@@ -1206,6 +1210,15 @@ EOF
|
||||
SX-6:SUPER-UX:*:*)
|
||||
echo sx6-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-7:SUPER-UX:*:*)
|
||||
echo sx7-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-8:SUPER-UX:*:*)
|
||||
echo sx8-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-8R:SUPER-UX:*:*)
|
||||
echo sx8r-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
Power*:Rhapsody:*:*)
|
||||
echo powerpc-apple-rhapsody${UNAME_RELEASE}
|
||||
exit ;;
|
||||
@@ -1215,6 +1228,16 @@ EOF
|
||||
*:Darwin:*:*)
|
||||
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
|
||||
case $UNAME_PROCESSOR in
|
||||
i386)
|
||||
eval $set_cc_for_build
|
||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
||||
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
|
||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
||||
grep IS_64BIT_ARCH >/dev/null
|
||||
then
|
||||
UNAME_PROCESSOR="x86_64"
|
||||
fi
|
||||
fi ;;
|
||||
unknown) UNAME_PROCESSOR=powerpc ;;
|
||||
esac
|
||||
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
|
||||
@@ -1230,6 +1253,9 @@ EOF
|
||||
*:QNX:*:4*)
|
||||
echo i386-pc-qnx
|
||||
exit ;;
|
||||
NEO-?:NONSTOP_KERNEL:*:*)
|
||||
echo neo-tandem-nsk${UNAME_RELEASE}
|
||||
exit ;;
|
||||
NSE-?:NONSTOP_KERNEL:*:*)
|
||||
echo nse-tandem-nsk${UNAME_RELEASE}
|
||||
exit ;;
|
||||
@@ -1275,13 +1301,13 @@ EOF
|
||||
echo pdp10-unknown-its
|
||||
exit ;;
|
||||
SEI:*:*:SEIUX)
|
||||
echo mips-sei-seiux${UNAME_RELEASE}
|
||||
echo mips-sei-seiux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:DragonFly:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit ;;
|
||||
*:*VMS:*:*)
|
||||
UNAME_MACHINE=`(uname -p) 2>/dev/null`
|
||||
UNAME_MACHINE=`(uname -p) 2>/dev/null`
|
||||
case "${UNAME_MACHINE}" in
|
||||
A*) echo alpha-dec-vms ; exit ;;
|
||||
I*) echo ia64-dec-vms ; exit ;;
|
||||
@@ -1296,6 +1322,12 @@ EOF
|
||||
i*86:rdos:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-rdos
|
||||
exit ;;
|
||||
i*86:AROS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-aros
|
||||
exit ;;
|
||||
x86_64:VMkernel:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-esx
|
||||
exit ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
@@ -1318,11 +1350,11 @@ main ()
|
||||
#include <sys/param.h>
|
||||
printf ("m68k-sony-newsos%s\n",
|
||||
#ifdef NEWSOS4
|
||||
"4"
|
||||
"4"
|
||||
#else
|
||||
""
|
||||
""
|
||||
#endif
|
||||
); exit (0);
|
||||
); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1456,9 +1488,9 @@ This script, last modified $timestamp, has failed to recognize
|
||||
the operating system you are using. It is advised that you
|
||||
download the most up to date version of the config scripts from
|
||||
|
||||
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
|
||||
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
|
||||
and
|
||||
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
|
||||
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
|
||||
|
||||
If the version you run ($0) is already up to date, please
|
||||
send the following data and any information you think might be
|
||||
|
||||
337
config.sub
vendored
337
config.sub
vendored
@@ -1,10 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
|
||||
# Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
# 2011, 2012 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2006-02-27'
|
||||
timestamp='2012-04-18'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
@@ -21,9 +21,7 @@ timestamp='2006-02-27'
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
@@ -32,13 +30,16 @@ timestamp='2006-02-27'
|
||||
|
||||
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted ChangeLog entry.
|
||||
# diff and a properly formatted GNU ChangeLog entry.
|
||||
#
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
# If it is invalid, we print an error message on stderr and exit with code 1.
|
||||
# Otherwise, we print the canonical config type on stdout and succeed.
|
||||
|
||||
# You can get the latest version of this script from:
|
||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
|
||||
|
||||
# This file is supposed to be the same for all GNU packages
|
||||
# and recognize all the CPU types, system types and aliases
|
||||
# that are meaningful with *any* GNU software.
|
||||
@@ -72,7 +73,8 @@ Report bugs and patches to <config-patches@gnu.org>."
|
||||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
@@ -120,12 +122,18 @@ esac
|
||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
|
||||
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
|
||||
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
|
||||
linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
|
||||
knetbsd*-gnu* | netbsd*-gnu* | \
|
||||
kopensolaris*-gnu* | \
|
||||
storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
android-linux)
|
||||
os=-linux-android
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
|
||||
;;
|
||||
*)
|
||||
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
|
||||
if [ $basic_machine != $1 ]
|
||||
@@ -148,10 +156,13 @@ case $os in
|
||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||
-apple | -axis | -knuth | -cray)
|
||||
-apple | -axis | -knuth | -cray | -microblaze)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-bluegene*)
|
||||
os=-cnk
|
||||
;;
|
||||
-sim | -cisco | -oki | -wec | -winbond)
|
||||
os=
|
||||
basic_machine=$1
|
||||
@@ -166,10 +177,10 @@ case $os in
|
||||
os=-chorusos
|
||||
basic_machine=$1
|
||||
;;
|
||||
-chorusrdb)
|
||||
os=-chorusrdb
|
||||
-chorusrdb)
|
||||
os=-chorusrdb
|
||||
basic_machine=$1
|
||||
;;
|
||||
;;
|
||||
-hiux*)
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
@@ -214,6 +225,12 @@ case $os in
|
||||
-isc*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-lynx*178)
|
||||
os=-lynxos178
|
||||
;;
|
||||
-lynx*5)
|
||||
os=-lynxos5
|
||||
;;
|
||||
-lynx*)
|
||||
os=-lynxos
|
||||
;;
|
||||
@@ -238,23 +255,32 @@ case $basic_machine in
|
||||
# Some are omitted here because they have special meanings below.
|
||||
1750a | 580 \
|
||||
| a29k \
|
||||
| aarch64 | aarch64_be \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| am33_2.0 \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
|
||||
| be32 | be64 \
|
||||
| bfin \
|
||||
| c4x | clipper \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| fr30 | frv \
|
||||
| epiphany \
|
||||
| fido | fr30 | frv \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| hexagon \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| m32r | m32rle | m68000 | m68k | m88k | maxq | mb | microblaze | mcore \
|
||||
| le32 | le64 \
|
||||
| lm32 \
|
||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||
| maxq | mb | microblaze | mcore | mep | metag \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
| mips64vr | mips64vrel \
|
||||
| mips64octeon | mips64octeonel \
|
||||
| mips64orion | mips64orionel \
|
||||
| mips64r5900 | mips64r5900el \
|
||||
| mips64vr | mips64vrel \
|
||||
| mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr4300 | mips64vr4300el \
|
||||
| mips64vr5000 | mips64vr5000el \
|
||||
@@ -267,31 +293,42 @@ case $basic_machine in
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mn10200 | mn10300 \
|
||||
| moxie \
|
||||
| mt \
|
||||
| msp430 \
|
||||
| nds32 | nds32le | nds32be \
|
||||
| nios | nios2 \
|
||||
| ns16k | ns32k \
|
||||
| open8 \
|
||||
| or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle \
|
||||
| pyramid \
|
||||
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| rl78 | rx \
|
||||
| score \
|
||||
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
|
||||
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
||||
| strongarm \
|
||||
| tahoe | thumb | tic4x | tic80 | tron \
|
||||
| v850 | v850e \
|
||||
| spu \
|
||||
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
|
||||
| ubicom32 \
|
||||
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
|
||||
| we32k \
|
||||
| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
|
||||
| z8k)
|
||||
| x86 | xc16x | xstormy16 | xtensa \
|
||||
| z8k | z80)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m32c)
|
||||
basic_machine=$basic_machine-unknown
|
||||
c54x)
|
||||
basic_machine=tic54x-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12)
|
||||
# Motorola 68HC11/12.
|
||||
c55x)
|
||||
basic_machine=tic55x-unknown
|
||||
;;
|
||||
c6x)
|
||||
basic_machine=tic6x-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-none
|
||||
;;
|
||||
@@ -301,6 +338,21 @@ case $basic_machine in
|
||||
basic_machine=mt-unknown
|
||||
;;
|
||||
|
||||
strongarm | thumb | xscale)
|
||||
basic_machine=arm-unknown
|
||||
;;
|
||||
xgate)
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-none
|
||||
;;
|
||||
xscaleeb)
|
||||
basic_machine=armeb-unknown
|
||||
;;
|
||||
|
||||
xscaleel)
|
||||
basic_machine=armel-unknown
|
||||
;;
|
||||
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
@@ -315,29 +367,36 @@ case $basic_machine in
|
||||
# Recognize the basic CPU types with company name.
|
||||
580-* \
|
||||
| a29k-* \
|
||||
| aarch64-* | aarch64_be-* \
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* \
|
||||
| avr-* | avr32-* \
|
||||
| be32-* | be64-* \
|
||||
| bfin-* | bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* \
|
||||
| clipper-* | craynv-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
|
||||
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| hexagon-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| m32r-* | m32rle-* \
|
||||
| le32-* | le64-* \
|
||||
| lm32-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
| mips64vr-* | mips64vrel-* \
|
||||
| mips64octeon-* | mips64octeonel-* \
|
||||
| mips64orion-* | mips64orionel-* \
|
||||
| mips64r5900-* | mips64r5900el-* \
|
||||
| mips64vr-* | mips64vrel-* \
|
||||
| mips64vr4100-* | mips64vr4100el-* \
|
||||
| mips64vr4300-* | mips64vr4300el-* \
|
||||
| mips64vr5000-* | mips64vr5000el-* \
|
||||
@@ -352,29 +411,36 @@ case $basic_machine in
|
||||
| mmix-* \
|
||||
| mt-* \
|
||||
| msp430-* \
|
||||
| nds32-* | nds32le-* | nds32be-* \
|
||||
| nios-* | nios2-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| open8-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
|
||||
| rl78-* | romp-* | rs6000-* | rx-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
||||
| sparclite-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
|
||||
| tahoe-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tile*-* \
|
||||
| tron-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| ubicom32-* \
|
||||
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
|
||||
| vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
|
||||
| xstormy16-* | xtensa-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* \
|
||||
| xstormy16-* | xtensa*-* \
|
||||
| ymp-* \
|
||||
| z8k-*)
|
||||
| z8k-* | z80-*)
|
||||
;;
|
||||
m32c-*)
|
||||
# Recognize the basic CPU types without company name, with glob match.
|
||||
xtensa*)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
@@ -392,7 +458,7 @@ case $basic_machine in
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
abacus)
|
||||
abacus)
|
||||
basic_machine=abacus-unknown
|
||||
;;
|
||||
adobe68k)
|
||||
@@ -438,6 +504,10 @@ case $basic_machine in
|
||||
basic_machine=m68k-apollo
|
||||
os=-bsd
|
||||
;;
|
||||
aros)
|
||||
basic_machine=i386-pc
|
||||
os=-aros
|
||||
;;
|
||||
aux)
|
||||
basic_machine=m68k-apple
|
||||
os=-aux
|
||||
@@ -446,10 +516,35 @@ case $basic_machine in
|
||||
basic_machine=ns32k-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
blackfin)
|
||||
basic_machine=bfin-unknown
|
||||
os=-linux
|
||||
;;
|
||||
blackfin-*)
|
||||
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
bluegene*)
|
||||
basic_machine=powerpc-ibm
|
||||
os=-cnk
|
||||
;;
|
||||
c54x-*)
|
||||
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
c55x-*)
|
||||
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
c6x-*)
|
||||
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
c90)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
cegcc)
|
||||
basic_machine=arm-unknown
|
||||
os=-cegcc
|
||||
;;
|
||||
convex-c1)
|
||||
basic_machine=c1-convex
|
||||
os=-bsd
|
||||
@@ -478,8 +573,8 @@ case $basic_machine in
|
||||
basic_machine=craynv-cray
|
||||
os=-unicosmp
|
||||
;;
|
||||
cr16c)
|
||||
basic_machine=cr16c-unknown
|
||||
cr16 | cr16-*)
|
||||
basic_machine=cr16-unknown
|
||||
os=-elf
|
||||
;;
|
||||
crds | unos)
|
||||
@@ -517,6 +612,10 @@ case $basic_machine in
|
||||
basic_machine=m88k-motorola
|
||||
os=-sysv3
|
||||
;;
|
||||
dicos)
|
||||
basic_machine=i686-pc
|
||||
os=-dicos
|
||||
;;
|
||||
djgpp)
|
||||
basic_machine=i586-pc
|
||||
os=-msdosdjgpp
|
||||
@@ -632,7 +731,6 @@ case $basic_machine in
|
||||
i370-ibm* | ibm*)
|
||||
basic_machine=i370-ibm
|
||||
;;
|
||||
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
||||
i*86v32)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv32
|
||||
@@ -671,6 +769,14 @@ case $basic_machine in
|
||||
basic_machine=m68k-isi
|
||||
os=-sysv
|
||||
;;
|
||||
m68knommu)
|
||||
basic_machine=m68k-unknown
|
||||
os=-linux
|
||||
;;
|
||||
m68knommu-*)
|
||||
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
m88k-omron*)
|
||||
basic_machine=m88k-omron
|
||||
;;
|
||||
@@ -682,10 +788,17 @@ case $basic_machine in
|
||||
basic_machine=ns32k-utek
|
||||
os=-sysv
|
||||
;;
|
||||
microblaze)
|
||||
basic_machine=microblaze-xilinx
|
||||
;;
|
||||
mingw32)
|
||||
basic_machine=i386-pc
|
||||
os=-mingw32
|
||||
;;
|
||||
mingw32ce)
|
||||
basic_machine=arm-unknown
|
||||
os=-mingw32ce
|
||||
;;
|
||||
miniframe)
|
||||
basic_machine=m68000-convergent
|
||||
;;
|
||||
@@ -714,10 +827,18 @@ case $basic_machine in
|
||||
ms1-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
||||
;;
|
||||
msys)
|
||||
basic_machine=i386-pc
|
||||
os=-msys
|
||||
;;
|
||||
mvs)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
;;
|
||||
nacl)
|
||||
basic_machine=le32-unknown
|
||||
os=-nacl
|
||||
;;
|
||||
ncr3000)
|
||||
basic_machine=i486-ncr
|
||||
os=-sysv4
|
||||
@@ -782,6 +903,12 @@ case $basic_machine in
|
||||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
neo-tandem)
|
||||
basic_machine=neo-tandem
|
||||
;;
|
||||
nse-tandem)
|
||||
basic_machine=nse-tandem
|
||||
;;
|
||||
nsr-tandem)
|
||||
basic_machine=nsr-tandem
|
||||
;;
|
||||
@@ -812,6 +939,14 @@ case $basic_machine in
|
||||
basic_machine=i860-intel
|
||||
os=-osf
|
||||
;;
|
||||
parisc)
|
||||
basic_machine=hppa-unknown
|
||||
os=-linux
|
||||
;;
|
||||
parisc-*)
|
||||
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
pbd)
|
||||
basic_machine=sparc-tti
|
||||
;;
|
||||
@@ -856,9 +991,10 @@ case $basic_machine in
|
||||
;;
|
||||
power) basic_machine=power-ibm
|
||||
;;
|
||||
ppc) basic_machine=powerpc-unknown
|
||||
ppc | ppcbe) basic_machine=powerpc-unknown
|
||||
;;
|
||||
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
ppc-* | ppcbe-*)
|
||||
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppcle | powerpclittle | ppc-le | powerpc-little)
|
||||
basic_machine=powerpcle-unknown
|
||||
@@ -913,6 +1049,10 @@ case $basic_machine in
|
||||
sb1el)
|
||||
basic_machine=mipsisa64sb1el-unknown
|
||||
;;
|
||||
sde)
|
||||
basic_machine=mipsisa32-sde
|
||||
os=-elf
|
||||
;;
|
||||
sei)
|
||||
basic_machine=mips-sei
|
||||
os=-seiux
|
||||
@@ -924,6 +1064,9 @@ case $basic_machine in
|
||||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sh5el)
|
||||
basic_machine=sh5le-unknown
|
||||
;;
|
||||
sh64)
|
||||
basic_machine=sh64-unknown
|
||||
;;
|
||||
@@ -945,6 +1088,9 @@ case $basic_machine in
|
||||
basic_machine=i860-stratus
|
||||
os=-sysv4
|
||||
;;
|
||||
strongarm-* | thumb-*)
|
||||
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
sun2)
|
||||
basic_machine=m68000-sun
|
||||
;;
|
||||
@@ -1001,17 +1147,9 @@ case $basic_machine in
|
||||
basic_machine=t90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
tic54x | c54x*)
|
||||
basic_machine=tic54x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic55x | c55x*)
|
||||
basic_machine=tic55x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic6x | c6x*)
|
||||
basic_machine=tic6x-unknown
|
||||
os=-coff
|
||||
tile*)
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
@@ -1080,6 +1218,9 @@ case $basic_machine in
|
||||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
xscale-* | xscalee[bl]-*)
|
||||
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
|
||||
;;
|
||||
ymp)
|
||||
basic_machine=ymp-cray
|
||||
os=-unicos
|
||||
@@ -1088,6 +1229,10 @@ case $basic_machine in
|
||||
basic_machine=z8k-unknown
|
||||
os=-sim
|
||||
;;
|
||||
z80-*-coff)
|
||||
basic_machine=z80-unknown
|
||||
os=-sim
|
||||
;;
|
||||
none)
|
||||
basic_machine=none-none
|
||||
os=-none
|
||||
@@ -1126,7 +1271,7 @@ case $basic_machine in
|
||||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||
basic_machine=sh-unknown
|
||||
;;
|
||||
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
|
||||
@@ -1173,9 +1318,12 @@ esac
|
||||
if [ x"$os" != x"" ]
|
||||
then
|
||||
case $os in
|
||||
# First match some system type aliases
|
||||
# that might get confused with valid system types.
|
||||
# First match some system type aliases
|
||||
# that might get confused with valid system types.
|
||||
# -solaris* is a basic system type, with this one exception.
|
||||
-auroraux)
|
||||
os=-auroraux
|
||||
;;
|
||||
-solaris1 | -solaris1.*)
|
||||
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
||||
;;
|
||||
@@ -1196,10 +1344,11 @@ case $os in
|
||||
# Each alternative MUST END IN A *, to match a version number.
|
||||
# -sysv* is not here because it comes later, after sysvr4.
|
||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
|
||||
| -sym* | -kopensolaris* \
|
||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||
| -aos* \
|
||||
| -aos* | -aros* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
||||
@@ -1208,9 +1357,10 @@ case $os in
|
||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -chorusos* | -chorusrdb* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
|
||||
| -chorusos* | -chorusrdb* | -cegcc* \
|
||||
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -linux-android* \
|
||||
| -linux-newlib* | -linux-uclibc* \
|
||||
| -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||
@@ -1218,7 +1368,7 @@ case $os in
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||
| -skyos* | -haiku* | -rdos*)
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
@@ -1257,7 +1407,7 @@ case $os in
|
||||
-opened*)
|
||||
os=-openedition
|
||||
;;
|
||||
-os400*)
|
||||
-os400*)
|
||||
os=-os400
|
||||
;;
|
||||
-wince*)
|
||||
@@ -1306,7 +1456,7 @@ case $os in
|
||||
-sinix*)
|
||||
os=-sysv4
|
||||
;;
|
||||
-tpf*)
|
||||
-tpf*)
|
||||
os=-tpf
|
||||
;;
|
||||
-triton*)
|
||||
@@ -1348,6 +1498,11 @@ case $os in
|
||||
-zvmoe)
|
||||
os=-zvmoe
|
||||
;;
|
||||
-dicos*)
|
||||
os=-dicos
|
||||
;;
|
||||
-nacl*)
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
@@ -1370,6 +1525,12 @@ else
|
||||
# system, and we'll never get to this point.
|
||||
|
||||
case $basic_machine in
|
||||
score-*)
|
||||
os=-elf
|
||||
;;
|
||||
spu-*)
|
||||
os=-elf
|
||||
;;
|
||||
*-acorn)
|
||||
os=-riscix1.2
|
||||
;;
|
||||
@@ -1379,9 +1540,21 @@ case $basic_machine in
|
||||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
hexagon-*)
|
||||
os=-elf
|
||||
;;
|
||||
tic54x-*)
|
||||
os=-coff
|
||||
;;
|
||||
tic55x-*)
|
||||
os=-coff
|
||||
;;
|
||||
tic6x-*)
|
||||
os=-coff
|
||||
;;
|
||||
# This must come before the *-dec entry.
|
||||
pdp10-*)
|
||||
os=-tops20
|
||||
@@ -1400,13 +1573,13 @@ case $basic_machine in
|
||||
;;
|
||||
m68000-sun)
|
||||
os=-sunos3
|
||||
# This also exists in the configure program, but was not the
|
||||
# default.
|
||||
# os=-sunos4
|
||||
;;
|
||||
m68*-cisco)
|
||||
os=-aout
|
||||
;;
|
||||
mep-*)
|
||||
os=-elf
|
||||
;;
|
||||
mips*-cisco)
|
||||
os=-elf
|
||||
;;
|
||||
@@ -1431,7 +1604,7 @@ case $basic_machine in
|
||||
*-ibm)
|
||||
os=-aix
|
||||
;;
|
||||
*-knuth)
|
||||
*-knuth)
|
||||
os=-mmixware
|
||||
;;
|
||||
*-wec)
|
||||
@@ -1536,7 +1709,7 @@ case $basic_machine in
|
||||
-sunos*)
|
||||
vendor=sun
|
||||
;;
|
||||
-aix*)
|
||||
-cnk*|-aix*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-beos*)
|
||||
|
||||
945
configure.ac
945
configure.ac
File diff suppressed because it is too large
Load Diff
@@ -6,13 +6,29 @@ alias NAME=DEFINITION</pre>
|
||||
|
||||
\subsection alias-description Description
|
||||
|
||||
Alias is a shellscript wrapper around the function builtin.
|
||||
\c alias is a simple wrapper for the \c function builtin.
|
||||
It exists for backwards compatibility with Posix
|
||||
shells. For other uses, it is recommended to define a <a
|
||||
href='#function'>function</a>.
|
||||
|
||||
Alias does not keep track of which functions have been defined using
|
||||
alias, nor does it allow erasing of aliases.
|
||||
\c fish does not keep track of which functions have been defined using
|
||||
\c alias. They must be erased using <code>functions -e</code>.
|
||||
|
||||
- NAME is the name of the alias
|
||||
- DEFINITION is the actual command to execute. The string " $argv" will be appended.
|
||||
|
||||
You cannot create an alias to a function with the same name.
|
||||
|
||||
\subsection alias-example Example
|
||||
|
||||
The following code will create \c rmi, which runs \c rm with additional
|
||||
arguments on every invocation.
|
||||
|
||||
<code>alias rmi "rm -i"</code>
|
||||
|
||||
This is equivalent to entering the following function:
|
||||
|
||||
<pre>function rmi
|
||||
rm -i $argv
|
||||
end</pre>
|
||||
|
||||
- NAME is the name of the function to define
|
||||
- DEFINITION is the body of the function. The string " $argv" will be appended to the body.
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
|
||||
\subsection and-description Description
|
||||
|
||||
The \c and builtin is used to execute a command if the current exit
|
||||
\c and is used to execute a command if the current exit
|
||||
status (as set by the last previous command) is 0.
|
||||
|
||||
The and command does not change the current exit status.
|
||||
\c and does not change the current exit status.
|
||||
|
||||
The exit status of the last foreground command to exit can always be
|
||||
accessed using the <a href="index.html#variables-status">$status</a>
|
||||
@@ -16,10 +16,10 @@ variable.
|
||||
|
||||
\subsection and-example Example
|
||||
|
||||
The following code runs the \c make command to build a program, if the
|
||||
build succeeds, the program is installed. If either step fails,
|
||||
<tt>make clean</tt> is run, which removes the files created by the
|
||||
build process
|
||||
The following code runs the \c make command to build a program. If the
|
||||
build succeeds, <code>make</code>'s exit status is 0, and the program is installed. If either step fails,
|
||||
the exit status is 1, and <tt>make clean</tt> is run, which removes the files created by the.
|
||||
build process.
|
||||
|
||||
<pre>
|
||||
make; and make install; or make clean
|
||||
|
||||
@@ -5,15 +5,18 @@
|
||||
|
||||
\subsection begin-description Description
|
||||
|
||||
The \c begin builtin is used to create a new block of code. The block
|
||||
\c begin is used to create a new block of code.
|
||||
|
||||
The block
|
||||
is unconditionally executed. <code>begin; ...; end</tt> is equivalent
|
||||
to <tt>if true; ...; end</tt>. The begin command is used to group any
|
||||
number of commands into a block. The reason for doing so is usually
|
||||
either to introduce a new variable scope, to redirect the input or
|
||||
to <tt>if true; ...; end</tt>.
|
||||
|
||||
\c begin is used to group a number of commands into a block.
|
||||
This allows the introduction of a new variable scope, redirection of the input or
|
||||
output of a set of commands as a group, or to specify precedence when
|
||||
using the conditional commands like \c and.
|
||||
|
||||
The \c begin command does not change the current exit status.
|
||||
\c begin does not change the current exit status.
|
||||
|
||||
\subsection begin-example Example
|
||||
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
\section bg bg - send to background
|
||||
\section bg bg - send jobs to background
|
||||
|
||||
\subsection bg-synopsis Synopsis
|
||||
<tt>bg [PID...]</tt>
|
||||
|
||||
\subsection bg-description Description
|
||||
Sends the specified jobs to the background. A background job is
|
||||
|
||||
\c bg sends <a href="index.html#syntax-job-control">jobs</a> to the background, resuming them if they are stopped. A background job is
|
||||
executed simultaneously with fish, and does not have access to the
|
||||
keyboard. If no job is specified, the last job to be used is put in the background. If PID is specified, the jobs with the specified group ids are put in the background.
|
||||
keyboard. If no job is specified, the last job to be used is put in the background. If PID is specified, the jobs with the specified process group IDs are put in the background.
|
||||
|
||||
The PID of the desired process is usually found by using <a href="index.html#expand-process">process expansion</a>.
|
||||
|
||||
\subsection bg-example Example
|
||||
|
||||
<tt>bg \%0</tt> will put the job with job id 0 in the background.
|
||||
<tt>bg \%1</tt> will put the job with job ID 1 in the background.
|
||||
|
||||
|
||||
@@ -5,33 +5,34 @@
|
||||
|
||||
\subsection bind-description Description
|
||||
|
||||
The <tt>bind</tt> builtin causes fish to add a key binding from the specified sequence.
|
||||
<tt>bind</tt> adds a binding for the specified key sequence to the
|
||||
specified command.
|
||||
|
||||
SEQUENCE is the character sequence to bind to. Usually, one would use
|
||||
fish escape sequences to express them. For example, because pressing
|
||||
SEQUENCE is the character sequence to bind to. These should be written as
|
||||
<a href="index.html#escapes">fish escape sequences</a>. For example, because pressing
|
||||
the Alt key and another character sends that character prefixed with
|
||||
an escape character, Alt-based key bindings can be written using the
|
||||
\c \\e escape. For example, Alt-w can be written as
|
||||
<tt>\\ew</tt>. Control character can be written in much the same way
|
||||
using the \c \\c escape, for example Control-x can be written as
|
||||
<tt>\\ew</tt>. The control character can be written in much the same way
|
||||
using the \c \\c escape, for example Control-x (^X) can be written as
|
||||
<tt>\\cx</tt>. Note that Alt-based key bindings are case sensitive and
|
||||
Control base key bindings are not. This is not a design choice in
|
||||
fish, it is simply how terminals work.
|
||||
Control-based key bindings are not. This is a constraint of text-based
|
||||
terminals, not \c fish.
|
||||
|
||||
If SEQUENCE is the empty string, i.e. an empty set of quotes, this is
|
||||
interpreted as the default keybinding. It will be used whenever no
|
||||
The default key binding can be set by specifying a SEQUENCE of the empty
|
||||
string (that is, <code>''</code>). It will be used whenever no
|
||||
other binding matches. For most key bindings, it makes sense to use
|
||||
the \c self-insert function (i.e. <tt>bind '' self-insert</tt> as the
|
||||
default keybining. This will insert any keystrokes not specifically
|
||||
default keybinding. This will insert any keystrokes not specifically
|
||||
bound to into the editor. Non-printable characters are ignored by the
|
||||
editor, so this will not result in e.g. control sequences being
|
||||
editor, so this will not result in control sequences being
|
||||
printable.
|
||||
|
||||
If the -k switch is used, the name of the key (such as down, up or
|
||||
backspace) is used instead of a sequence. The names used are the same
|
||||
as the corresponding curses variables, but without the 'key_'
|
||||
prefix. (See man 5 terminfo for more information, or use <tt>bind
|
||||
--key-names</tt> for a list of all available named keys)
|
||||
prefix. (See \c terminfo(5) for more information, or use <tt>bind
|
||||
--key-names</tt> for a list of all available named keys.)
|
||||
|
||||
COMMAND can be any fish command, but it can also be one of a set of
|
||||
special input functions. These include functions for moving the
|
||||
@@ -45,16 +46,52 @@ bind to the function name. This way it becomes significantly easier to
|
||||
test the function while editing, and the result is usually more
|
||||
readable as well.
|
||||
|
||||
- <tt>-a</tt> or <tt>--all</tt> If --key-names is specified, show all key names, not only the ones that actually are defined for the current terminal. If erase mode is specified, this switch will cause all current bindings to be erased.
|
||||
- <tt>-e</tt> or <tt>--erase</tt> Erase mode. All non-switch arguments are interpreted as character sequences and any commands associated with those sequences are erased.
|
||||
- <tt>-h</tt> or <tt>--help</tt> Display help and exit
|
||||
If such a script produces output, the script needs to finish by
|
||||
calling 'commandline -f repaint' in order to tell fish that a repaint
|
||||
is in order.
|
||||
|
||||
Key bindings are not saved between sessions by default. To save custom
|
||||
keybindings, edit the \c fish_user_key_bindings function and insert the
|
||||
appropriate \c bind statements.
|
||||
|
||||
The following parameters are available:
|
||||
|
||||
- <tt>-k</tt> or <tt>--key</tt> Specify a key name, such as 'left' or 'backspace' instead of a character sequence
|
||||
- <tt>-K</tt> or <tt>--key-names</tt> Display a list of available key names
|
||||
- <tt>-f</tt> or <tt>--function-names</tt> Display a list of available input functions
|
||||
|
||||
\subsection bind-example Example
|
||||
The following special input functions are available:
|
||||
|
||||
<tt>bind \\cd 'exit'</tt> causes fish to exit on Control-d
|
||||
- \c backward-char, moves one character to the left
|
||||
- \c backward-delete-char, deletes one character of input to the left of the cursor
|
||||
- \c backward-kill-line, move everything from the beginning of the line to the cursor to the killring
|
||||
- \c backward-kill-word, move the word to the left of the cursor to the killring
|
||||
- \c backward-word, move one word to the left
|
||||
- \c beginning-of-history, move to the beginning of the history
|
||||
- \c beginning-of-line, move to the beginning of the line
|
||||
- \c capitalize-word, make the current word begin with a capital letter
|
||||
- \c complete, guess the remainder of the current token
|
||||
- \c delete-char, delete one character to the right of the cursor
|
||||
- \c delete-line, delete the entire line
|
||||
- \c downcase-word, make the current word lowercase
|
||||
- \c dump-functions, print a list of all key-bindings
|
||||
- \c end-of-history, move to the end of the history
|
||||
- \c end-of-line, move to the end of the line
|
||||
- \c explain, print a description of possible problems with the current command
|
||||
- \c forward-char, move one character to the right
|
||||
- \c forward-word, move one word to the right
|
||||
- \c history-search-backward, search the history for the previous match
|
||||
- \c history-search-forward, search the history for the next match
|
||||
- \c kill-line, move everything from the cursor to the end of the line to the killring
|
||||
- \c kill-whole-line, move the line to the killring
|
||||
- \c kill-word, move the next word to the killring
|
||||
- \c upcase-word, make the current word uppercase
|
||||
- \c yank, insert the latest entry of the killring into the buffer
|
||||
- \c yank-pop, rotate to the previous entry of the killring
|
||||
|
||||
<tt>bind -k ppage history-search-backward</tt> Causes fish to perform a history search when the page up key is pressed
|
||||
\subsection bind-example Examples
|
||||
|
||||
<tt>bind \\cd 'exit'</tt> causes \c fish to exit when Control-d is pressed.
|
||||
|
||||
<tt>bind -k ppage history-search-backward</tt> performs a history search when the Page Up key is pressed.
|
||||
|
||||
|
||||
@@ -5,15 +5,36 @@
|
||||
|
||||
\subsection block-description Description
|
||||
|
||||
- <tt>-l</tt> or <tt>--local</tt> Release the block at the end of the currently innermost block scope
|
||||
\c block prevents events triggered by \c fish or the
|
||||
<a href="commands.html#emit"><code>emit</code></a> command from
|
||||
being delivered and acted upon while the block is in place.
|
||||
|
||||
In functions, \c block can be useful while performing work that
|
||||
should not be interrupted by the shell.
|
||||
|
||||
The block can be removed. Any events which triggered while the
|
||||
block was in place will then be delivered.
|
||||
|
||||
Event blocks should not be confused with code blocks, which are created
|
||||
with <code>begin</code>, <code>if</code>, <code>while</code> or
|
||||
<code>for</code>
|
||||
|
||||
The following parameters are available:
|
||||
|
||||
- <tt>-l</tt> or <tt>--local</tt> Release the block automatically at the end of the current innermost code block scope
|
||||
- <tt>-g</tt> or <tt>--global</tt> Never automatically release the lock
|
||||
- <tt>-e</tt> or <tt>--erase</tt> Release global block
|
||||
|
||||
\subsection block-example Example
|
||||
|
||||
<pre>
|
||||
# Create a function that listens for events
|
||||
function --on-event foo foo; echo 'foo fired'; end
|
||||
# Block the delivery of events
|
||||
block -g
|
||||
\#Do something that should not be interrupted
|
||||
emit foo
|
||||
# No output will be produced
|
||||
block -e
|
||||
# 'foo fired' will now be printed
|
||||
</pre>
|
||||
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
\section break break - stop the innermost currently evaluated loop
|
||||
\section break break - stop the current inner loop
|
||||
|
||||
\subsection break-synopsis Synopsis
|
||||
<tt>LOOP_CONSTRUCT; [COMMANDS...] break; [COMMANDS...] end</tt>
|
||||
|
||||
\subsection break-description Description
|
||||
The \c break builtin is used to halt a currently running loop, such as a <a href="#for">for</a> loop or a <a href="#while">while</a> loop. It is usually added inside of a conditional block such as an <a href="#if">if</a> statement or a <a href="#switch">switch</a> statement.
|
||||
|
||||
\c break halts a currently running loop, such as a <a href="#for">for</a> loop or a <a href="#while">while</a> loop. It is usually added inside of a conditional block such as an <a href="#if">if</a> statement or a <a href="#switch">switch</a> statement.
|
||||
|
||||
There are no parameters for <code>break</code>.
|
||||
|
||||
\subsection break-example Example
|
||||
The following code searches all .c files for smurfs, and halts at the first occurrence.
|
||||
The following code searches all .c files for "smurf", and halts at the first occurrence.
|
||||
|
||||
<pre>
|
||||
for i in *.c
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
|
||||
\subsection breakpoint-description Description
|
||||
|
||||
The \c breakpoint builtin is used to halt a running script and launch
|
||||
an interactive debug prompt.
|
||||
\c breakpoint is used to halt a running script and launch
|
||||
an interactive debugging prompt.
|
||||
|
||||
For more details, see <a href="index.html#debugging">Debugging fish
|
||||
scripts</a> in the \c fish manual.
|
||||
|
||||
There are no parameters for <code>breakpoint</code>.
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
\subsection builtin-description Description
|
||||
|
||||
- <tt>-n</tt> or <tt>--names</tt> List the names of all defined builtins
|
||||
\c builtin forces the shell to use a builtin command, rather than a function or program.
|
||||
|
||||
Prefixing a command with the word 'builtin' forces fish to ignore any functions with the same name.
|
||||
The following parameters are available:
|
||||
|
||||
- <tt>-n</tt> or <tt>--names</tt> List the names of all defined builtins
|
||||
|
||||
\subsection builtin-example Example
|
||||
|
||||
<tt>builtin jobs</tt>
|
||||
|
||||
causes fish to execute the jobs builtin, even if a function named jobs exists.
|
||||
<tt>builtin jobs</tt> executes the jobs builtin, even if a function named jobs exists.
|
||||
|
||||
@@ -5,27 +5,24 @@
|
||||
|
||||
\subsection case-description Description
|
||||
|
||||
The \c switch statement is used to perform one of several blocks of
|
||||
commands depending on whether a specified value equals one of several
|
||||
wildcarded values. The \c case statement is used together with the \c
|
||||
switch statement in order to determine which block should be
|
||||
performed.
|
||||
\c switch performs one of several blocks of commands, depending on whether
|
||||
a specified value equals one of several wildcarded values. \c case is used
|
||||
together with the \c switch statement in order to determine which block should
|
||||
be executed.
|
||||
|
||||
Each \c case command is given one or more parameter. The first \c case
|
||||
Each \c case command is given one or more parameters. The first \c case
|
||||
command with a parameter that matches the string specified in the
|
||||
switch command will be evaluated. \c case parameters may contain
|
||||
wildcards. These need to be escaped or quoted in order to avoid
|
||||
regular wildcard expansion using filenames.
|
||||
|
||||
Note that fish does not fall through on case statements. Though the
|
||||
syntax may look a bit like C switch statements, it behaves more like
|
||||
the case statements of traditional shells.
|
||||
Note that fish does not fall through on case statements. Only the
|
||||
first matching case is executed.
|
||||
|
||||
Also note that command substitutions in a case statement will be
|
||||
evaluated even if it's body is not taken. This may seem
|
||||
counterintuitive at first, but it is unavoidable, since it would be
|
||||
impossible to know if a case command will evaluate to true before all
|
||||
forms of parameter expansion have been performed for the case command.
|
||||
Note that command substitutions in a case statement will be
|
||||
evaluated even if its body is not taken. All substitutions, including
|
||||
command substitutions, must be performed before the value can be compared
|
||||
against the parameter.
|
||||
|
||||
\subsection case-example Example
|
||||
|
||||
@@ -42,6 +39,7 @@ switch $animal
|
||||
echo bird
|
||||
case shark trout stingray
|
||||
echo fish
|
||||
# Note that the next case has a wildcard which is quoted
|
||||
case '*'
|
||||
echo I have no idea what a $animal is
|
||||
end
|
||||
|
||||
@@ -3,9 +3,23 @@
|
||||
\subsection cd-synopsis Synopsis
|
||||
<tt>cd [DIRECTORY]</tt>
|
||||
|
||||
\subsection cd-description Description Changes the current
|
||||
directory. If <tt>DIRECTORY</tt> is supplied it will become the new
|
||||
directory. If \c DIRECTORY is a relative path, the paths found in the
|
||||
CDPATH environment variable array will be tried as prefixes for the
|
||||
specified path. If CDPATH is not set, it is assumed to be '.'. If \c
|
||||
DIRECTORY is not specified, \$HOME will be the new directory.
|
||||
\subsection cd-description Description
|
||||
\c cd changes the current working directory.
|
||||
|
||||
If \c DIRECTORY is supplied, it will become the new directory. If no parameter
|
||||
is given, the contents of the \c HOME environment variable will be used.
|
||||
|
||||
If \c DIRECTORY is a relative path, the paths found in the
|
||||
\c CDPATH environment variable array will be tried as prefixes for the specified
|
||||
path.
|
||||
|
||||
Note that the shell will attempt to change directory without requiring \c cd
|
||||
if the name of a directory is provided (starting with '.', '/' or '~', or ending
|
||||
with '/').
|
||||
|
||||
\subsection cd-example Examples
|
||||
|
||||
\c cd changes the working directory to your home directory.
|
||||
|
||||
<code>cd /usr/src/fish-shell</code> changes the working directory to
|
||||
<code>/usr/src/fish-shell</code>.
|
||||
|
||||
@@ -4,11 +4,9 @@
|
||||
<tt>command COMMANDNAME [OPTIONS...]</tt>
|
||||
|
||||
\subsection command-description Description
|
||||
prefixing a command with the word 'command' forces fish to ignore any functions or builtins with the same name.
|
||||
|
||||
\c command forces the shell to execute the program \c COMMANDNAME and ignore any functions or builtins with the same name.
|
||||
|
||||
\subsection command-example Example
|
||||
|
||||
|
||||
<tt>command ls</tt>
|
||||
|
||||
causes fish to execute the ls program, even if there exists a 'ls' function.
|
||||
<tt>command ls</tt> causes fish to execute the \c ls program, even if an 'ls' function exists.
|
||||
|
||||
@@ -1,32 +1,34 @@
|
||||
\section commandline commandline - set or get the current commandline buffer
|
||||
\section commandline commandline - set or get the current command line buffer
|
||||
|
||||
\subsection commandline-synopsis Synopsis
|
||||
<tt>commandline [OPTIONS] [CMD]</tt>
|
||||
|
||||
\subsection commandline-description Description
|
||||
|
||||
\c commandline can be used to set or get the current contents of the command
|
||||
line buffer.
|
||||
|
||||
- \c CMD is the new value of the commandline. If unspecified, the
|
||||
current value of the commandline is written to standard output. All
|
||||
output from the commandline builtin is escaped, i.e. quotes are
|
||||
removed, backslash escapes are expanded, etc..
|
||||
With no parameters, \c commandline returns the current value of the command
|
||||
line.
|
||||
|
||||
The following switches change what the commandline builtin does
|
||||
With \c CMD specified, the command line buffer is erased and replaced with
|
||||
the contents of \c CMD.
|
||||
|
||||
The following options are available:
|
||||
|
||||
- \c -C or \c --cursor set or get the current cursor position, not
|
||||
the contents of the buffer. If no argument is given, the current
|
||||
cursor position is printed, otherwise the argument is interpreted
|
||||
as the new cursor position.
|
||||
- \c -f or \c --function inject readline functions into the
|
||||
reader. This option can not be combined with any other option. It
|
||||
reader. This option cannot be combined with any other option. It
|
||||
will cause any additional arguments to be interpreted as readline
|
||||
functions, and these functions will be injected into the reader, so
|
||||
that they will be returned to the reader before any additional
|
||||
actual key presses are read.
|
||||
|
||||
|
||||
The following switches change the way \c commandline updates the
|
||||
commandline buffer
|
||||
The following options change the way \c commandline updates the
|
||||
command line buffer:
|
||||
|
||||
- \c -a or \c --append do not remove the current commandline, append
|
||||
the specified string at the end of it
|
||||
@@ -35,29 +37,27 @@ commandline buffer
|
||||
- \c -r or \c --replace remove the current commandline and replace it
|
||||
with the specified string (default)
|
||||
|
||||
The following switches change what part of the commandline is printed
|
||||
or updated
|
||||
The following options change what part of the commandline is printed
|
||||
or updated:
|
||||
|
||||
- \c -b or \c --current-buffer select the entire buffer (default)
|
||||
- \c -j or \c --current-job select the current job
|
||||
- \c -p or \c --current-process select the current process
|
||||
- \c -t or \c --current-token select the current token.
|
||||
|
||||
The following switch changes the way \c commandline prints the current
|
||||
commandline buffer
|
||||
The following options change the way \c commandline prints the current
|
||||
commandline buffer:
|
||||
|
||||
- \c -c or \c --cut-at-cursor only print selection up until the
|
||||
current cursor position
|
||||
- \c -o or \c --tokenize tokenize the selection and print one string-type token per line
|
||||
|
||||
|
||||
If commandline is called during a call to complete a given string
|
||||
using <code>complete -C STRING</code>, commandline will consider the
|
||||
specified string to be the current contents of the commandline.
|
||||
If \c commandline is called during a call to complete a given string
|
||||
using <code>complete -C STRING</code>, \c commandline will consider the
|
||||
specified string to be the current contents of the command line.
|
||||
|
||||
\subsection commandline-example Example
|
||||
|
||||
<tt>commandline -j $history[3]</tt>
|
||||
|
||||
replaces the job under the cursor with the third item from the
|
||||
commandline history.
|
||||
<tt>commandline -j $history[3]</tt> replaces the job under the cursor with the
|
||||
third item from the command line history.
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
/** \page commands Commands, functions and builtins bundled with fish
|
||||
Fish ships with a large number of builtin commands, shellscript functions and external commands. These are all described below.
|
||||
/** \page commands Commands bundled with fish
|
||||
|
||||
\htmlonly <div class="fish_left_bar fish_left_little"> \endhtmlonly
|
||||
@command_list_toc@
|
||||
\htmlonly </div> \endhtmlonly
|
||||
|
||||
\htmlonly
|
||||
<div class="fish_right_bar fish_right_big">
|
||||
<h1 class="interior_title_borderless">Commands</h1>
|
||||
Fish ships with a large number of builtin commands, shellscript functions and external commands. These are all described below.
|
||||
\endhtmlonly
|
||||
@command_list@
|
||||
\htmlonly </div> \endhtmlonly
|
||||
|
||||
*/
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
\section complete complete - edit command specific tab-completions.
|
||||
\section complete complete - edit command specific tab-completions
|
||||
|
||||
\subsection complete-synopsis Synopsis
|
||||
<tt>complete (-c|--command|-p|--path) COMMAND [(-s|--short-option) SHORT_OPTION] [(-l|--long-option|-o|--old-option) LONG_OPTION [(-a||--arguments) OPTION_ARGUMENTS] [(-d|--description) DESCRIPTION] </tt>
|
||||
|
||||
\subsection complete-description Description
|
||||
|
||||
For an introduction to how to specify completions, see the section <a
|
||||
href='index.html#completion-own'>Writing your own completions</a> of
|
||||
For an introduction to specifying completions, see <a
|
||||
href='index.html#completion-own'>Writing your own completions</a> in
|
||||
the fish manual.
|
||||
|
||||
- <tt>COMMAND</tt> is the name of the command for which to add a completion
|
||||
|
||||
@@ -5,19 +5,22 @@
|
||||
|
||||
\subsection contains-description Description
|
||||
|
||||
\c contains tests whether the set \c VALUES contains the string
|
||||
<code>KEY</code>. If so, \c contains exits with status 0; if not, it exits
|
||||
with status 1.
|
||||
|
||||
The following options are available:
|
||||
|
||||
- \c -i or \c --index print the word index
|
||||
- \c -h or \c --help display this message
|
||||
|
||||
Test if the set VALUES contains the string KEY. Return status is 0 if
|
||||
yes, 1 otherwise
|
||||
|
||||
|
||||
\subsection contains-example Example
|
||||
<pre>
|
||||
for i in ~/bin /usr/local/bin
|
||||
if not contains \$i \$PATH
|
||||
set PATH \$PATH i
|
||||
set PATH \$PATH \$i
|
||||
end
|
||||
end
|
||||
</pre>
|
||||
|
||||
The above code tests if ~/bin and /usr/local/bin are in the path and if they are not, they are added.
|
||||
The above code tests if \c ~/bin and \c /usr/local/bin are in the path and adds them if not.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
\section continue continue - skip the rest of the current lap of the innermost currently evaluated loop
|
||||
\section continue continue - skip the remainder of the current iteration of the current inner loop
|
||||
|
||||
\subsection continue-synopsis Synopsis
|
||||
<tt>LOOP_CONSTRUCT; [COMMANDS...;] continue; [COMMANDS...;] end</tt>
|
||||
|
||||
\subsection continue-description Description
|
||||
The \c continue builtin is used to skip the current lap of the innermost currently running loop, such as a <a href="#for">for</a> loop or a <a href="#while">while</a> loop. It is usually added inside of a conditional block such as an <a href="#if">if</a> statement or a <a href="#switch">switch</a> statement.
|
||||
\c continue skips the remainder of the current iteration of the current inner loop, such as a <a href="#for">for</a> loop or a <a href="#while">while</a> loop. It is usually added inside of a conditional block such as an <a href="#if">if</a> statement or a <a href="#switch">switch</a> statement.
|
||||
|
||||
\subsection continue-example Example
|
||||
The following code removes all tmp files without smurfs.
|
||||
The following code removes all tmp files that do not contain the word smurf.
|
||||
|
||||
<pre>
|
||||
for i in *.tmp
|
||||
|
||||
@@ -5,21 +5,14 @@
|
||||
|
||||
\subsection count-description Description
|
||||
|
||||
The <tt>count</tt> builtin prints the number of arguments that were
|
||||
<tt>count</tt> prints the number of arguments that were
|
||||
passed to it. This is usually used to find out how many elements an
|
||||
environment variable array contains, but this is not the only
|
||||
potential usage for the count command.
|
||||
environment variable array contains.
|
||||
|
||||
The count command does not accept any options, not even '-h'. This way
|
||||
the user does not have to worry about an array containing elements
|
||||
such as dashes. \c fish performs a special check when invoking the
|
||||
count command, and if the user uses a help option, this help page is
|
||||
displayed, but if a help option is contained inside of a variable or
|
||||
is the result of expansion, it will simply be counted like any other
|
||||
argument.
|
||||
\c count does not accept any options, including '-h'.
|
||||
|
||||
Count exits with a non-zero exit status if no arguments where passed
|
||||
to it, with zero otherwise.
|
||||
\c count exits with a non-zero exit status if no arguments were passed
|
||||
to it, and with zero if at least one argument was passed.
|
||||
|
||||
\subsection count-example Example
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/** \page design Design document
|
||||
|
||||
\htmlonly <div class="fish_only_bar"> \endhtmlonly
|
||||
|
||||
\section design-overview Overview
|
||||
|
||||
This is a description of the design principles that have been used to
|
||||
@@ -13,7 +15,7 @@ Most tradeoffs between power and ease of use can be avoided with careful design.
|
||||
-# Whenever possible without breaking the above goals, fish should
|
||||
follow the Posix syntax.
|
||||
|
||||
To achive these high-level goals, the fish design relies on a number
|
||||
To achieve these high-level goals, the fish design relies on a number
|
||||
of more specific design principles. These are presented below,
|
||||
together with a rationale and a few examples for each.
|
||||
|
||||
@@ -33,43 +35,22 @@ program harder to maintain and update.
|
||||
Examples:
|
||||
|
||||
- Here documents are too similar to using echo inside of a pipeline.
|
||||
- Subshells, command substitution and process substitution are strongly related. \c fish only supports command substitution, the others can be achived either using a block or the psub shellscript function.
|
||||
- Subshells, command substitution and process substitution are strongly related. \c fish only supports command substitution, the others can be achieved either using a block or the psub shellscript function.
|
||||
- Having both aliases and functions is confusing, especially since both of them have limitations and problems. \c fish functions have none of the drawbacks of either syntax.
|
||||
- The many Posix quoting styles are silly, especially \$''.
|
||||
|
||||
\section sep The law of responsiveness
|
||||
|
||||
\section sep The law of minimalism
|
||||
|
||||
The shell should only contain features that cannot be implemented in
|
||||
a reasonable way outside of the shell. A large performance decrease,
|
||||
as well as some program complexity increase is acceptable in order to
|
||||
improve separation.
|
||||
The shell should attempt to remain responsive to the user at all times, even in the face of contended or unresponsive filesystems. It is only acceptable to block in response to a user initiated action, such as running a command.
|
||||
|
||||
Rationale:
|
||||
|
||||
A modular project is easier to maintain since smaller programs are far
|
||||
easier to understand than larger ones. A modular project is also more
|
||||
future proof since the modules can be individually
|
||||
replaced. Modularity also decreases the severity of bugs, since there
|
||||
is good hope that a bug, even a serious one, in one module, does not
|
||||
take the whole system down.
|
||||
Bad performance increases user-facing complexity, because it trains users to recognize and route around slow use cases. It is also incredibly frustrating.
|
||||
|
||||
Examples:
|
||||
|
||||
- Builtin commands should only be created when it cannot be
|
||||
avoided. \c echo, \c kill, \c printf and \c time are among the commands
|
||||
that fish does not implement internally since they can be provided as
|
||||
external commands. Several other commands that are commonly implemented
|
||||
as builtins and can not be implemented as external commands,
|
||||
including \c type, \c vared, \c pushd and \c popd are implemented as shellscript
|
||||
functions in fish.
|
||||
- Mathematical calculations, regex matching, generating lists of numbers
|
||||
and many other funtions can easily be done in external programs. They
|
||||
should not be supported internally by the shell.
|
||||
|
||||
The law of minimalism does not imply that a large feature set is
|
||||
bad. So long as a feature is not part of the shell itself, but a
|
||||
separate command or at least a shellscript function, bloat is fine.
|
||||
- Features like syntax highlighting and autosuggestions must perform all of their disk I/O asynchronously.
|
||||
- Startup should minimize forks and disk I/O, so that fish can be started even if the system is under load.
|
||||
|
||||
\section conf Configurability is the root of all evil
|
||||
|
||||
@@ -98,7 +79,7 @@ A special note on the evils of configurability is the long list of
|
||||
very useful features found in some shells, that are not turned on by
|
||||
default. Both zsh and bash support command specific completions, but
|
||||
no such completions are shipped with bash by default, and they are
|
||||
turned of by default in zsh. Other features that zsh support that are
|
||||
turned off by default in zsh. Other features that zsh support that are
|
||||
disabled by default include tab-completion of strings containing
|
||||
wildcards, a sane completion pager and a history file.
|
||||
|
||||
@@ -121,7 +102,7 @@ language will often be rather low-level.
|
||||
Examples:
|
||||
|
||||
- There should only be one type of input to the shell, lists of commands. Loops, conditionals and variable assignments are all performed through regular commands.
|
||||
- The differences between builtin commands, shellscript functions and builtin commands should be made as small as possible. Builtins and shellscript functions should have exactly the same types of argument expansion as other commands, should be possible to use in any position in a pipeline, and should support any io redirection.
|
||||
- The differences between builtin commands and shellscript functions should be made as small as possible. Builtins and shellscript functions should have exactly the same types of argument expansion as other commands, should be possible to use in any position in a pipeline, and should support any io redirection.
|
||||
- Instead of forking when performing command substitution to provide a fake variable scope, all fish commands are performed from the same process, and fish instead supports true scoping.
|
||||
- All blocks end with the \c end builtin.
|
||||
|
||||
@@ -153,3 +134,5 @@ Examples:
|
||||
- The language should be uniform, so that once the user understands the command/argument syntax, he will know the whole language, and be able to use tab-completion to discover new featues.
|
||||
|
||||
*/
|
||||
|
||||
\htmlonly </div> \endhtmlonly
|
||||
|
||||
@@ -4,5 +4,9 @@
|
||||
<tt>dirh</tt>
|
||||
|
||||
\subsection dirh-description Description
|
||||
|
||||
<tt>dirh</tt> prints the current directory history. The current position in the
|
||||
history is highlighted using <tt>$fish_color_history_current</tt>.
|
||||
history is highlighted using the color defined in the
|
||||
<tt>fish_color_history_current</tt> environment variable.
|
||||
|
||||
\c dirh does not accept any parameters.
|
||||
|
||||
@@ -4,4 +4,7 @@
|
||||
<tt>dirs</tt>
|
||||
|
||||
\subsection dirs-description Description
|
||||
<tt>dirs</tt> prints the current directory stack.
|
||||
<tt>dirs</tt> prints the current directory stack, as created by the
|
||||
<code><a href="#pushd">pushd</a></code> command.
|
||||
|
||||
\c dirs does not accept any parameters.
|
||||
|
||||
39
doc_src/echo.txt
Normal file
39
doc_src/echo.txt
Normal file
@@ -0,0 +1,39 @@
|
||||
\section echo echo - display a line of text
|
||||
|
||||
\subsection echo-synopsis Synopsis
|
||||
<tt>echo [STRING]</tt>
|
||||
|
||||
\subsection echo-description Description
|
||||
|
||||
\c echo displays a string of text.
|
||||
|
||||
The following options are available:
|
||||
|
||||
- \c -n, \c Do not output a newline
|
||||
- \c -s, \c Do not separate arguments with spaces
|
||||
- \c -E, \c Disable interpretation of backslash escapes (default)
|
||||
- \c -e, \c Enable interpretation of backslash escapes
|
||||
- \c -h, \c --help Display this help
|
||||
|
||||
\subsection echo-escapes Escape Sequences
|
||||
|
||||
If \c -e is used, the following sequences are recognized:
|
||||
|
||||
- \c \\\\ \c backslash
|
||||
- \\a alert (BEL)
|
||||
- \\b backspace
|
||||
- \\c produce no further output
|
||||
- \\e escape
|
||||
- \\f form feed
|
||||
- \\n new line
|
||||
- \\r carriage return
|
||||
- \\t horizontal tab
|
||||
- \\v vertical tab
|
||||
- \\0NNN byte with octal value NNN (1 to 3 digits)
|
||||
- \\xHH byte with hexadecimal value HH (1 to 2 digits)
|
||||
|
||||
\subsection echo-example Example
|
||||
|
||||
<tt>echo 'Hello World'</tt> Print hello world to stdout
|
||||
|
||||
<tt>echo -e 'Top\\nBottom'</tt> Print Top and Bottom on separate lines, using an escape sequence
|
||||
@@ -4,14 +4,18 @@
|
||||
<tt>if CONDITION; COMMANDS_TRUE...; [else; COMMANDS_FALSE...;] end</tt>
|
||||
|
||||
\subsection else-description Description
|
||||
<tt>if</tt> will execute the command CONDITION. If the condition's exit
|
||||
status is 0, the commands COMMANDS_TRUE will execute. If it is not 0 and
|
||||
<tt>else</tt> is given, COMMANDS_FALSE will be executed. Hint: use
|
||||
<a href="#begin"><tt>begin; ...; end</tt></a> for complex conditions.
|
||||
<tt>if</tt> will execute the command \c CONDITION. If the condition's exit
|
||||
status is 0, the commands \c COMMANDS_TRUE will execute. If it is not 0 and
|
||||
<tt>else</tt> is given, \c COMMANDS_FALSE will be executed.
|
||||
|
||||
\subsection else-example Example
|
||||
|
||||
The command <tt>if test -f foo.txt; echo foo.txt exists; else; echo foo.txt does not exist; end</tt>
|
||||
will print <tt>foo.txt exists</tt> if the file foo.txt
|
||||
exists and is a regular file, otherwise it will print
|
||||
<tt>foo.txt does not exist</tt>.
|
||||
The following code tests whether a file \c foo.txt exists as a regular file.
|
||||
|
||||
<pre>
|
||||
if test -f foo.txt
|
||||
echo foo.txt exists
|
||||
else
|
||||
echo foo.txt does not exist
|
||||
end
|
||||
</pre>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
\section emit emit - Emit a generic event
|
||||
|
||||
\subsection block-synopsis Synopsis
|
||||
<tt>emit EVENT_NAME</tt>
|
||||
<tt>emit EVENT_NAME [ARGUMENTS...]</tt>
|
||||
|
||||
\subsection emit-description Description
|
||||
|
||||
The emit builtin fires a generic fish event. Such events can be caught by special functions called event handlers.
|
||||
\c emit emits, or fires, an event. Events are delivered to, or caught by, special functions called event handlers. The arguments are passed to the event handlers as function arguments.
|
||||
|
||||
\subsection emit-example Example
|
||||
|
||||
@@ -13,7 +13,8 @@ The following code first defines an event handler for the generic
|
||||
event named 'test_event', and then emits an event of that type.
|
||||
|
||||
<pre>function event_test --on-event test_event
|
||||
echo event test!!!
|
||||
echo event test: $argv
|
||||
end
|
||||
|
||||
emit test_event</pre>
|
||||
emit test_event something
|
||||
</pre>
|
||||
|
||||
@@ -10,7 +10,9 @@ switch VALUE; [case [WILDCARD...]; [COMMANDS...]; ...] end
|
||||
</pre>
|
||||
|
||||
\subsection end-description Description
|
||||
<tt>end</tt> ends a block of commands. For more information, read the
|
||||
<tt>end</tt> ends a block of commands.
|
||||
|
||||
For more information, read the
|
||||
documentation for the block constructs, such as \c if, \c for and \c
|
||||
while.
|
||||
|
||||
|
||||
@@ -4,13 +4,16 @@
|
||||
<tt>eval [COMMANDS...]</tt>
|
||||
|
||||
\subsection eval-description Description
|
||||
The <tt>eval</tt> function causes fish to evaluate the specified parameters as a command. If more than one parameter is specified, all parameters will be joined using a space character as a separator.
|
||||
<tt>eval</tt> evaluates the specified parameters as a command. If more than one parameter is specified, all parameters will be joined using a space character as a separator.
|
||||
|
||||
\subsection eval-example Example
|
||||
|
||||
The folloing code will call the ls command. Note that \c fish does not
|
||||
support the use of environment variables as direct commands; \c eval can
|
||||
be used to work around this.
|
||||
|
||||
<pre>
|
||||
set cmd ls
|
||||
eval $cmd
|
||||
</pre>
|
||||
|
||||
will call the ls command.
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
\subsection exec-description Description
|
||||
|
||||
The \c exec builtin is used to replace the currently running shells
|
||||
process image with a new command. On successful completion, exec never
|
||||
returns. exec can not be used inside a pipeline.
|
||||
\c exec replaces the currently running shell with a new command.
|
||||
On successful completion, \c exec never returns. \c exec cannot be used
|
||||
inside a pipeline.
|
||||
|
||||
\subsection exec-example Example
|
||||
|
||||
<tt>exec emacs</tt> starts up the emacs text editor. When emacs exits,
|
||||
the session will terminate.
|
||||
<tt>exec emacs</tt> starts up the emacs text editor, and exits \c fish.
|
||||
When emacs exits, the session will terminate.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
\section exit exit - exit the shell.
|
||||
\section exit exit - exit the shell
|
||||
|
||||
\subsection exit-synopsis Synopsis
|
||||
<tt>exit [STATUS]</tt>
|
||||
|
||||
\subsection exit-description Description
|
||||
|
||||
The <tt>exit</tt> builtin causes fish to exit. If <tt>STATUS</tt> is
|
||||
\c exit causes fish to exit. If <tt>STATUS</tt> is
|
||||
supplied, it will be converted to an integer and used as the exit
|
||||
code. Otherwise the exit code will be that of the last command executed.
|
||||
code. Otherwise, the exit code will be that of the last command executed.
|
||||
|
||||
If exit is called while sourcing a file (using the <a
|
||||
href="#source">.</a> builtin) the rest of the file will be skipped,
|
||||
|
||||
161
doc_src/faq.hdr
161
doc_src/faq.hdr
@@ -1,13 +1,120 @@
|
||||
/** \page faq Frequently asked questions
|
||||
|
||||
\htmlonly <div class="fish_left_bar fish_left_big"> \endhtmlonly
|
||||
|
||||
- <a href='#faq-envvar'>How do I set or clear an environment variable?</a>
|
||||
- <a href='#faq-login-cmd'>How do I run a command every login? What's fish's equivalent to <tt>.bashrc</tt>?</a>
|
||||
- <a href='#faq-prompt'>How do I set my prompt?</a>
|
||||
- <a href='#faq-cmd-history'>How do I run a command from history?</a>
|
||||
- <a href='#faq-subcommand'>How do I run a subcommand? The backtick doesn't work!</a>
|
||||
- <a href='#faq-exit-status'>How do I get the exit status of a command?</a>
|
||||
- <a href='#faq-single-env'>How do I set an environment variable for just one command?</a>
|
||||
- <a href='#faq-customize-colors'>How do I customize my syntax highlighting colors?</a>
|
||||
- <a href='#faq-update-manpage-completions'>How do I update man page completions?</a>
|
||||
- <a href='#faq-cwd-symlink'>Why does cd, pwd and other fish commands always resolve symlinked directories to their canonical path?</a>
|
||||
- <a href='#faq-cd-autocomplete'>Why does the cd command autocompletion list the subdirectories of my home directory as completions?</a>
|
||||
- <a href='#faq-cd-implicit'>I accidentally entered a directory path and fish changed directory. What happened?</a>
|
||||
- <a href='#faq-open'>The open command doesn't work.</a>
|
||||
- <a href='#faq-default'>How do I make fish my default shell?</a>
|
||||
- <a href='#faq-titlebar'>I'm seeing weird output before each prompt when using screen. What's wrong?</a>
|
||||
- <a href='#faq-greeting'>How do I change the greeting message?</a>
|
||||
- <a href='#faq-history'>Why doesn't history substitution ("!$" etc.) work?</a>
|
||||
- <a href='#faq-uninstalling'>How do I uninstall fish?</a>
|
||||
|
||||
\htmlonly
|
||||
</div>
|
||||
<div class="fish_right_bar fish_right_little">
|
||||
<h1 class="interior_title">Frequently Asked Questions</h1>
|
||||
|
||||
\endhtmlonly
|
||||
|
||||
\section faq-envvar How do I set or clear an environment variable?
|
||||
|
||||
Use the <a href="commands.html#set"><code>set</code></a> command:
|
||||
|
||||
<pre>set -x key value
|
||||
set -e key</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
\section faq-login-cmd How do I run a command every login? What's fish's equivalent to .bashrc?
|
||||
|
||||
Edit the file <tt>~/.config/fish/config.fish</tt>, creating it if it does not
|
||||
exist. (Note the leading period.)
|
||||
|
||||
<hr>
|
||||
|
||||
\section faq-prompt How do I set my prompt?
|
||||
|
||||
The prompt is the output of the \c fish_prompt function. Put it in
|
||||
<tt>~/.config/fish/functions/fish_prompt.fish</tt>. For example, a simple
|
||||
prompt is:
|
||||
<pre>function fish_prompt
|
||||
set_color $fish_color_cwd
|
||||
echo -n (prompt_pwd)
|
||||
set_color normal
|
||||
echo -n ' > '
|
||||
end</pre>
|
||||
|
||||
You can also use the Web configuration tool,
|
||||
<a href="commands.html#fish_config"><code>fish_config</code></a>, to preview
|
||||
and choose from a gallery of sample prompts.
|
||||
|
||||
<hr>
|
||||
|
||||
\section faq-cmd-history How do I run a command from history?
|
||||
|
||||
Type some part of the command, and then hit the up or down arrow keys to
|
||||
navigate through history matches.
|
||||
|
||||
<hr>
|
||||
|
||||
\section faq-subcommand How do I run a subcommand? The backtick doesn't work!
|
||||
|
||||
\c fish uses parentheses for subcommands. For example:
|
||||
|
||||
<pre>for i in (ls)
|
||||
echo $i
|
||||
end</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
\section faq-exit-status How do I get the exit status of a command?
|
||||
|
||||
Use the \c $status variable. This replaces the \c $? variable used in some
|
||||
other shells.
|
||||
|
||||
<hr>
|
||||
|
||||
\section faq-single-env How do I set an environment variable for just one command?
|
||||
|
||||
<i><tt>SOME_VAR=1 command</tt> produces an error: <tt>Unknown command "SOME_VAR=1"</tt>.</i>
|
||||
|
||||
Use the \c env command.
|
||||
|
||||
<tt>env SOME_VAR=1 command</tt>
|
||||
|
||||
You can also declare a local variable in a block:
|
||||
|
||||
<pre>begin
|
||||
set -lx SOME_VAR 1
|
||||
command
|
||||
end</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
\section faq-customize-colors How do I customize my syntax highlighting colors?
|
||||
|
||||
Use the web configuration tool,
|
||||
<a href="commands.html#fish_config"><code>fish_config</code></a>, or alter the
|
||||
<a href="index.html#variables-color">\c fish_color family of environment variables</a>.
|
||||
|
||||
<hr>
|
||||
|
||||
\section faq-update-manpage-completions How do I update man page completions?
|
||||
|
||||
Use the
|
||||
<a href="commands.html#fish_update_completions"><tt>fish_update_completions</tt></a>
|
||||
command.
|
||||
|
||||
<hr>
|
||||
|
||||
@@ -26,9 +133,9 @@ handled, and are varitations of the following example:
|
||||
|
||||
Writing <code>cd images; ls ..</code> given the above directory
|
||||
structure would list the contents of ~/Documents, not of ~, even
|
||||
though using <code>cd ..</code> changes the current direcotry to ~,
|
||||
though using <code>cd ..</code> changes the current directory to ~,
|
||||
and the prompt, the pwd builtin and many other directory information
|
||||
sources suggest that the the current directory is ~/images and it's
|
||||
sources suggest that the current directory is ~/images and its
|
||||
parent is ~. This issue is not possible to fix without either making
|
||||
every single command into a builtin, breaking Unix semantics or
|
||||
implementing kludges in every single command.
|
||||
@@ -42,19 +149,9 @@ silently fails in shells that don't resolve symlinked paths.
|
||||
|
||||
<hr>
|
||||
|
||||
\section faq-cd-autocomplete Why does the cd command autocompletion list the subdirectories of my home directory as completions?
|
||||
|
||||
Because they are completions. In fish, if you specify a relative
|
||||
directory to the cd command, i.e. any path that does not start with
|
||||
either './' or '/', the environment variable CDPATH will be examined, and any
|
||||
directories in this path is used as a base direcotry. To disable this
|
||||
feature, write <code>set CDPATH .</code> on the commandline.
|
||||
|
||||
<hr>
|
||||
|
||||
\section faq-cd-implicit I accidentally entered a directory path and fish changed directory. What happened?
|
||||
|
||||
If fish is unable to locate a command with a given name, fish will
|
||||
If fish is unable to locate a command with a given name, and it starts with '.', '/' or '~', fish will
|
||||
test if a directory of that name exists. If it does, it is implicitly
|
||||
assumed that you want to change working directory. For example, the
|
||||
fastest way to switch to your home directory is to simply press
|
||||
@@ -64,13 +161,12 @@ fastest way to switch to your home directory is to simply press
|
||||
|
||||
\section faq-open The open command doesn't work.
|
||||
|
||||
The open command uses the mimetype database and the .desktop files
|
||||
The \c open command uses the MIME type database and the <code>.desktop</code> files
|
||||
used by Gnome and KDE to identify filetypes and default actions. If
|
||||
at least one of these two desktops are installed, but the open command is
|
||||
at least one of these environments is installed, but the open command is
|
||||
not working, this probably means that the relevant files are installed
|
||||
in a nonstandard location. Please contact the <a
|
||||
href='mailto:fish-users@lists.sf.net'>fish mailing list</a>, and
|
||||
hopefully this can be resolved.
|
||||
in a non-standard location. Consider <a href="index.html#more-help">asking for
|
||||
more help</a>.
|
||||
|
||||
<hr>
|
||||
|
||||
@@ -91,10 +187,10 @@ In order to change your default shell, type:
|
||||
|
||||
<code>chsh -s /usr/local/bin/fish</code>
|
||||
|
||||
You may need to adjust the above path to e.g. /usr/bin/fish. Use the command <code>which fish</code> if you are unsure of where fish is installed.
|
||||
You may need to adjust the above path to e.g. \c /usr/bin/fish. Use the command <code>which fish</code> if you are unsure of where fish is installed.
|
||||
|
||||
Unfortunatly, there is no way to make the changes take effect at once,
|
||||
you will need to log out and back in again.
|
||||
Unfortunately, there is no way to make the changes take effect at once.
|
||||
You will need to log out and back in again.
|
||||
|
||||
<hr>
|
||||
|
||||
@@ -114,7 +210,7 @@ The long answer:
|
||||
|
||||
Fish is trying to set the titlebar message of your terminal. While
|
||||
screen itself supports this feature, your terminal does
|
||||
not. Unfortuntaly, when the underlying terminal doesn't support
|
||||
not. Unfortunately, when the underlying terminal doesn't support
|
||||
setting the titlebar, screen simply passes through the escape codes
|
||||
and text to the underlying terminal instead of ignoring them. It is
|
||||
impossible detect and resolve this problem from inside fish since fish
|
||||
@@ -158,4 +254,23 @@ Fish history recall is very simple yet effective:
|
||||
|
||||
See <a href='index.html#editor'>documentation</a> for more details about line editing in fish.
|
||||
|
||||
<hr>
|
||||
|
||||
\section faq-uninstalling Uninstalling fish
|
||||
|
||||
Should you wish to uninstall fish, first ensure fish is not set as your shell. Run <code>chsh -s /bin/bash</code> if you are not sure.
|
||||
|
||||
Next, do the following (assuming fish was installed to /usr/local):
|
||||
|
||||
<pre>
|
||||
rm -Rf /usr/local/etc/fish /usr/local/share/fish ~/.config/fish
|
||||
rm /usr/local/share/man/man1/fish*.1
|
||||
cd /usr/local/bin
|
||||
rm -f fish mimedb fish_pager fishd fish_indent
|
||||
</pre>
|
||||
|
||||
*/
|
||||
|
||||
\htmlonly
|
||||
</div>
|
||||
\endhtmlonly
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
\section fg fg - send job to foreground
|
||||
\section fg fg - bring job to foreground
|
||||
|
||||
\subsection fg-synopsis Synopsis
|
||||
<tt>fg [PID]</tt>
|
||||
|
||||
\subsection fg-description Description
|
||||
Sends the specified job to the foreground. While a foreground job is
|
||||
executed, fish is suspended. If no job is specified, the last job to be used is put in the foreground. If PID is specified, the job with the specified group id is put in the foreground.
|
||||
\c fg brings the specified <a href="index.html#syntax-job-control">job</a> to the foreground, resuming it if it is stopped. While a foreground job is
|
||||
executed, fish is suspended. If no job is specified, the last job to be used is put in the foreground. If PID is specified, the job with the specified group ID is put in the foreground.
|
||||
|
||||
The PID of the desired process is usually found by using <a href="index.html#expand-process">process expansion</a>.
|
||||
|
||||
\subsection fg-example Example
|
||||
|
||||
<tt>fg \%0</tt> will put the job with job id 0 in the foreground.
|
||||
<tt>fg \%1</tt> will put the job with job ID 1 in the foreground.
|
||||
|
||||
@@ -5,10 +5,12 @@ fish [-h] [-v] [-c command] [FILE [ARGUMENTS...]]
|
||||
|
||||
\subsection fish-description Description
|
||||
|
||||
A commandline shell written mainly with interactive use in mind. The
|
||||
full manual is available <a href='index.html'>in html</a> by using the
|
||||
\c fish is a command-line shell written mainly with interactive use in mind. The
|
||||
full manual is available <a href='index.html'>in HTML</a> by using the
|
||||
<a href='#help'>help</a> command from inside fish.
|
||||
|
||||
The following options are available:
|
||||
|
||||
- <code>-c</code> or <code>--command=COMMANDS</code> evaluate the specified commands instead of reading from the commandline
|
||||
- <code>-d</code> or <code>--debug-level=DEBUG_LEVEL</code> specify the verbosity level of fish. A higher number means higher verbosity. The default level is 1.
|
||||
- <code>-h</code> or <code>--help</code> display help and exit
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
\section fish_config fish_config - Start up the web-based configuration interface
|
||||
\section fish_config fish_config - start the web-based configuration interface
|
||||
|
||||
\subsection fish_config-description Description
|
||||
|
||||
This command starts up the web-based configuration interface, which allows you to edit your colors and view your functions, variables, and history.
|
||||
\c fish_config starts the web-based configuration interface.
|
||||
|
||||
The web interface allows you to view your functions, variables and history, and
|
||||
to make changes to your prompt and color configuration.
|
||||
|
||||
\c fish_config starts a local web server and then opens a web browser window; when
|
||||
you have finished, close the browser window and then press the Enter key to
|
||||
terminate the configuration session.
|
||||
|
||||
<code>fish_config</code> optionally accepts name of the initial configuration tab. For e.g. <code>fish_config history</code> will start configuration interface with history tab.
|
||||
|
||||
If the \c BROWSER environment variable is set, it will be used as the name
|
||||
of the web browser to open instead of the system default.
|
||||
|
||||
\subsection fish_config-example Example
|
||||
|
||||
\c fish_config opens a new web browser window and allows you to configure certain
|
||||
fish settings.
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
\subsection fish_indent-description Description
|
||||
|
||||
\c fish_indent is used to indent or otherwise prettify a piece of fish
|
||||
\c fish_indent is used to indent a piece of fish
|
||||
code. \c fish_indent reads commands from standard input and outputs
|
||||
them to standard output.
|
||||
|
||||
\c fish_indent understands the following options:
|
||||
The following options are available:
|
||||
|
||||
- <tt>-h</tt> or <tt>--help</tt> displays this help message and then exits
|
||||
- <tt>-i</tt> or <tt>--no-indent</tt> do not indent commands
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
\subsection fish_pager-description Description
|
||||
|
||||
This command is used internally by fish to display a list of
|
||||
completions. It should not be used by other commands, as it's
|
||||
interface is liable to change in the future.
|
||||
\c fish_pager is used internally by fish. It should not be used by other
|
||||
commands, as its interface is liable to change in the future.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
\section fish_prompt fish_prompt - define the apperance of the command line prompt
|
||||
\section fish_prompt fish_prompt - define the appearance of the command line prompt
|
||||
|
||||
\subsection fish_promt-synopsis Synopsis
|
||||
\subsection fish_prompt-synopsis Synopsis
|
||||
<pre>function fish_prompt
|
||||
...
|
||||
end</pre>
|
||||
@@ -11,6 +11,11 @@ By defining the \c fish_prompt function, the user can choose a custom
|
||||
prompt. The \c fish_prompt function is executed when the prompt is to
|
||||
be shown, and the output is used as a prompt.
|
||||
|
||||
The exit status of commands within \c fish_prompt will not modify the value of <a href="index.html#variables-status">$status</a> outside of the \c fish_prompt function.
|
||||
|
||||
\c fish ships with a number of example prompts that can be chosen with the
|
||||
\c fish_config command.
|
||||
|
||||
\subsection fish_prompt-example Example
|
||||
|
||||
A simple prompt:
|
||||
|
||||
23
doc_src/fish_right_prompt.txt
Normal file
23
doc_src/fish_right_prompt.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
\section fish_right_prompt fish_right_prompt - define the appearance of the right-side command line prompt
|
||||
|
||||
\subsection fish_right_prompt-synopsis Synopsis
|
||||
<pre>function fish_right_prompt
|
||||
...
|
||||
end</pre>
|
||||
|
||||
\subsection fish_right_prompt-description Description
|
||||
|
||||
\c fish_right_prompt is similar to \c fish_prompt, except that it appears on the right side of the terminal window.
|
||||
|
||||
Multiple lines are not supported in \c fish_right_prompt.
|
||||
|
||||
\subsection fish_prompt-example Example
|
||||
|
||||
A simple right prompt:
|
||||
|
||||
<pre>
|
||||
function fish_right_prompt -d "Write out the right prompt"
|
||||
date "+%m/%d/%y"
|
||||
end
|
||||
</pre>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
\section fish_update_completions fish_update_completions - Update man-page completions
|
||||
\section fish_update_completions fish_update_completions - Update completions using manual pages
|
||||
|
||||
\subsection fish_update_completions-description Description
|
||||
|
||||
This command parses your installed man pages and writes completion files to the fish config directory. This does not overwrite custom completions.
|
||||
\c fish_update_completions parses manual pages installed on the system, and attempts to create completion files in the \c fish configuration directory.
|
||||
|
||||
This does not overwrite custom completions.
|
||||
|
||||
There are no parameters for <code>fish_update_completions</code>.
|
||||
|
||||
@@ -6,26 +6,28 @@
|
||||
\subsection fishd-description Description
|
||||
|
||||
The \c fishd daemon is used to load, save and distribute universal
|
||||
variable information. fish automatically connects to fishd via a socket
|
||||
on startup. If no instance of fishd is running, fish spawns a new
|
||||
fishd instance. fishd will create a socket in /tmp, and wait for
|
||||
incoming connections from universal variable clients, such as fish,
|
||||
When no clients are connected, fishd will automatically shut down.
|
||||
variable information. \c fish automatically connects to \c fishd via a socket
|
||||
on startup.
|
||||
|
||||
\c fishd is started and stopped automatically.
|
||||
|
||||
The following options are available if starting \c fishd manually:
|
||||
|
||||
- <tt>-h</tt> or <tt>--help</tt> displays this help message and then exits
|
||||
- <tt>-v</tt> or <tt>--version</tt> displays the current fish version and then exits
|
||||
|
||||
\subsection fishd-files Files
|
||||
|
||||
\c ~/.config/fish/fishd.HOSTNAME permanent storage location for universal
|
||||
variable data. The data is stored as a set of \c set and \c set_export
|
||||
commands such as would be parsed by fishd. The file must always be
|
||||
stored in ASCII format. If an instance of fishd is running (which is
|
||||
generally the case), manual modifications to ~/.fishd.HOSTNAME will be
|
||||
lost. Do NOT edit this file manually!
|
||||
- \c ~/.config/fish/fishd.MACHINE_ID - permanent storage location for universal
|
||||
variable data. \c MACHINE_ID is generally based on the machine's MAC address.
|
||||
|
||||
\c /tmp/fishd.socket.USERNAME the socket which fishd uses to communicate
|
||||
The data is stored as a set of \c set and \c set_export commands such as
|
||||
would be parsed by fishd. The file must always be stored in YAML format.
|
||||
If an instance of fishd is running (which is generally the case), manual
|
||||
modifications to \c ~/.fishd.MACHINE_ID will be lost. Do NOT edit this file manually!
|
||||
|
||||
- \c /tmp/fishd.socket.USERNAME - the socket which fishd uses to communicate
|
||||
with all clients.
|
||||
|
||||
/tmp/fishd.log.USERNAME the fishd log file
|
||||
- /tmp/fishd.log.USERNAME - the fishd log file
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
\subsection for-description Description
|
||||
<tt>for</tt> is a loop construct. It will perform the commands specified by
|
||||
COMMANDS multiple times. Each time the environment variable specified by
|
||||
VARNAME is assigned a new value from VALUES. If VALUES is empty, COMMANDS will
|
||||
\c COMMANDS multiple times. On each iteration, the environment variable specified by
|
||||
\c VARNAME is assigned a new value from \c VALUES. If \c VALUES is empty, \c COMMANDS will
|
||||
not be executed at all.
|
||||
|
||||
\subsection for-example Example
|
||||
|
||||
@@ -1,9 +1,21 @@
|
||||
\section funced funced - edit a function interactively
|
||||
|
||||
\subsection funced-synopsis Synopsis
|
||||
<code>funced NAME</code>
|
||||
<code>funced [OPTIONS] NAME</code>
|
||||
|
||||
\subsection funced-description Description
|
||||
|
||||
Use the funced command to interactively edit the definition of a
|
||||
function. If there is no function with the name specified, a skeleton function is inserted, if a function exist, the definion will be shown on the command line.
|
||||
\c funced provides an interface to edit the definition of the function
|
||||
<code>NAME</code>.
|
||||
|
||||
If the \c $EDITOR environment variable is set, it will be used as the program
|
||||
to edit the function. Otherwise, a built-in editor will be used.
|
||||
|
||||
If there is no function called \c NAME a new function will be created with
|
||||
the specified name
|
||||
|
||||
- <code>-e command</code> or <code>--editor command</code> Open the function
|
||||
body inside the text editor given by the command (for example, "vi"). The
|
||||
command 'fish' will use the built-in editor.
|
||||
- <code>-i</code> or <code>--interactive</code> Open function body in the
|
||||
built-in editor.
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
\section funcsave funcsave - save the definition of a function to the users autoload directory
|
||||
\section funcsave funcsave - save the definition of a function to the user's autoload directory
|
||||
|
||||
\subsection funcsave-synopsis Synopsis
|
||||
<tt>funcsave FUNCTION_NAME</tt>
|
||||
<tt>funcsave FUNCTION_NAME</tt>
|
||||
|
||||
\subsection funcsave-description Description
|
||||
|
||||
funcsave is used to save the current definition of a function to
|
||||
a file which will be autoloaded by current and future fish
|
||||
\c funcsave saves the current definition of a function to
|
||||
a file in the fish configuration directory. This function will be automatically
|
||||
loaded by current and future fish
|
||||
sessions. This can be useful if you have interactively created a new
|
||||
function and wish to save it for later use.
|
||||
|
||||
|
||||
@@ -5,32 +5,31 @@
|
||||
|
||||
\subsection function-description Description
|
||||
|
||||
- <code>-d DESCRIPTION</code> or \c --description=DESCRIPTION is a description of what the function does, suitable as a completion description
|
||||
\c function creates a new function \c NAME with the body <code>BODY</code>.
|
||||
|
||||
A function is a list of commands that will be executed when the name of the
|
||||
function is given as a command.
|
||||
|
||||
The following options are available:
|
||||
|
||||
- <code>-a NAMES</code> or <code>--argument-names NAMES</code> assigns the value of successive command-line arguments to the names given in NAMES.
|
||||
- <code>-d DESCRIPTION</code> or \c --description=DESCRIPTION is a description of what the function does, suitable as a completion description.
|
||||
- <code>-e</code> or <code>--on-event EVENT_NAME</code> tells fish to run this function when the specified named event is emitted. Fish internally generates named events e.g. when showing the prompt.
|
||||
- <code>-j PID</code> or <code> --on-job-exit PID</code> tells fish to run this function when the job with group id PID exits. Instead of PID, the string 'caller' can be specified. This is only legal when in a command substitution, and will result in the handler being triggered by the exit of the job which created this command substitution.
|
||||
- <code>-p PID</code> or <code> --on-process-exit PID</code> tells fish to run this function when the fish child process with process id PID exits
|
||||
- <code>-s</code> or <code>--on-signal SIGSPEC</code> tells fish to run this function when the signal SIGSPEC is delivered. SIGSPEC can be a signal number, or the signal name, such as SIGHUP (or just HUP)
|
||||
- <code>-v</code> or <code>--on-variable VARIABLE_NAME</code> tells fish to run this function when the variable VARIABLE_NAME changes value
|
||||
|
||||
This builtin command is used to create a new function. A function is a
|
||||
list of commands that will be executed when the name of the function
|
||||
is entered. The function
|
||||
|
||||
<pre>
|
||||
function hi
|
||||
echo hello
|
||||
end
|
||||
</pre>
|
||||
|
||||
will write <code>hello</code> whenever the user enters \c hi.
|
||||
- <code>-j PID</code> or <code> --on-job-exit PID</code> tells fish to run this function when the job with group ID PID exits. Instead of PID, the string 'caller' can be specified. This is only legal when in a command substitution, and will result in the handler being triggered by the exit of the job which created this command substitution.
|
||||
- <code>-p PID</code> or <code> --on-process-exit PID</code> tells fish to run this function when the fish child process with process ID PID exits.
|
||||
- <code>-s</code> or <code>--on-signal SIGSPEC</code> tells fish to run this function when the signal SIGSPEC is delivered. SIGSPEC can be a signal number, or the signal name, such as SIGHUP (or just HUP).
|
||||
- \c -S or \c --no-scope-shadowing allows the function to access the variables of calling functions. Normally, any variables inside the function that have the same name as variables from the calling function are "shadowed", and their contents is independent of the calling function.
|
||||
- <code>-v</code> or <code>--on-variable VARIABLE_NAME</code> tells fish to run this function when the variable VARIABLE_NAME changes value.
|
||||
|
||||
If the user enters any additional arguments after the function, they
|
||||
are inserted into the environment <a href="index.html#variables-arrays">variable array</a> argv.
|
||||
are inserted into the environment <a href="index.html#variables-arrays">variable array</a>
|
||||
<code>$argv</code>. If the \c --argument-names option is provided, the arguments are
|
||||
also assigned to names specified in that option.
|
||||
|
||||
By using one of the event handler switches, a function can be made to run automatically at specific events. The user may generate new events using the <a href='#emit">emit</a> builtin. Fish generates the following named events:
|
||||
By using one of the event handler switches, a function can be made to run automatically at specific events. The user may generate new events using the <a href="#emit">emit</a> builtin. Fish generates the following named events:
|
||||
|
||||
- \c fish_prompt, which is emitted whenever a new fish prompt is about to be displayed
|
||||
- \c fish_command_not_found, which is emitted whenever a command lookup failed
|
||||
- \c fish_prompt, which is emitted whenever a new fish prompt is about to be displayed.
|
||||
- \c fish_command_not_found, which is emitted whenever a command lookup failed.
|
||||
|
||||
\subsection function-example Example
|
||||
|
||||
@@ -44,7 +43,7 @@ will run the \c ls command, using the \c -l option, while passing on any additio
|
||||
|
||||
<pre>
|
||||
function mkdir -d "Create a directory and set CWD"
|
||||
mkdir $argv
|
||||
command mkdir $argv
|
||||
if test $status = 0
|
||||
switch $argv[(count $argv)]
|
||||
case '-*'
|
||||
|
||||
@@ -1,31 +1,51 @@
|
||||
\section functions functions - print or erase functions
|
||||
|
||||
\subsection function-synopsis Synopsis
|
||||
<code>functions [-e] FUNCTIONS...</code>
|
||||
<pre>functions [-n]
|
||||
functions -c OLDNAME NEWNAME
|
||||
functions -d DESCRIPTION FUNCTION
|
||||
functions [-eq] FUNCTIONS...</pre>
|
||||
|
||||
\subsection functions-description Description
|
||||
|
||||
This builtin command is used to print or erase functions.
|
||||
\c functions prints or erases functions.
|
||||
|
||||
- <code>-a</code> or <code>--all</code> list all functions, even those whose name start with an underscore.
|
||||
The following options are available:
|
||||
|
||||
- <code>-a</code> or <code>--all</code> lists all functions, even those whose name start with an underscore.
|
||||
- <code>-c OLDNAME NEWNAME</code> or <code>--copy OLDNAME NEWNAME</code> creates a new function named NEWNAME, using the definition of the OLDNAME function.
|
||||
- <code>-d DESCRIPTION</code> or <code>--description=DESCRIPTION</code> change the description of this function
|
||||
- <code>-d DESCRIPTION</code> or <code>--description=DESCRIPTION</code> changes the description of this function.
|
||||
- <code>-e</code> or <code>--erase</code> causes the specified functions to be erased.
|
||||
- <code>-h</code> or <code>--help</code> display a help message and exit
|
||||
- <code>-n</code> or <code>--names</code> list only the names of all defined functions, not their definition
|
||||
- <code>-q</code> or <code>--query</code> test if the specified functions exist. Does not output anything, but the builtins exit status is the number of functions specified that were not defined.
|
||||
- <code>-h</code> or <code>--help</code> displays a help message and exits.
|
||||
- <code>-n</code> or <code>--names</code> lists the names of all defined functions.
|
||||
- <code>-q</code> or <code>--query</code> tests if the specified functions exist.
|
||||
|
||||
The default behavior of \c functions when called with no arguments,
|
||||
is to print the names and definitions of all defined functions. If any
|
||||
non-switch parameters are given, only the definition of the specified
|
||||
The default behavior of <code>functions</code>, when called with no arguments,
|
||||
is to print the names of all defined functions. Unless the \c -a option is
|
||||
given, no functions starting with underscores are not included in the output.
|
||||
|
||||
If any non-option parameters are given, the definition of the specified
|
||||
functions are printed.
|
||||
|
||||
Automatically loaded functions can not be removed using functions
|
||||
-e. Either remove the definition file or change the
|
||||
Automatically loaded functions cannot be removed using <code>functions
|
||||
-e</code>. Either remove the definition file or change the
|
||||
$fish_function_path variable to remove autoloaded functions.
|
||||
|
||||
Function copies, created with -c, will not have any event/signal/on-exit
|
||||
notifications that the original may have had.
|
||||
Copying a function using \c -c copies only the body of the function, and
|
||||
does not attach any event notifications from the original function.
|
||||
|
||||
The exit status of the functions builtin is the number functions
|
||||
specified in the argument list that do not exist.
|
||||
Only one function's description can be changed in a single invocation
|
||||
of <code>functions -d</code>.
|
||||
|
||||
The exit status of \c functions is the number of functions
|
||||
specified in the argument list that do not exist, which can be used in
|
||||
concert with the \c -q option.
|
||||
|
||||
\subsection functions-example Examples
|
||||
|
||||
<code>functions -n</code> displays a list of currently-defined functions.
|
||||
|
||||
<code>functions -c foo bar</code> copies the \c foo function to a new function called
|
||||
<code>bar</code>.
|
||||
|
||||
<code>functions -e bar</code> erases the function <code>bar</code>.
|
||||
|
||||
@@ -5,12 +5,14 @@
|
||||
|
||||
\subsection help-description Description
|
||||
|
||||
The \c help command is used to display a section of the fish help documentation.
|
||||
\c help displays the fish help documentation.
|
||||
|
||||
If a \c SECTION is specified, the help for that command is shown.
|
||||
|
||||
If the BROWSER environment variable is set, it will be used to display the
|
||||
documentation, otherwise fish will search for a suitable browser.
|
||||
documentation. Otherwise, fish will search for a suitable browser.
|
||||
|
||||
Note also that most builtin commands display their help in the terminal when
|
||||
Note that most builtin commands display their help in the terminal when
|
||||
given the <tt>--help</tt> option.
|
||||
|
||||
\subsection help-example Example
|
||||
|
||||
44
doc_src/history.txt
Normal file
44
doc_src/history.txt
Normal file
@@ -0,0 +1,44 @@
|
||||
\section history history - Show and manipulate command history
|
||||
|
||||
\subsection history-synopsis Synopsis
|
||||
<pre>
|
||||
history (--save | --clear)
|
||||
history (--search | --delete ) (--prefix "prefix string" | --contains "search string")
|
||||
</pre>
|
||||
|
||||
\subsection history-description Description
|
||||
|
||||
\c history is used to list, search and delete the history of commands used.
|
||||
|
||||
The following options are available:
|
||||
|
||||
- \c --save saves all changes in the history file. The shell automatically
|
||||
saves the history file; this option is provided for internal use.
|
||||
- \c --clear clears the history file. A prompt is displayed before the history
|
||||
is erased.
|
||||
- \c --search returns history items in keeping with the \c --prefix or
|
||||
\c --contains options.
|
||||
- \c --delete deletes history items.
|
||||
- \c --prefix searches or deletes items in the history that begin with the
|
||||
specified text string.
|
||||
- \c --contains searches or deletes items in the history that contain the
|
||||
specified text string.
|
||||
|
||||
If \c --search is specified without \c --contains or <code>--prefix</code>,
|
||||
\c --contains will be assumed.
|
||||
|
||||
If \c --delete is specified without \c --contains or <code>--prefix</code>,
|
||||
only a history item which exactly matches the parameter will be erased. No
|
||||
prompt will be given. If \c --delete is specified with either of these
|
||||
parameters, an interactive prompt will be displayed before any items are
|
||||
deleted.
|
||||
|
||||
\subsection history-examples Example
|
||||
|
||||
<code>history --clear</code> deletes all history items
|
||||
|
||||
<code>history --search --contains "foo"</code> outputs a list of all previous
|
||||
commands containing the string "foo".
|
||||
|
||||
<code>history --delete --prefix "foo"</code> interactively deletes the record
|
||||
of previous commands which start with "foo".
|
||||
@@ -1,19 +1,19 @@
|
||||
\section if if - conditionally execute a command
|
||||
|
||||
\subsection if-synopsis Synopsis
|
||||
<tt>if CONDITION; COMMANDS_TRUE...; [else; COMMANDS_FALSE...;] end</tt>
|
||||
<tt>if CONDITION; COMMANDS_TRUE...; [else if CONDITION2; COMMANDS_TRUE2...;] [else; COMMANDS_FALSE...;] end</tt>
|
||||
|
||||
\subsection if-description Description
|
||||
|
||||
<tt>if</tt> will execute the command CONDITION. If the condition's
|
||||
exit status is 0, the commands COMMANDS_TRUE will execute. If the
|
||||
exit status is not 0 and <tt>else</tt> is given, COMMANDS_FALSE will
|
||||
<tt>if</tt> will execute the command \c CONDITION. If the condition's
|
||||
exit status is 0, the commands \c COMMANDS_TRUE will execute. If the
|
||||
exit status is not 0 and <tt>else</tt> is given, \c COMMANDS_FALSE will
|
||||
be executed.
|
||||
|
||||
In order to use the exit status of multiple commands as the condition
|
||||
of an if block, use <a href="#begin"><tt>begin; ...; end</tt></a> and
|
||||
the short circuit commands <a href="commands.html#and">and</a> and <a
|
||||
href="commands.html#or">or</a>.
|
||||
the short circuit commands <a href="commands.html#and"><tt>and</tt></a>
|
||||
and <a href="commands.html#or"><tt>or</tt></a>.
|
||||
|
||||
The exit status of the last foreground command to exit can always be
|
||||
accessed using the <a href="index.html#variables-status">$status</a>
|
||||
@@ -24,10 +24,13 @@ variable.
|
||||
<pre>
|
||||
if test -f foo.txt
|
||||
echo foo.txt exists
|
||||
else if test -f bar.txt
|
||||
echo bar.txt exists
|
||||
else
|
||||
echo foo.txt does not exist
|
||||
echo foo.txt and bar.txt do not exist
|
||||
end
|
||||
</pre>
|
||||
will print <tt>foo.txt exists</tt> if the file foo.txt
|
||||
</pre>will print <tt>foo.txt exists</tt> if the file foo.txt
|
||||
exists and is a regular file, otherwise it will print
|
||||
<tt>foo.txt does not exist</tt>.
|
||||
<tt>bar.txt exists</tt> if the file bar.txt exists
|
||||
and is a regular file, otherwise it will print
|
||||
<tt>foo.txt and bar.txt do not exist</tt>.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,10 +3,12 @@
|
||||
\subsection isatty-synopsis Synopsis
|
||||
<tt>isatty [FILE DESCRIPTOR]</tt>
|
||||
|
||||
where FILE DESCRIPTOR may be either the number of a file descriptor, or one
|
||||
of the strings stdin, stdout and stderr.
|
||||
\subsection isatty-description Description
|
||||
<tt>isatty</tt> tests if a file descriptor is a tty.
|
||||
|
||||
If the specified file descriptor is a tty, the exit status of the
|
||||
command is zero, otherwise, it is non-zero.
|
||||
<tt>FILE DESCRIPTOR</tt> may be either the number of a file descriptor, or one of the
|
||||
strings <tt>stdin</tt>, \c stdout and <tt>stderr</tt>.
|
||||
|
||||
If the specified file descriptor is a tty, the exit status of the command is
|
||||
zero. Otherwise, it is non-zero.
|
||||
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
\section jobs jobs - print currently running jobs
|
||||
|
||||
\subsection jobs-synopsis
|
||||
\subsection jobs-synopsis Synopsis
|
||||
<code>jobs [OPTIONS] [PID]</code>
|
||||
|
||||
\subsection jobs-description Description
|
||||
The <code>jobs</code> builtin causes fish to print a list of the currently
|
||||
running jobs and their status.
|
||||
<code>jobs</code> prints a list of the currently
|
||||
running <a href="index.html#syntax-job-control">jobs</a> and their status.
|
||||
|
||||
jobs accepts the following switches:
|
||||
|
||||
- <code>-c</code> or <code>--command</code> print the command name for each process in jobs
|
||||
- <code>-g</code> or <code>--group</code> only print the group id of each job
|
||||
- <code>-h</code> or <code>--help</code> display a help message and exit
|
||||
- <code>-l</code> or <code>--last</code> only the last job to be started is printed
|
||||
- <code>-p</code> or <code>--pid</code> print the process id for each process in all jobs
|
||||
- <code>-c</code> or <code>--command</code> prints the command name for each process in jobs.
|
||||
- <code>-g</code> or <code>--group</code> only prints the group ID of each job.
|
||||
- <code>-h</code> or <code>--help</code> displays a help message and exits.
|
||||
- <code>-l</code> or <code>--last</code> prints only the last job to be started.
|
||||
- <code>-p</code> or <code>--pid</code> prints the process ID for each process in all jobs.
|
||||
|
||||
On systems that supports this feature, jobs will print the CPU usage
|
||||
of each job since the last command was executed. The CPU usage is
|
||||
expressed as a percentage of full CPU activity. Note that on
|
||||
multiprocessor systems, the total activity may be more than 100\%.
|
||||
|
||||
\subsection jobs-example Example
|
||||
|
||||
<code>jobs</code> outputs a summary of the current jobs.
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/** \page license Licenses
|
||||
|
||||
\htmlonly <div class="fish_only_bar"> \endhtmlonly
|
||||
|
||||
<h2>License for fish</h2>
|
||||
|
||||
Fish Copyright (C) 2005-2009 Axel Liljencrantz. Fish is released under
|
||||
@@ -979,6 +981,445 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
<P>
|
||||
|
||||
<h2>License for printf</h2>
|
||||
|
||||
Copyright (C) 1990-2007 Free Software Foundation, Inc. Printf (from GNU
|
||||
Coreutils 6.9) is released under the GNU General Public License, version 2.
|
||||
The license agreement is included below.
|
||||
|
||||
<H2><A NAME="SEC1" HREF="gpl.html#TOC1">GNU GENERAL PUBLIC LICENSE</A></H2>
|
||||
<P>
|
||||
Version 2, June 1991
|
||||
|
||||
</P>
|
||||
|
||||
<PRE>
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
</PRE>
|
||||
|
||||
|
||||
<H2><A NAME="SEC2" HREF="gpl.html#TOC2">Preamble</A></H2>
|
||||
|
||||
<P>
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
</P>
|
||||
<P>
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
</P>
|
||||
<P>
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
</P>
|
||||
<P>
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
</P>
|
||||
<P>
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
</P>
|
||||
<P>
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
</P>
|
||||
<P>
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
</P>
|
||||
<P>
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
|
||||
</P>
|
||||
|
||||
|
||||
<H2><A NAME="SEC3" HREF="gpl.html#TOC3">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</A></H2>
|
||||
|
||||
|
||||
<P>
|
||||
|
||||
<STRONG>0.</STRONG>
|
||||
This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
<P>
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
<P>
|
||||
|
||||
<STRONG>1.</STRONG>
|
||||
You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
<P>
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
<P>
|
||||
|
||||
<STRONG>2.</STRONG>
|
||||
You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
<P>
|
||||
|
||||
<DL>
|
||||
|
||||
<DT>
|
||||
<DD>
|
||||
<STRONG>a)</STRONG>
|
||||
You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
</DD>
|
||||
</DT>
|
||||
</DL>
|
||||
<P>
|
||||
<DL>
|
||||
<DT>
|
||||
<DD>
|
||||
<STRONG>b)</STRONG>
|
||||
You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
</DD>
|
||||
</DT>
|
||||
</DL>
|
||||
<P>
|
||||
<DL>
|
||||
<DT>
|
||||
<DD>
|
||||
<STRONG>c)</STRONG>
|
||||
If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
</DD>
|
||||
</DT>
|
||||
</DL>
|
||||
<P>
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
<P>
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
<P>
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
<P>
|
||||
|
||||
<STRONG>3.</STRONG>
|
||||
You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
|
||||
<!-- we use this doubled UL to get the sub-sections indented, -->
|
||||
<!-- while making the bullets as unobvious as possible. -->
|
||||
|
||||
<DL>
|
||||
<DT>
|
||||
|
||||
<DD>
|
||||
<STRONG>a)</STRONG>
|
||||
Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
</DD>
|
||||
</DT>
|
||||
</DL>
|
||||
<P>
|
||||
<DL>
|
||||
<DT>
|
||||
<DD>
|
||||
<STRONG>b)</STRONG>
|
||||
Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
</DD>
|
||||
|
||||
</DT>
|
||||
</DL>
|
||||
<P>
|
||||
<DL>
|
||||
<DT>
|
||||
<DD>
|
||||
<STRONG>c)</STRONG>
|
||||
Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
</DD>
|
||||
</DT>
|
||||
</DL>
|
||||
<P>
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
<P>
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
<P>
|
||||
|
||||
<STRONG>4.</STRONG>
|
||||
You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
<P>
|
||||
|
||||
<STRONG>5.</STRONG>
|
||||
You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
<P>
|
||||
|
||||
<STRONG>6.</STRONG>
|
||||
|
||||
Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
<P>
|
||||
|
||||
<STRONG>7.</STRONG>
|
||||
If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
<P>
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
<P>
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
<P>
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
|
||||
<P>
|
||||
|
||||
<STRONG>8.</STRONG>
|
||||
If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
<P>
|
||||
|
||||
<STRONG>9.</STRONG>
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
<P>
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
<P>
|
||||
|
||||
<STRONG>10.</STRONG>
|
||||
If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
|
||||
|
||||
<P><STRONG>NO WARRANTY</STRONG></P>
|
||||
|
||||
<P>
|
||||
|
||||
<STRONG>11.</STRONG>
|
||||
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
<P>
|
||||
|
||||
<STRONG>12.</STRONG>
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
<P>
|
||||
|
||||
<h2>License for code derived from tmux</h2>
|
||||
|
||||
Fish contains code derived from
|
||||
<a href="http://tmux.sourceforge.net">tmux</a>, made available under an ISC
|
||||
license.
|
||||
<p>
|
||||
Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
<p>
|
||||
Permission to use, copy, modify, and distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
<p>
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
\htmlonly </div> \endhtmlonly
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user