# Print an optspec for argparse to handle cmd's options that are independent of any subcommand. function __fish_rsp_global_optspecs string join \n h/help end function __fish_rsp_needs_command # Figure out if the current invocation already has a command. set -l cmd (commandline -opc) set -e cmd[1] argparse -s (__fish_rsp_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_rsp_using_subcommand set -l cmd (__fish_rsp_needs_command) test -z "$cmd" and return 1 contains -- $cmd[1] $argv end complete -c rsp -n "__fish_rsp_needs_command" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_needs_command" -f -a "start-daemon" -d 'Start the daemon' complete -c rsp -n "__fish_rsp_needs_command" -f -a "stop-daemon" -d 'Stop the daemon' complete -c rsp -n "__fish_rsp_needs_command" -f -a "restart" -d 'Restart the daemon (kill existing and start new)' complete -c rsp -n "__fish_rsp_needs_command" -f -a "play" -d 'Play a track, album, or artist' complete -c rsp -n "__fish_rsp_needs_command" -f -a "pause" -d 'Pause playback' complete -c rsp -n "__fish_rsp_needs_command" -f -a "resume" -d 'Resume playback' complete -c rsp -n "__fish_rsp_needs_command" -f -a "toggle" -d 'Toggle play/pause' complete -c rsp -n "__fish_rsp_needs_command" -f -a "stop" -d 'Stop playback' complete -c rsp -n "__fish_rsp_needs_command" -f -a "next" -d 'Skip to next track' complete -c rsp -n "__fish_rsp_needs_command" -f -a "previous" -d 'Skip to previous track' complete -c rsp -n "__fish_rsp_needs_command" -f -a "volume" -d 'Set volume (0-100)' complete -c rsp -n "__fish_rsp_needs_command" -f -a "shuffle" -d 'Shuffle mode' complete -c rsp -n "__fish_rsp_needs_command" -f -a "queue" -d 'Queue management' complete -c rsp -n "__fish_rsp_needs_command" -f -a "status" -d 'Show player status' complete -c rsp -n "__fish_rsp_needs_command" -f -a "scan" -d 'Scan music paths to populate database' complete -c rsp -n "__fish_rsp_needs_command" -f -a "settings" -d 'Settings management' complete -c rsp -n "__fish_rsp_needs_command" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c rsp -n "__fish_rsp_using_subcommand start-daemon" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand stop-daemon" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand restart" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand play" -s i -l now -d 'Add after current track and skip to it' complete -c rsp -n "__fish_rsp_using_subcommand play" -s n -l next -d 'Add to queue after current track (don\'t skip)' complete -c rsp -n "__fish_rsp_using_subcommand play" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand pause" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand resume" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand toggle" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand stop" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand next" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand previous" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand volume" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand shuffle" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand shuffle" -f -a "on off all none album albums" -d 'Shuffle mode' complete -c rsp -n "__fish_rsp_using_subcommand queue" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand status" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand scan" -l paths -r -F complete -c rsp -n "__fish_rsp_using_subcommand scan" -l force complete -c rsp -n "__fish_rsp_using_subcommand scan" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand settings; and not __fish_seen_subcommand_from get set list unset help" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand settings; and not __fish_seen_subcommand_from get set list unset help" -f -a "get" -d 'Get a setting value' complete -c rsp -n "__fish_rsp_using_subcommand settings; and not __fish_seen_subcommand_from get set list unset help" -f -a "set" -d 'Set a setting value' complete -c rsp -n "__fish_rsp_using_subcommand settings; and not __fish_seen_subcommand_from get set list unset help" -f -a "list" -d 'List all settings' complete -c rsp -n "__fish_rsp_using_subcommand settings; and not __fish_seen_subcommand_from get set list unset help" -f -a "unset" -d 'Unset a setting' complete -c rsp -n "__fish_rsp_using_subcommand settings; and not __fish_seen_subcommand_from get set list unset help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c rsp -n "__fish_rsp_using_subcommand settings; and __fish_seen_subcommand_from get" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand settings; and __fish_seen_subcommand_from set" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand settings; and __fish_seen_subcommand_from list" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand settings; and __fish_seen_subcommand_from unset" -s h -l help -d 'Print help' complete -c rsp -n "__fish_rsp_using_subcommand settings; and __fish_seen_subcommand_from help" -f -a "get" -d 'Get a setting value' complete -c rsp -n "__fish_rsp_using_subcommand settings; and __fish_seen_subcommand_from help" -f -a "set" -d 'Set a setting value' complete -c rsp -n "__fish_rsp_using_subcommand settings; and __fish_seen_subcommand_from help" -f -a "list" -d 'List all settings' complete -c rsp -n "__fish_rsp_using_subcommand settings; and __fish_seen_subcommand_from help" -f -a "unset" -d 'Unset a setting' complete -c rsp -n "__fish_rsp_using_subcommand settings; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "start-daemon" -d 'Start the daemon' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "stop-daemon" -d 'Stop the daemon' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "restart" -d 'Restart the daemon (kill existing and start new)' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "play" -d 'Play a track, album, or artist' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "pause" -d 'Pause playback' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "resume" -d 'Resume playback' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "toggle" -d 'Toggle play/pause' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "stop" -d 'Stop playback' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "next" -d 'Skip to next track' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "previous" -d 'Skip to previous track' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "volume" -d 'Set volume (0-100)' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "shuffle" -d 'Shuffle mode' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "queue" -d 'Queue management' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "status" -d 'Show player status' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "scan" -d 'Scan music paths to populate database' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "settings" -d 'Settings management' complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c rsp -n "__fish_rsp_using_subcommand help; and __fish_seen_subcommand_from settings" -f -a "get" -d 'Get a setting value' complete -c rsp -n "__fish_rsp_using_subcommand help; and __fish_seen_subcommand_from settings" -f -a "set" -d 'Set a setting value' complete -c rsp -n "__fish_rsp_using_subcommand help; and __fish_seen_subcommand_from settings" -f -a "list" -d 'List all settings' complete -c rsp -n "__fish_rsp_using_subcommand help; and __fish_seen_subcommand_from settings" -f -a "unset" -d 'Unset a setting'