Skip to content

Commit

Permalink
add -o option to get command
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 23, 2016
1 parent 604d478 commit 57cb876
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,6 +1,6 @@

7.08 2016-09-23
- Added -i option to get command.
- Added -i and -o options to get command.
- Improved accuracy of finished_ok test in Test::Mojo.
- Fixed state transition bug in Mojo::Transaction::HTTP that caused message
bodies to be included in responses to HEAD requests.
Expand Down
6 changes: 5 additions & 1 deletion lib/Mojolicious/Command/get.pm
Expand Up @@ -22,6 +22,7 @@ sub run {
'H|header=s' => \my @headers,
'i|inactivity-timeout=i' => \my $inactivity,
'M|method=s' => \(my $method = 'GET'),
'o|connect-timeout=i' => \my $connect,
'r|redirect' => \my $redirect,
'v|verbose' => \my $verbose;

Expand All @@ -38,6 +39,7 @@ sub run {
$ua->max_redirects(10) if $redirect;

$ua->inactivity_timeout($inactivity) if defined $inactivity;
$ua->connect_timeout($connect) if $connect;

my $buffer = '';
$ua->on(
Expand Down Expand Up @@ -134,7 +136,7 @@ Mojolicious::Command::get - Get command
./myapp.pl get -H 'Accept: text/html' /hello.html 'head > title' text
./myapp.pl get //sri:secr3t@/secrets.json /1/content
mojo get mojolicious.org
mojo get -v -r -i 50 google.com
mojo get -v -r -o 25 -i 50 google.com
mojo get -v -H 'Host: mojolicious.org' -H 'Accept: */*' mojolicious.org
mojo get -M POST -H 'Content-Type: text/trololo' -c 'trololo' perl.org
mojo get mojolicious.org 'head > title' text
Expand All @@ -159,6 +161,8 @@ Mojolicious::Command::get - Get command
-m, --mode <name> Operating mode for your application,
defaults to the value of
MOJO_MODE/PLACK_ENV or "development"
-o, --connect-timeout <seconds> Connect timeout, defaults to the value
of MOJO_CONNECT_TIMEOUT or 10
-r, --redirect Follow up to 10 redirects
-v, --verbose Print request and response headers to
STDERR
Expand Down

0 comments on commit 57cb876

Please sign in to comment.