aboutsummaryrefslogtreecommitdiff
path: root/sbofind
diff options
context:
space:
mode:
Diffstat (limited to 'sbofind')
-rwxr-xr-xsbofind32
1 files changed, 22 insertions, 10 deletions
diff --git a/sbofind b/sbofind
index 61fbd48..c542f8d 100755
--- a/sbofind
+++ b/sbofind
@@ -5,7 +5,8 @@
# sbofind
# script to locate something in a local SlackBuilds tree.
#
-# author: Jacob Pipkin <j@dawnrazor.net>
+# authors: Jacob Pipkin <j@dawnrazor.net>
+# Luke Williams <xocel@iquidus.org>
# license: WTFPL <http://sam.zoy.org/wtfpl/COPYING>
use 5.16.0;
@@ -23,13 +24,15 @@ Usage: $self (search_term)
Options:
-h|--help:
- this screen.
+ this screen.
-v|--verison:
- version information.
+ version information.
-i|--info:
- show the .info for each found item.
+ show the .info for each found item.
-r|--readme:
- show the README for each found item.
+ show the README for each found item.
+ -q|--queue:
+ show the build queue for each found item.
Example:
$self libsexy
@@ -37,13 +40,14 @@ Example:
EOF
}
-my ($help, $vers, $show_info, $show_readme);
+my ($help, $vers, $show_info, $show_readme, $show_queue);
GetOptions (
- 'help|h' => \$help,
- 'version|v' => \$vers,
- 'info|i' => \$show_info,
- 'readme|r' => \$show_readme,
+ 'help|h' => \$help,
+ 'version|v' => \$vers,
+ 'info|i' => \$show_info,
+ 'readme|r' => \$show_readme,
+ 'queue|q' => \$show_queue,
);
show_usage and exit 0 if $help;
@@ -90,6 +94,13 @@ sub get_file_contents ($) {
return $contents;
}
+# get build queue and return it as a single line.
+sub show_build_queue ($) {
+ exists $_[0] or script_error 'show_build_queue requires an argument.';
+ my $queue = get_build_queue([shift], {});
+ return join(" ", reverse @$queue);
+}
+
my $findings = perform_search $search;
# pretty formatting
@@ -101,6 +112,7 @@ if (exists $$findings[0]) {
say "Path: $val";
say "info: ". get_file_contents "$val/$key.info" if $show_info;
say "README: ". get_file_contents "$val/README" if $show_readme;
+ say "Queue: ". show_build_queue "$key" if $show_queue;
say '';
}
}