App-Cmdline

 view release on metacpan or  search on metacpan

docs/App-Cmdline-Options-DB.html  view on Meta::CPAN

  <li class='indexItem indexItem1'><a href='#OPTIONS'>OPTIONS</a>
  <ul   class='indexList indexList2'>
    <li class='indexItem indexItem2'><a href='#--dbname'>--dbname</a>
    <li class='indexItem indexItem2'><a href='#--dbhost'>--dbhost</a>
    <li class='indexItem indexItem2'><a href='#--dbport'>--dbport</a>
    <li class='indexItem indexItem2'><a href='#--dbuser'>--dbuser</a>
    <li class='indexItem indexItem2'><a href='#--dbpasswd'>--dbpasswd</a>
    <li class='indexItem indexItem2'><a href='#--dbsocket'>--dbsocket</a>
  </ul>
  <li class='indexItem indexItem1'><a href='#AUTHOR'>AUTHOR</a>
  <li class='indexItem indexItem1'><a href='#COPYRIGHT_AND_LICENSE'>COPYRIGHT AND LICENSE</a>
</ul>
</div>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="NAME"
>NAME</a></h1>

<p>App::Cmdline::Options::DB - set of database-related options for command-line applications</p>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="VERSION"
>VERSION</a></h1>

<p>version 0.1.2</p>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="SYNOPSIS"
>SYNOPSIS</a></h1>

<pre>   # In your module that represents a command-line application:
   sub opt_spec {
       my $self = shift;
       return $self-&#62;check_for_duplicates (
           [ &#39;check|c&#39; =&#62; &#34;only check the configuration&#34;  ],
           ...,
           $self-&#62;composed_of (
               &#39;App::Cmdline::Options::DB&#39;,     # here are the database options added
               &#39;App::Cmdline::Options::Basic&#39;,  # here may be other options
           )
       );
    }</pre>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="DESCRIPTION"
>DESCRIPTION</a></h1>

<p>This is a kind of a <i>role</i> module, defining a particular set of command-line options and their validation. See more about how to write a module that represents a command-line application and that uses this set of options in <a href="http://se...
>App::Cmdline</a>.</p>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="OPTIONS"
>OPTIONS</a></h1>

<p>Particularly, this module specifies the database-related options, allowing to define what database to access and how to authenticate the access. It is particularly well suited for the MySQL DBI access.</p>

<pre>    [ &#39;dbname=s&#39;   =&#62; &#34;database name&#34;                                            ],
    [ &#39;dbhost=s&#39;   =&#62; &#34;hostname hosting database&#34;,    { default =&#62; &#39;localhost&#39; } ],
    [ &#39;dbport=i&#39;   =&#62; &#34;database port number&#34;,         { default =&#62; 3306 }        ],
    [ &#39;dbuser=s&#39;   =&#62; &#34;user name to access database&#34;, { default =&#62; &#39;reader&#39; }    ],
    [ &#39;dbpasswd=s&#39; =&#62; &#34;password to access database&#34;                              ],
    [ &#39;dbsocket=s&#39; =&#62; &#34;UNIX socket accessing the database&#34;                       ],</pre>

<h2><a class='u' href='#___top' title='click to go to top of document'
name="--dbname"
>--dbname</a></h2>

<p>It specifies the database name. No default value.</p>

<h2><a class='u' href='#___top' title='click to go to top of document'
name="--dbhost"
>--dbhost</a></h2>

<p>It specifies the computer name (or its IP address) where is the database. Default value is <code>localhost</code>.</p>

<h2><a class='u' href='#___top' title='click to go to top of document'
name="--dbport"
>--dbport</a></h2>

<p>It is an integer, specifying a port number where the database is listening. Default value is 3306 (suited for MySQL).</p>

<h2><a class='u' href='#___top' title='click to go to top of document'
name="--dbuser"
>--dbuser</a></h2>

<p>It specifies a user name to access this database. Default value is <code>reader</code>,</p>

<h2><a class='u' href='#___top' title='click to go to top of document'
name="--dbpasswd"
>--dbpasswd</a></h2>

<p>It specifies a database password for the given user. No default value.</p>

<h2><a class='u' href='#___top' title='click to go to top of document'
name="--dbsocket"
>--dbsocket</a></h2>

<p>It specifies a UNIX socket file name (such as <em>/tmp/mysqld.sock</em>). No default value.</p>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="AUTHOR"
>AUTHOR</a></h1>

<p>Martin Senger &#60;martin.senger@gmail.com&#62;</p>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="COPYRIGHT_AND_LICENSE"
>COPYRIGHT AND LICENSE</a></h1>

<p>This software is copyright (c) 2013 by Martin Senger, CBRC - KAUST (Computational Biology Research Center - King Abdullah University of Science and Technology) All Rights Reserved.</p>

<p>This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.</p>

<!-- end doc -->

</body></html>



( run in 0.673 second using v1.01-cache-2.11-cpan-99c4e6809bf )