Take a look at the source of Mojolicious::Command::get. It will answer all of your questions.
On Thursday, May 15, 2014, Neil Watson <n...@watson-wilson.ca> wrote: > Greetings, > > When using mojo::command how do you parse arguments? I tried > getopt::long but nothing came through. > > package DeltaR::Command::query; > use Mojo::Base 'Mojolicious::Command'; > use Getopt::Long; > use Data::Dumper; > > sub run > { > my $self = shift; > my %query_params; > > GetOptions ( > 'timestamp' => \$query_params{timestamp}, > ); print "query_params: ".Dumper( \%query_params ); > > CLI args are class myclass -t 2014-09-08:14:00T-004, but Dumper > returns > > query_params: $VAR1 = { > 'timestamp' => 1 > }; > > > -- > Neil Watson > Linux/UNIX Consultant > http://watson-wilson.ca > > -- > You received this message because you are subscribed to the Google Groups > "Mojolicious" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to mojolicious+unsubscr...@googlegroups.com. > To post to this group, send email to mojolicious@googlegroups.com. > Visit this group at http://groups.google.com/group/mojolicious. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+unsubscr...@googlegroups.com. To post to this group, send email to mojolicious@googlegroups.com. Visit this group at http://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.