[Bio] / FigKernelScripts / svr_enumerate_sets_by_owner.pl Repository:
ViewVC logotype

Annotation of /FigKernelScripts/svr_enumerate_sets_by_owner.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : disz 1.1 use strict;
2 :    
3 :     use Getopt::Long;
4 :     use SeedEnv;
5 :     use PersistentSets;
6 :    
7 :     #
8 :     # This is a SAS Component
9 :     #
10 :    
11 :    
12 :     =head1 svr_enumerate_sets_by_owner
13 :    
14 :     List all the persistent sets owned by owner
15 :    
16 :     The output is a list of sets names
17 :    
18 :     ------
19 :     Example: svr_enumerate_sets_by_owner -owner owner_name > allsets.tbl
20 :    
21 :     would produce a 1-column table of the owner:set_name of the persistent sets owned by owner_name.
22 :     ------
23 :    
24 :     =head2 Command-Line Options
25 :    
26 :     =over 4
27 :    
28 :     =item url
29 :    
30 :     The URL for the Sapling server, if it is to be different from the default.
31 :    
32 :     =item owner
33 :    
34 :     If supplied, sets for the owner name will be supplied, if not supplied, owner name(s) are read from stdin
35 :    
36 :     =back
37 :    
38 :     =head2 Output Format
39 :    
40 :     The standard output is a file where each line contains an owner name and a set name
41 :    
42 :     =cut
43 :    
44 :     my $usage = "usage: svr_enumerate_sets_by_owner [--owner=owner_name] >output\n";
45 :     my $owner = "";
46 :     my $url = '';
47 :     my $column;
48 :     my $opted = GetOptions('c=i' => \$column, 'owner=s', \$owner, 'url=s', \$url);
49 :    
50 :    
51 :    
52 :     if (! $opted) {
53 :     print $usage;
54 :     } else {
55 :     if (!$owner) {
56 :     my @owners = ScriptThing::GetList(\*STDIN, $column);
57 :     for $owner (@owners) {
58 :     get_sets($owner);
59 :     }
60 :     } else {
61 :     get_sets($owner);
62 :     }
63 :     }
64 :    
65 :     sub get_sets {
66 :     my ($owner) = @_;
67 :     my $sets = PersistentSets::enumerate_sets_by_owner($owner);
68 :     for my $set (@$sets) {
69 :     print "$owner:$set\n";
70 :     }
71 :     }
72 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3