Skip to content

Commit

Permalink
Merge pull request #104 from mziescha/feat/add_host_and_port_in_cli
Browse files Browse the repository at this point in the history
add host and port as CLI param
  • Loading branch information
tokuhirom committed Apr 21, 2018
2 parents 7c1bca3 + 446d51e commit 4a8bd89
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/Crust/Runner.pm6
Expand Up @@ -27,13 +27,15 @@ method parse-options(@args) {
my Bool $version;
@args = Getopt::Tiny.new(:pass-through)
.str( 'e', Nil, { $!eval = $^a })
.str( 'I', Nil, { @!inc.push: $^a })
.str( 'M', Nil, { @!modules.push: $^a })
.bool(Nil, 'accesslog', { $!accesslog = $^a })
.bool(Nil, 'lint', { $!lint = $^a })
.bool('v', 'version', { $version = $^a })
.str( 's', 'server', { $!server = $^a })
.str( 'e', Nil, { $!eval = $^a })
.str( 'I', Nil, { @!inc.push: $^a })
.str( 'M', Nil, { @!modules.push: $^a })
.bool(Nil, 'accesslog', { $!accesslog = $^a })
.bool(Nil, 'lint', { $!lint = $^a })
.bool('v', 'version', { $version = $^a })
.str( 'h', 'host', { %!options{'host'} = $^a })
.int( 'p', 'port', { %!options{'port'} = $^a })
.str( 's', 'server', { $!server = $^a })
.parse(@args);

if $version {
Expand Down Expand Up @@ -120,4 +122,3 @@ multi method run() {
my $httpd = ::($handler).new(|%!options);
$httpd.run(&app);
}

0 comments on commit 4a8bd89

Please sign in to comment.