initial commit of stub project
[id3fs.git] / sbin / id3fsd
1 #!/usr/bin/perl -w
2 # Ian Beckwith <ianb@erislabs.net>
3 #
4
5 use strict;
6 use vars qw($me);
7 $me=($0=~/(?:.*\/)?(.*)/)[0];
8
9 my $verbose=0;
10 my $doneargs=0;
11 my $donesomething=0;
12
13 while($_=shift)
14 {
15     if(/^-/ && !$doneargs)
16     {
17         if   (/-v/) { $verbose=1;        }
18         elsif(/-q/) { $verbose=0;        }
19         elsif(/--/) { $doneargs=1;       }
20         elsif(/-h/) { usage();           }
21         else { usage(); }
22         next;
23     }
24     $donesomething=1;
25     my $file=$_;
26 }
27
28 unless($donesomething)
29 {
30     usage();
31 }
32
33
34 sub usage
35 {
36     die("Usage: $me [-v] [-q] [-h] [--] file...\n".
37         " -v\tVerbose\n".
38         " -q\tQuiet (default)\n".
39         " -h\tThis help\n".
40         " --\tEnd of options\n");
41 }
42
43 __END__
44
45
46 =head1 NAME
47
48 program - description
49
50 =head1 SYNOPSIS
51
52 B<> [I<-v>] [I<-q>] [I<-h>] [I<file>...]
53
54 =head1 DESCRIPTION
55
56 =head1 OPTIONS
57
58 =over 4
59
60 =item B<-v>
61
62 Enable verbose operation.
63
64 =item B<-q>
65
66 Quiet (no output). This is the default.
67
68 =item B<-h>
69
70 Show a short help message.
71
72 =item B<-->
73
74 End of options.
75
76 =back
77
78 =head1 FILES
79
80 =head1 ENVIRONMENT
81
82 =head1 DIAGNOSTICS
83
84 =head1 BUGS
85
86 None known. Please report any found to ianb@erislabs.net
87
88 =head1 SEE ALSO
89
90 =head1 AUTHOR
91
92 Ian Beckwith <ianb@erislabs.net>
93
94 =head1 AVAILABILITY
95
96 The latest version can be found at:
97
98 B<http://erislabs.net/ianb/projects//>
99
100 =head1 COPYRIGHT
101
102 Copyright 2008 Ian Beckwith <ianb@erislabs.net>
103
104 This program is free software; you can redistribute it and/or modify
105 it under the terms of the GNU General Public License as published by
106 the Free Software Foundation; either version 2 of the License, or (at
107 your option) any later version.
108
109 This program is distributed in the hope that it will be useful, but
110 WITHOUT ANY WARRANTY; without even the implied warranty of
111 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
112 General Public License for more details.
113
114 You should have received a copy of the GNU General Public License
115 along with this program; if not, write to the Free Software
116 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
117
118 =cut