Pr/command line support #471

wants to merge 5 commits into


None yet

3 participants


I've implemented command line options for port, environment, confdir and daemon. As per #391 we don't support auto reload in Dancer2. This also fixes #385

I've tested on OSX and CentOS. It works. However, there was a small design problem here. I could not import the setting method into or, I later learned probably this idea is wrong for Dancer2 and I might need to change the configs on the instance. ($runner->config or $app->config) I tried a whole lot of options and none of them worked.

More importantly setting(port => 1234) doesn't work from anywhere once the defaults have been loaded.

I finally just set the $ENV to the appropriate config and this works.

I'm open to refactoring this PR or making any more changes needed to implement this correctly, if this is not acceptable 😄

gideondsouza added some commits Sep 17, 2013
@gideondsouza gideondsouza Work in progress for issue #393. I've added the files and written most
of the necessary code. However I can't seem to find the right way to set
the setting once I parse the command line options.
@gideondsouza gideondsouza Still work in progress for #393. Double checked by testing how
environment can be set. And my suspicions are correct.
@gideondsouza gideondsouza Implemented command line options for dancer2 standalone server.
This fixes issue #393. Besides environment, you can also set port,
confdir and is daemon from the commandline like Dancer1.

The only catch here is that I implemented this feature by setting the
@gideondsouza gideondsouza Removed unwanted method. e5d2c2f
@gideondsouza gideondsouza Fixed incorrect spacing. 5644347
PerlDancer member

Fellow core developers, do we want to apply this change in general. It needs to be reworked for the current codebase, so we should agree whether it is worth it.


PerlDancer member

Considering our efforts of stripping the core to something smaller, I'm not sure this is required.

Looking at the supported options, we have: port, environment, daemon, and confdir:

  • Whether to daemonize or not is unnecessary, because we removed support for it. (plackup can daemonize on its own, and you shouldn't be daemonizing the development server anyway).
  • Picking the port is irrelevant because plackup supports that too.
  • Picking the configuration directory and environment makes sense. However, those can be done in the environment variables as well. The question is, is the overhead of supporting these worth it, or do we want to strip that out completely?

@gideondsouza We really appreciate the work you've done on this. I'm sorry if we end up not making use of it. I do believe it helped us understand things much better so even if it's not used, the work you put into it was of value, and is appreciated. :)


hey @xsawyerx and all. Thanks for the reply. It ok that this PR wasn't used. I'm glad it did come in handy in some way. I wish it was seen a bit earlier though :/

Anyway, I will have some more free time now and I'm wondering if there are minor patches needed to the documentation as a result of these command line options not being there. I can submit for that to get back on wagon after my little stint of absence.

PerlDancer member

@gideondsouza I'm going through issues and marking simple issues as "beginner friendly". Feel free to pick them up and work on them. Just write it in the ticket, and ping us with any questions! :)

I think we should close this issue. @racke, @mickeyn, @shumphrey, @veryrusty, etc.?


thanks @xsawyerx I shall be on the lookout 😄

PerlDancer member

@gideondsouza++ for all the work you did, and the work you promoted. :)

@xsawyerx xsawyerx closed this May 25, 2014

You guys are welcome 💃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment