Put all the `plumb $(...)' inside a main() function, similar to plumb. - plumb - Open certain URL patterns with an ad-hoc opener (plumber)
(HTM) hg clone https://bitbucket.org/iamleot/plumb
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) changeset 587af00a080cebb615f199b3ae13a40a205da889
(DIR) parent 85894d036f2e0d5a90ca4005dd7273e16920b632
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Mon, 26 Mar 2018 11:02:47
Put all the `plumb $(...)' inside a main() function, similar to plumb.
Diffstat:
dplumb | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
---
diff -r 85894d036f2e -r 587af00a080c dplumb
--- a/dplumb Mon Mar 26 10:59:57 2018 +0200
+++ b/dplumb Mon Mar 26 11:02:47 2018 +0200
@@ -85,10 +85,16 @@
# Process the stdin, extract URLs, pass them to ${PLUMB_DMENU} and open the
# selected one to plumb.
#
-plumb "$(
- one_word_per_line |
- urlize |
- extract_urls |
- ${PLUMB_DMENU} )"
+main()
+{
-exit 0
+ plumb "$(
+ one_word_per_line |
+ urlize |
+ extract_urls |
+ ${PLUMB_DMENU} )"
+
+ exit 0
+}
+
+main "$@"