source: projects/vine-spec-skeleton/tags/release-0.3/bin/vine-spec-skeleton @ 499

Revision 499, 744 bytes checked in by iwaim, 14 years ago (diff)

vine-spec-skeleton: 引数にパッケージ名がない場合にファイルを生成しないように。

  • Property svn:executable set to *
Line 
1#!/usr/bin/perl
2# -*- coding:utf-8-unix; mode:cperl -*-
3
4use strict;
5use warnings;
6
7use lib './../lib';
8
9use VineLinux::VSS;
10use Getopt::Long;
11use File::Spec;
12
13my $vss_home = "$ENV{HOME}/.vine/app/vss";
14my $config = "$vss_home/config.yaml";
15
16my $type = '';
17
18GetOptions(
19           '--config=s', \$config,
20           '--type=s' , \$type,
21           '--version' => \my $version
22          );
23Getopt::Long::Configure("bundling");
24
25my $package_name = $ARGV[0];
26
27unless (defined $package_name && $package_name =~ m/^.+$/) {
28  print "require PACKAGE_NAME\n";
29  exit;
30}
31
32if ($version) {
33  print "vine-spec-skeleton version $VineLinux::VSS::VERSION\n";
34  exit;
35}
36
37my $app = VineLinux::VSS->new(config => $config, type => $type,
38                             package_name => $package_name);
39$app->run();
Note: See TracBrowser for help on using the repository browser.