forked from linode/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
linode
executable file
·94 lines (60 loc) · 2.52 KB
/
linode
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env perl
# linode-cli
# Copyright (C) 2015 Linode, LLC
use 5.010;
use strict;
use warnings;
use FindBin;
use lib "$FindBin::RealBin/lib";
use Getopt::Long (qw(:config pass_through));
use Linode::CLI::Util ':basic';
my $object;
if ( defined( $ARGV[0] ) && ( my @found = grep { $_ eq lc( $ARGV[0] ) } @MODES ) ) {
$object = shift;
}
elsif ( defined( $ARGV[0] ) && $ARGV[0] =~ 'help' ) {
Linode::CLI::Util::eat_cmdargs;
}
else {
GetOptions( 'o|object=s' => \$object ) or die "Unable to parse options\n";
}
$object = 'linode'
unless ( defined($object) && ( my @found = grep { $_ eq $object } @MODES ) );
exec( $FindBin::RealBin . "/linode-$object", @ARGV );
__END__
=head1 NAME
linode - command-line interface to the Linode platform
=head1 SYNOPSIS
B<linode> [B<--object> object] [object-options...]
This is a wrapper utility to the suite of Linode command line tools.
=head2 Objects
The following command line tools are available, and can be called directly or
with B<linode object>, e.g.: B<linode domain list>. Each has its own help
documentation accessible with B<--help>; for instance: B<linode -o domain
--help>.
If no object is specified, B<-o linode> is implied.
=over
=item S<-o account, --object account account information>
=item S<-o domain, --object domain domains and DNS records>
=item S<-o linode, --object linode Linode instances>
=item S<-o nodebalancer, --object nodebalancer NodeBalancer configs and nodes>
=item S<-o stackscript, --object stackscript available StackScripts>
=back
=head1 COPYRIGHT/LICENSE
Copyright 2015 Linode, LLC. Linode CLI is made available under the terms
of the Perl Artistic License, or GPLv2 at the recipients discretion.
=head2 Perl Artistic License
Read it at L<http://dev.perl.org/licenses/artistic.html>.
=head2 GNU General Public License (GPL) Version 2
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/
See the full license at L<http://www.gnu.org/licenses/>.
=cut