_ncspot0000644000175000001440000000545615104660750012366 0ustar pghvlaansusers#compdef ncspot autoload -U is-at-least _ncspot() { typeset -A opt_args typeset -a _arguments_options local ret=1 if is-at-least 5.2; then _arguments_options=(-s -S -C) else _arguments_options=(-s -C) fi local context curcontext="$curcontext" state line _arguments "${_arguments_options[@]}" : \ '-d+[Enable debug logging to the specified file]:FILE:_files' \ '--debug=[Enable debug logging to the specified file]:FILE:_files' \ '-b+[custom basepath to config/cache files]:PATH:_files' \ '--basepath=[custom basepath to config/cache files]:PATH:_files' \ '-c+[Filename of config file in basepath]:FILE:_default' \ '--config=[Filename of config file in basepath]:FILE:_default' \ '-h[Print help]' \ '--help[Print help]' \ '-V[Print version]' \ '--version[Print version]' \ ":: :_ncspot_commands" \ "*::: :->ncspot" \ && ret=0 case $state in (ncspot) words=($line[1] "${words[@]}") (( CURRENT += 1 )) curcontext="${curcontext%:*:*}:ncspot-command-$line[1]:" case $line[1] in (info) _arguments "${_arguments_options[@]}" : \ '-h[Print help]' \ '--help[Print help]' \ && ret=0 ;; (help) _arguments "${_arguments_options[@]}" : \ ":: :_ncspot__help_commands" \ "*::: :->help" \ && ret=0 case $state in (help) words=($line[1] "${words[@]}") (( CURRENT += 1 )) curcontext="${curcontext%:*:*}:ncspot-help-command-$line[1]:" case $line[1] in (info) _arguments "${_arguments_options[@]}" : \ && ret=0 ;; (help) _arguments "${_arguments_options[@]}" : \ && ret=0 ;; esac ;; esac ;; esac ;; esac } (( $+functions[_ncspot_commands] )) || _ncspot_commands() { local commands; commands=( 'info:Print platform information like paths' \ 'help:Print this message or the help of the given subcommand(s)' \ ) _describe -t commands 'ncspot commands' commands "$@" } (( $+functions[_ncspot__help_commands] )) || _ncspot__help_commands() { local commands; commands=( 'info:Print platform information like paths' \ 'help:Print this message or the help of the given subcommand(s)' \ ) _describe -t commands 'ncspot help commands' commands "$@" } (( $+functions[_ncspot__help__help_commands] )) || _ncspot__help__help_commands() { local commands; commands=() _describe -t commands 'ncspot help help commands' commands "$@" } (( $+functions[_ncspot__help__info_commands] )) || _ncspot__help__info_commands() { local commands; commands=() _describe -t commands 'ncspot help info commands' commands "$@" } (( $+functions[_ncspot__info_commands] )) || _ncspot__info_commands() { local commands; commands=() _describe -t commands 'ncspot info commands' commands "$@" } if [ "$funcstack[1]" = "_ncspot" ]; then _ncspot "$@" else compdef _ncspot ncspot fi _ncspot.ps10000644000175000001440000000620515104660750013061 0ustar pghvlaansusers using namespace System.Management.Automation using namespace System.Management.Automation.Language Register-ArgumentCompleter -Native -CommandName 'ncspot' -ScriptBlock { param($wordToComplete, $commandAst, $cursorPosition) $commandElements = $commandAst.CommandElements $command = @( 'ncspot' for ($i = 1; $i -lt $commandElements.Count; $i++) { $element = $commandElements[$i] if ($element -isnot [StringConstantExpressionAst] -or $element.StringConstantType -ne [StringConstantType]::BareWord -or $element.Value.StartsWith('-') -or $element.Value -eq $wordToComplete) { break } $element.Value }) -join ';' $completions = @(switch ($command) { 'ncspot' { [CompletionResult]::new('-d', '-d', [CompletionResultType]::ParameterName, 'Enable debug logging to the specified file') [CompletionResult]::new('--debug', '--debug', [CompletionResultType]::ParameterName, 'Enable debug logging to the specified file') [CompletionResult]::new('-b', '-b', [CompletionResultType]::ParameterName, 'custom basepath to config/cache files') [CompletionResult]::new('--basepath', '--basepath', [CompletionResultType]::ParameterName, 'custom basepath to config/cache files') [CompletionResult]::new('-c', '-c', [CompletionResultType]::ParameterName, 'Filename of config file in basepath') [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'Filename of config file in basepath') [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') [CompletionResult]::new('-V', '-V ', [CompletionResultType]::ParameterName, 'Print version') [CompletionResult]::new('--version', '--version', [CompletionResultType]::ParameterName, 'Print version') [CompletionResult]::new('info', 'info', [CompletionResultType]::ParameterValue, 'Print platform information like paths') [CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)') break } 'ncspot;info' { [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') break } 'ncspot;help' { [CompletionResult]::new('info', 'info', [CompletionResultType]::ParameterValue, 'Print platform information like paths') [CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)') break } 'ncspot;help;info' { break } 'ncspot;help;help' { break } }) $completions.Where{ $_.CompletionText -like "$wordToComplete*" } | Sort-Object -Property ListItemText } ncspot-info.10000644000175000001440000000044415104660747013315 0ustar pghvlaansusers.ie \n(.g .ds Aq \(aq .el .ds Aq ' .TH ncspot-info 1 "info " .SH NAME ncspot\-info \- Print platform information like paths .SH SYNOPSIS \fBncspot info\fR [\fB\-h\fR|\fB\-\-help\fR] .SH DESCRIPTION Print platform information like paths .SH OPTIONS .TP \fB\-h\fR, \fB\-\-help\fR Print help ncspot.10000644000175000001440000000166615104660747012373 0ustar pghvlaansusers.ie \n(.g .ds Aq \(aq .el .ds Aq ' .TH ncspot 1 "ncspot 1.3.2" .SH NAME ncspot \- cross\-platform ncurses Spotify client .SH SYNOPSIS \fBncspot\fR [\fB\-d\fR|\fB\-\-debug\fR] [\fB\-b\fR|\fB\-\-basepath\fR] [\fB\-c\fR|\fB\-\-config\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fIsubcommands\fR] .SH DESCRIPTION cross\-platform ncurses Spotify client .SH OPTIONS .TP \fB\-d\fR, \fB\-\-debug\fR \fI\fR Enable debug logging to the specified file .TP \fB\-b\fR, \fB\-\-basepath\fR \fI\fR custom basepath to config/cache files .TP \fB\-c\fR, \fB\-\-config\fR \fI\fR [default: config.toml] Filename of config file in basepath .TP \fB\-h\fR, \fB\-\-help\fR Print help .TP \fB\-V\fR, \fB\-\-version\fR Print version .SH SUBCOMMANDS .TP ncspot\-info(1) Print platform information like paths .SH EXTRA Audio backends: pipe, subprocess .SH VERSION v1.3.2 .SH AUTHORS Henrik Friedrichsen and contributors ncspot0000644000175000001440000000774315104660750012230 0ustar pghvlaansusers_ncspot() { local i cur prev opts cmd COMPREPLY=() if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then cur="$2" else cur="${COMP_WORDS[COMP_CWORD]}" fi prev="$3" cmd="" opts="" for i in "${COMP_WORDS[@]:0:COMP_CWORD}" do case "${cmd},${i}" in ",$1") cmd="ncspot" ;; ncspot,help) cmd="ncspot__help" ;; ncspot,info) cmd="ncspot__info" ;; ncspot__help,help) cmd="ncspot__help__help" ;; ncspot__help,info) cmd="ncspot__help__info" ;; *) ;; esac done case "${cmd}" in ncspot) opts="-d -b -c -h -V --debug --basepath --config --help --version info help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in --debug) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; -d) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; --basepath) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; -b) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; --config) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; -c) COMPREPLY=($(compgen -f "${cur}")) return 0 ;; *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; ncspot__help) opts="info help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; ncspot__help__help) opts="" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; ncspot__help__info) opts="" if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; ncspot__info) opts="-h --help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; esac } if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then complete -F _ncspot -o nosort -o bashdefault -o default ncspot else complete -F _ncspot -o bashdefault -o default ncspot fi ncspot.fish0000644000175000001440000000355215104660750013152 0ustar pghvlaansusers# Print an optspec for argparse to handle cmd's options that are independent of any subcommand. function __fish_ncspot_global_optspecs string join \n d/debug= b/basepath= c/config= h/help V/version end function __fish_ncspot_needs_command # Figure out if the current invocation already has a command. set -l cmd (commandline -opc) set -e cmd[1] argparse -s (__fish_ncspot_global_optspecs) -- $cmd 2>/dev/null or return if set -q argv[1] # Also print the command, so this can be used to figure out what it is. echo $argv[1] return 1 end return 0 end function __fish_ncspot_using_subcommand set -l cmd (__fish_ncspot_needs_command) test -z "$cmd" and return 1 contains -- $cmd[1] $argv end complete -c ncspot -n "__fish_ncspot_needs_command" -s d -l debug -d 'Enable debug logging to the specified file' -r -F complete -c ncspot -n "__fish_ncspot_needs_command" -s b -l basepath -d 'custom basepath to config/cache files' -r -F complete -c ncspot -n "__fish_ncspot_needs_command" -s c -l config -d 'Filename of config file in basepath' -r complete -c ncspot -n "__fish_ncspot_needs_command" -s h -l help -d 'Print help' complete -c ncspot -n "__fish_ncspot_needs_command" -s V -l version -d 'Print version' complete -c ncspot -n "__fish_ncspot_needs_command" -f -a "info" -d 'Print platform information like paths' complete -c ncspot -n "__fish_ncspot_needs_command" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c ncspot -n "__fish_ncspot_using_subcommand info" -s h -l help -d 'Print help' complete -c ncspot -n "__fish_ncspot_using_subcommand help; and not __fish_seen_subcommand_from info help" -f -a "info" -d 'Print platform information like paths' complete -c ncspot -n "__fish_ncspot_using_subcommand help; and not __fish_seen_subcommand_from info help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' ncspot.elv0000644000175000001440000000304715104660750013006 0ustar pghvlaansusers use builtin; use str; set edit:completion:arg-completer[ncspot] = {|@words| fn spaces {|n| builtin:repeat $n ' ' | str:join '' } fn cand {|text desc| edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc } var command = 'ncspot' for word $words[1..-1] { if (str:has-prefix $word '-') { break } set command = $command';'$word } var completions = [ &'ncspot'= { cand -d 'Enable debug logging to the specified file' cand --debug 'Enable debug logging to the specified file' cand -b 'custom basepath to config/cache files' cand --basepath 'custom basepath to config/cache files' cand -c 'Filename of config file in basepath' cand --config 'Filename of config file in basepath' cand -h 'Print help' cand --help 'Print help' cand -V 'Print version' cand --version 'Print version' cand info 'Print platform information like paths' cand help 'Print this message or the help of the given subcommand(s)' } &'ncspot;info'= { cand -h 'Print help' cand --help 'Print help' } &'ncspot;help'= { cand info 'Print platform information like paths' cand help 'Print this message or the help of the given subcommand(s)' } &'ncspot;help;info'= { } &'ncspot;help;help'= { } ] $completions[$command] }