Created
May 9, 2018 22:28
-
-
Save danyspin97/cc2452d727bfeefdb831d115238a5802 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run = [cmd]{ | |
use re | |
help-message = ( asciinema -h | sed -n '7,11p; 12q' | grep " "$cmd" " ) | |
display-suffix = ( echo ( re:split &longest=$true &max=3 ' +' $help-message ) | cut -d ' ' -f 3- ) | |
edit:complex-candidate &code-suffix='' &display-suffix=" "$display-suffix &style='' $cmd | |
} | |
fn asciinema-completer [asciinema-args @rest]{ | |
n = (count $rest) | |
if (eq $n 1) { | |
commands = [auth cat play rec upload] | |
t = [ ] | |
for cmd $commands { | |
t = [ $@t { $run $cmd } ] | |
} | |
run-parallel $@t | |
} | |
} | |
edit:completion:arg-completer[asciinema] = $asciinema-completer~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment