From f8567465f4f793fff2c150d0f2fdca72387027c5 Mon Sep 17 00:00:00 2001 From: Rasmus Steinke Date: Sun, 6 Aug 2017 17:02:32 +0200 Subject: fix help hotkey --- clerk | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'clerk') diff --git a/clerk b/clerk index 535daad..ac248e8 100755 --- a/clerk +++ b/clerk @@ -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 -- cgit v1.2.3-24-g4f1b