[Catalyst-dev] Proposal to the Perl Foundation for CatalystX::Installer

Paul Cain fat.perl.hacker at gmail.com
Tue Apr 29 22:49:15 BST 2008


Edmund,

I see what you mean about the GUI and command line becoming closely
tied if I use WWW::Mechanize. Part of the  problem with command line
options is that parsing them can be a painful experience. However, I
was thinking that if I enforced a strict, uniform way to pass command
line options, it would make thing much simpler.

Each command line option would have a corresponding form entry, but
the order in which the command line options are passed would not be
significant. For example:

script/myapp_setup.pl --password="mypass"  --username="admin"
--db_location="/tmp"

If the options are generated by the script/myapp_install.pl after it
runs, like Kieren suggested above, it would save the user from having
to learn the rules for command line options.

It's something to think about.

Paul Cain

On Tue, Apr 29, 2008 at 3:05 AM, Edmund von der Burg
<evdb at ecclestoad.co.uk> wrote:
> 2008/4/28 Paul Cain <fat.perl.hacker at gmail.com>:
>
> > What if rather than having command line options, you could just use
>  >  WWW::Mechanize to automatically fill out the forms with a script.
>  >
>  >  Something like:
>  >
>  >  use WWW::Mechanize;
>  >  my $mech = WWW::Mechanize->new();
>  >
>  >  #Your password shouldn't be hardcoded into a script this way in practice
>  >  $mech->submit_form(
>  >         fields      => {
>  >             username    => 'admin',
>  >             password    => 'mypass',
>  >         }
>  >  );
>  >
>  >  $mech->submit_form(
>  >         fields    => {
>  >                   dbd       => 'sqlite',
>  >                   dbname => 'foo.db',
>  >                   #ect
>  >         },
>  >  );
>  >
>  >  This would be easier than implementing two seperate interfaces for the
>  >  command line and GUI, and with a little golf it could probably be done
>  >  in a few perl -e commands.
>
>  This would mean that the command line system would be closely tied to
>  the GUI part. A change to the GUI might lead to a change in the
>  command line code too.
>
>  Better would be to have the command line and GUI produce a config file
>  (or similar) which is then used to actually do the installation. This
>  would decouple the two, and allow for other installation methods in
>  future.
>
>  However it is achieved having a simple way to install a Catalyst app
>  would be great - so good luck with this.
>
>  Cheers,
>   Edmund.
>
>
>
>  _______________________________________________
>  Catalyst-dev mailing list
>  Catalyst-dev at lists.scsys.co.uk
>  http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
>



More information about the Catalyst-dev mailing list