Skip to content

Commit 32a16dd

Browse files
kastiglionekeith
authored andcommitted
Add lipo completion (#11)
1 parent 2c1e677 commit 32a16dd

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Zsh completions for some of the Xcode command line tools. Currently:
1111
- `strings`
1212
- `swift-demangle`
1313
- `swift`
14+
- `lipo`
1415

1516
# Installation
1617

@@ -20,7 +21,6 @@ brew install keith/formulae/zsh-xcode-completions
2021

2122
# TODO:
2223

23-
- lipo
2424
- otool
2525
- pkgutil
2626
- pmset

src/_lipo

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#compdef lipo
2+
3+
# TODO: Allow archs to be zstyle overridable.
4+
local archs="i386 x86_64 x86_64h armv7 arm64 arm64e"
5+
6+
# TODO: Filter completed archs to exclude those already on the command line.
7+
# Ex: `lipo -remove x86_64 -remove <TAB>`
8+
# This would complete all archs except x86_64.
9+
10+
# TODO: Complete fat/thin mach-o files only, not all `_files`
11+
12+
# TODO: Handle variadics input for -verify_arch
13+
# This flag is for scripting (returns zero/non-zero). Supporting completion of
14+
# many arguments doesn't seem like a practical need.
15+
16+
# TODO: Unsupported (rarely needed?) options:
17+
# * -create -arch_blank <arch>
18+
# * -arch
19+
# * -hideARM64
20+
# * -segalign
21+
22+
_arguments : \
23+
'-output[path of created universal binary]:output file:_files' \
24+
'*:input mach-o binaries:_files' \
25+
- archs \
26+
'-archs[list architectures present]' \
27+
- create \
28+
'-create[create a new universal binary]' \
29+
- "detailed info" \
30+
'-detailed_info[display detailed list of architectures]' \
31+
- extract \
32+
"*-extract[create a single architecture universal binary]:architecture type:($archs)" \
33+
"*-extract_family[create a universal binary containing an architecture family]:architecture type:($archs)" \
34+
- info \
35+
'-info[display brief description of each input file]' \
36+
- remove \
37+
"*-remove[remove an architecture from a universal binary]:architecture type:($archs)" \
38+
- replace \
39+
"*-replace[replace an architecture in a universal binary]:architecture type:($archs):replacement:_files" \
40+
- thin \
41+
"-thin[create a non-universal (mach-o) binary of a given architecture]:architecture type:($archs)" \
42+
- verify \
43+
"-verify_arch[confirm the universal binary contains the specified arch(s)]:architecture type:($archs)"

0 commit comments

Comments
 (0)