updated git and svn scripts
[xrzperl.git] / fileurl
blob74fe3caadffdce26106865e3cdf1aea0e7622041
1 #!/usr/bin/perl -w
2 # $Id$
3 use strict;
4 require v5.10.0;
5 our $VERSION = 'v0.1';
7 BEGIN
9 our $PROGRAM_DIR = $ENV{XR_PERL_SOURCE_DIR};
10 unless($PROGRAM_DIR) {
11 $PROGRAM_DIR = $0;
12 $PROGRAM_DIR =~ s/[^\/\\]+$//;
13 $PROGRAM_DIR =~ s/\/+$//;
14 $PROGRAM_DIR = "." unless($PROGRAM_DIR);
16 unshift @INC,
17 map "$PROGRAM_DIR/$_",qw{modules lib ../modules ..lib};
20 my %OPTS;
21 my @OPTIONS = qw/help|h|? version|ver edit-me manual|man/;
23 if(@ARGV)
25 require Getopt::Long;
26 require MyPlace::Usage;
27 Getopt::Long::GetOptions(\%OPTS,@OPTIONS);
28 MyPlace::Usage::Process(\%OPTS,$VERSION);
30 else
32 require MyPlace::Usage;
33 MyPlace::Usage::PrintHelp();
34 exit 0;
36 use Cwd qw/getcwd/;
37 my $cwd = getcwd;
38 my @r;
39 foreach(@ARGV) {
40 if(m/:\/\//) {
41 push @r,$_;
43 elsif(m/^\//) {
44 push @r,"file://" . $_;
46 else {
47 push @r,"file://" . $cwd . '/' . $_;
50 if(@r) {
51 print join(" ",@r),"\n";
56 __END__
58 =pod
60 =head1 NAME
62 fileurl - PERL script
64 =head1 SYNOPSIS
66 fileurl [options] ...
68 =head1 OPTIONS
70 =over 12
72 =item B<--version>
74 Print version infomation.
76 =item B<-h>,B<--help>
78 Print a brief help message and exits.
80 =item B<--manual>,B<--man>
82 View application manual
84 =item B<--edit-me>
86 Invoke 'editor' against the source
88 =back
90 =head1 DESCRIPTION
92 ___DESC___
94 =head1 CHANGELOG
96 2010-11-21 00:52 xiaoranzzz <xiaoranzzz@myplace.hell>
98 * file created.
100 =head1 AUTHOR
102 xiaoranzzz <xiaoranzzz@myplace.hell>
104 =cut
106 # vim:filetype=perl