Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,11 @@ Usage
opm [options] command package...

Options:
-h
--help Print this help.
-h, --help Print this help.

-V, --version Print opm version and exit.

-v, --verbose Display verbose output.

--install-dir=PATH Install into the specified PATH directory instead of the system-wide
OpenResty installation tree containing this tool.
Expand Down Expand Up @@ -933,4 +935,3 @@ Redistribution and use in source and binary forms, with or without modification,
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

[Back to TOC](#table-of-contents)

24 changes: 14 additions & 10 deletions bin/opm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use Cwd qw( realpath cwd );
use Digest::MD5 ();
use File::Copy qw( copy move );
use File::Temp qw( tempfile );
use Getopt::Long qw( GetOptions :config no_ignore_case require_order);
use Getopt::Long qw( GetOptions :config no_ignore_case no_auto_abbrev require_order );
#use Data::Dumper qw( Dumper );

my $MAX_DEPS = 100;
Expand Down Expand Up @@ -76,26 +76,27 @@ sub rebase_path ($$$);
sub trim_curl_out ($);

GetOptions("h|help", \(my $help),
"V|version", \(my $print_version),
"cwd", \(my $install_into_cwd),
"install-dir=s", \(my $user_install_dir),
"verbose", \(my $verbose))
or usage(1);
"v|verbose", \(my $verbose))
or usage(1);

if ($help) {
usage(0);
}

if ($print_version) {
print "opm $Version ($Config::Config{archname}, perl $^V)\n";
exit;
}

if (defined $user_install_dir && defined $install_into_cwd) {
err "conflicting options: --cwd and --install-dir=PATH cannot coexist.\n";
}

my $cmd = shift or usage(1);

if ($cmd eq '-v') {
print "opm $Version ($Config::Config{archname}, perl $^V)\n";
exit;
}

# explicitly clear the environments to avoid breaking luajit and resty.
delete $ENV{LUA_PATH};
delete $ENV{LUA_CPATH};
Expand Down Expand Up @@ -2317,8 +2318,11 @@ sub usage {
opm [options] command package...

Options:
-h
--help Print this help.
-h, --help Print this help.

-V, --version Print opm version and exit.

-v, --verbose Display verbose output.

--install-dir=PATH Install into the specified PATH directory instead of the system-wide
OpenResty installation tree containing this tool.
Expand Down