aboutsummaryrefslogtreecommitdiff
path: root/fzf-exec/tmux-doc.sh
blob: f653441fc92d11e17ad90933eff88d9676702d47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env bash

usage=$(tmux list-command -F "#{command_list_name} #{command_list_usage}" "$1")

man tmux  | awk -v usage="$usage" '
  index($0, usage) > 0 { found=1 }
  found {
    print
    if ($0 == "") exit
  }
'