diff options
author | Rasmus Steinke <rasi@xssn.at> | 2017-08-06 17:02:32 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2017-08-06 17:02:32 +0200 |
commit | f8567465f4f793fff2c150d0f2fdca72387027c5 (patch) | |
tree | 38f6084b6ea02cc7acec0bce2125c354633a023a | |
parent | 57e8bb56a3710a6d9253615e8998f737f9ac038f (diff) | |
download | perl-app-clerk-f8567465f4f793fff2c150d0f2fdca72387027c5.tar.gz perl-app-clerk-f8567465f4f793fff2c150d0f2fdca72387027c5.tar.xz |
fix help hotkey
-rwxr-xr-x | clerk | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -56,23 +56,24 @@ my $mpd = Net::MPD->connect($ENV{MPD_HOST} // $mpd_host // 'localhost'); sub main { create_db(); my %options=(); - getopts("talpfrhyx", \%options); + getopts("talpfrhyxz", \%options); unless ($options{f}) { $backend = 'rofi' } else { $backend = 'fzf'; } - if ($options{t} // $options{a} // $options{p} // $options{l} // $options{r} // $options{x} // $options{y} // $options{h}) { + if ($options{t} // $options{a} // $options{p} // $options{l} // $options{r} // $options{x} // $options{y} // $options{h} // $options{z}) { if (defined $options{t}) { list_db_entries_for("Tracks") } elsif (defined $options{a}) { list_db_entries_for("Albums") } elsif (defined $options{p}) { list_playlists() } - elsif (defined $options{h}) { help() } + elsif (defined $options{z}) { help() } + elsif (defined $options{h}) { help_output() } elsif (defined $options{x}) { system('tmux', 'split-window', '-d', 'clerk', '-f', '-r'); system('tmux', 'select-pane', '-D'); } elsif (defined $options{y}) { - system('tmux', 'split-window', '-d', 'clerk', '-f', '-h'); + system('tmux', 'split-window', '-d', 'clerk', '-f', '-z'); system('tmux', 'select-pane', '-D'); } elsif (defined $options{r}) { random() } @@ -94,6 +95,22 @@ sub main { } } +sub help_output { + my @output = ( + "Usage: clerk [[-f [options]]", + "clerk version 2.0", + "", + "Options:", + " -f Use fzf interface. Without other arguments", + " this starts a complete tmux interface with tabs.", + " -a Add/Replace album(s) to queue.", + " -l Add/Replace album(s) to queue (sorted by mtime)", + " -t Add/Replace track(s) to queue.", + " -p Add stored playlist to queue", + " -r Replace current playlist with random songs/album"); + + print join("\n", @output), "\n\n"; +} sub create_db { # Get database copy and save as messagepack file, if file is either missing |