Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete simctl #13

Merged
merged 63 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
10e4d0d
Use built-in function to complete command in xcrun
odnoletkov Jun 2, 2022
e96fb12
Add another directory to find xcrun commands
odnoletkov Jun 2, 2022
5f59fa7
Make completions work for commands invoked with xcrun
odnoletkov Jun 2, 2022
afad89c
Remove shims
odnoletkov Jun 2, 2022
88114d2
Capture help output as a 'spec' for simctl
odnoletkov Jun 3, 2022
4f0d9f4
Start base completion script handling root optioins
odnoletkov Jun 3, 2022
972d5bf
Complete simctl help
odnoletkov Jun 3, 2022
c404775
Complete simctl create
odnoletkov Jun 3, 2022
706f73d
Suggest only supported runtimes for devicetype in create
odnoletkov Jun 4, 2022
adb7660
Improve runtimes completion in simctl
odnoletkov Jun 4, 2022
06bb54f
Complete simctl clone
odnoletkov Jun 4, 2022
577a928
Complete only available devices in simctl clone
odnoletkov Jun 4, 2022
43b047b
Complete simctl upgrade
odnoletkov Jun 4, 2022
a46d553
Complete simctl delete
odnoletkov Jun 4, 2022
5338b77
Complete simctl pair
odnoletkov Jun 4, 2022
715f9be
Complete simctl unpair
odnoletkov Jun 4, 2022
4fc3de4
Complete simctl pair_activate
odnoletkov Jun 4, 2022
d9a18b3
Complete simctl erase
odnoletkov Jun 4, 2022
e91a38c
Read env directly from jq
odnoletkov Jun 4, 2022
e017474
Complete simctl boot
odnoletkov Jun 4, 2022
e582397
Complete simctl shutdown
odnoletkov Jun 4, 2022
bfa74f0
Complete simctl rename
odnoletkov Jun 4, 2022
2f6b802
Account for devices state in simctl
odnoletkov Jun 4, 2022
df60fe1
Complete simctl getenv
odnoletkov Jun 4, 2022
935d184
Complete simctl openurl
odnoletkov Jun 4, 2022
f2a9c44
Complete simctl addmedia
odnoletkov Jun 4, 2022
fd5fed2
Complete simctl install
odnoletkov Jun 5, 2022
dbdcc71
Complete simctl uninstall
odnoletkov Jun 5, 2022
d4d4c13
Complete simctl get_app_container
odnoletkov Jun 5, 2022
4f9fee8
Improve simctl openurl
odnoletkov Jun 5, 2022
3766b8b
Improve _bundle_identifiers
odnoletkov Jun 5, 2022
cc34343
Complete simctl install_app_data
odnoletkov Jun 5, 2022
057c3fc
Complete simctl launch
odnoletkov Jun 5, 2022
61cd701
Show display names in bundle completion in simctl
odnoletkov Jun 5, 2022
9257ad6
Complete simctl terminate
odnoletkov Jun 5, 2022
5bf8cc3
Simplify _runtimes
odnoletkov Jun 5, 2022
7b39ac4
Handle errors in pipes from invalid devices
odnoletkov Jun 5, 2022
edfa613
Use relative indexing when accessing $words in simctl
odnoletkov Jun 5, 2022
8519996
Complete simctl spawn
odnoletkov Jun 5, 2022
d1deba2
Disallow options after positional arguments
odnoletkov Jun 5, 2022
69dfac4
Complete simctl list
odnoletkov Jun 5, 2022
4994319
Complete simctl icloud_sync
odnoletkov Jun 5, 2022
becf4f6
Complete simctl pbsync
odnoletkov Jun 5, 2022
ddd91b2
Complete simctl pbcopy
odnoletkov Jun 5, 2022
6816bcc
Complete simctl pbpaste
odnoletkov Jun 5, 2022
bd85af3
Complete simctl help
odnoletkov Jun 5, 2022
691f3a2
Complete simctl io
odnoletkov Jun 5, 2022
675b15e
Complete simctl diagnose
odnoletkov Jun 5, 2022
78de4e5
Complete simctl logverbose
odnoletkov Jun 5, 2022
8e06a71
Complete simctl status_bar
odnoletkov Jun 6, 2022
da4ef81
Complete simctl ui
odnoletkov Jun 6, 2022
183d5e0
Complete simctl push
odnoletkov Jun 6, 2022
0a4d3e1
Complete simctl privacy
odnoletkov Jun 6, 2022
a2e30ff
Complete simctl keychain
odnoletkov Jun 6, 2022
e35b3e6
Complete simctl listapps
odnoletkov Jun 6, 2022
a9d307c
Simplify MakefilE
odnoletkov Jun 6, 2022
9ca4125
TODO
odnoletkov Jun 6, 2022
7969f0b
Remove redundant descriptions
odnoletkov Jun 6, 2022
6ffd061
Format and cleanup description texts
odnoletkov Jun 6, 2022
7cf9a3b
Add internal options for simctl diagnose
odnoletkov Jun 8, 2022
533a6fd
List undocumented and internal subcommands
odnoletkov Jun 8, 2022
ce8edc6
Complete simctl internal commands
odnoletkov Jun 12, 2022
7884be3
Cleanup
odnoletkov Jun 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Zsh completions for some of the Xcode command line tools. Currently:
- [`plutil`](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/plutil.1.html)
- [`xcode`-select](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcode-select.1.html)
- [`xcodebuild`](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html)
- [`xcrun`](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcrun.1.html) See [shims](#shims) for more info
- [`xcrun`](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcrun.1.html)
- `strings`
- `swift-demangle`
- `swift`
Expand All @@ -25,17 +25,6 @@ brew install keith/formulae/zsh-xcode-completions
- pkgutil
- pmset

### Shims

Unfortunately, because of how `xcrun` happens to work, creating
completions that also handle the nested completions for programs run
through `xcrun` (such as `swift-demangle`) has proven to be difficult.
To get around this, I have created [shims](bin) for programs that could
use completions. I've also added a homebrew option (`--without-shims`)
if you would like to exclude these from being installed. One
disadvantage to this approach is you cannot pass arguments to the
`xcrun` command while calling a shim.

### Resources

<https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org>
3 changes: 0 additions & 3 deletions bin/swift-demangle

This file was deleted.

49 changes: 49 additions & 0 deletions specs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
all: simctl.txt

%.txt: FORCE
$(MAKE) "$(basename $@)" &>$@

FORCE:

simctl:
xcrun simctl || true
@for command in $$(xcrun simctl | grep '^\t' | awk '{print $$1}'); do \
echo; \
echo xcrun simctl help $$command; \
xcrun simctl help $$command; \
done
@# Undocumented/internal commands:
@echo
xcrun simctl help addphoto
@echo
xcrun simctl help addvideo
@echo
xcrun simctl help pbinfo
@echo
xcrun simctl help notify_post
@echo
xcrun simctl help notify_get_state
@echo
xcrun simctl help notify_set_state
@echo
xcrun simctl help register
@echo
xcrun simctl help unregister
@echo
xcrun simctl help keyboard
@echo
xcrun simctl help monitor
@echo
xcrun simctl help appinfo
@echo
xcrun simctl help listapps
@echo
xcrun simctl help bootstatus
@echo
xcrun simctl help darwinup
@echo
xcrun simctl help disk
@echo
xcrun simctl help runtime
@echo
xcrun simctl help reset
Loading