diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-06-20 23:01:09 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-06-20 23:01:09 +0200 |
| commit | 581865ee0c8b8aea872f053d804a41fb5f416b17 (patch) | |
| tree | 9a2f99ea48c31629a5c3c42b0454483982cdbfed /dmenu-urlselect | |
| parent | c5d101ab2c9db3b1a001cb56953cb90b24f8fdcf (diff) | |
| download | scripts-581865ee0c8b8aea872f053d804a41fb5f416b17.tar.gz scripts-581865ee0c8b8aea872f053d804a41fb5f416b17.zip | |
Various shellcheck fixes (www.shellcheck.net)
Diffstat (limited to 'dmenu-urlselect')
| -rwxr-xr-x | dmenu-urlselect | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/dmenu-urlselect b/dmenu-urlselect index d4e1f59..a988826 100755 --- a/dmenu-urlselect +++ b/dmenu-urlselect | |||
| @@ -2,18 +2,27 @@ | |||
| 2 | 2 | ||
| 3 | # Finds all URLs in stdin and prompts a dmenu choice, then writes the selected | 3 | # Finds all URLs in stdin and prompts a dmenu choice, then writes the selected |
| 4 | # url to stdout. | 4 | # url to stdout. |
| 5 | # Usage: dmenu-urlselect [-m menu] | ||
| 6 | # Requires: dmenu (or similar), urlgrep | 5 | # Requires: dmenu (or similar), urlgrep |
| 7 | 6 | ||
| 7 | # Usage: dmenu-urlselect [-m menu] | ||
| 8 | |||
| 8 | menu="dmenu -i -l 20" | 9 | menu="dmenu -i -l 20" |
| 9 | 10 | ||
| 11 | usage() { | ||
| 12 | echo "Usage: dmenu-urlselect [-m MENU]" | ||
| 13 | } | ||
| 14 | |||
| 10 | while getopts "m:" opt; do | 15 | while getopts "m:" opt; do |
| 11 | case "$opt" in | 16 | case "$opt" in |
| 12 | m) | 17 | m) |
| 13 | menu="$OPTARG" | 18 | menu="$OPTARG" |
| 14 | ;; | 19 | ;; |
| 20 | *) | ||
| 21 | usage | ||
| 22 | exit 1 | ||
| 23 | ;; | ||
| 15 | esac | 24 | esac |
| 16 | done | 25 | done |
| 17 | shift `expr $OPTIND - 1` | 26 | shift $((OPTIND - 1)) |
| 18 | 27 | ||
| 19 | urlgrep | $menu | 28 | urlgrep | $menu |
