MooseX::Role::Cmd::Meta::Attribute::Trait man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

MooseX::Role::Cmd::MetUsertContribMooseX::Role::Cmd::Meta::Attribute::Trait(3)

NAME
       MooseX::Role::Cmd::Meta::Attribute::Trait - Optional meta attribute
       trait for custom option names

SYNOPSIS
	   package MyApp::Cmd::SomeScript;

	   with 'MooseX::Role::Cmd';

	   has 'basic'	 => (
	       isa	       => 'Str',
	       is	       => 'rw',
	   );

	   has 'prefix'	  => (
	       traits	       => [ 'CmdOpt' ],
	       isa	       => 'Str',
	       is	       => 'rw',
	       cmdopt_prefix   => '-',
	   );

	   has 'rename'	  => (
	       traits	       => [ 'CmdOpt' ],
	       isa	       => 'Str',
	       is	       => 'rw',
	       cmdopt_name     => '+alt_name',
	   );

	   $cmd = MyApp::Cmd::SomeScript->new( basic => 'foo', prefix => 'bar', rename => 'foobar' );

	   $cmd->run();

	   # somescript --basic foo -prefix bar +alt_name foobar

DESCRIPTION
       Provides some extra markup to help MooseX::Role::Cmd decide how to use
       command line parameters.

ATTRIBUTES
   cmdopt_prefix
       Forces the command prefix to be a certain character. This was
       introduced to allow parameters to be specified as "-param" or "--param"

   has_cmdopt_prefix
       Test for attribute above

   cmdopt_name
       Forces the command options name to be the passed string. This was
       introduced to allow parameters to have a different name to the
       attribute.

       This option will override the cmdopt_prefix attribute.

   has_cmdopt_name
       Test for attribute above

   cmdopt_env
       This attribute trait can be used to specify an environment variable
       rather than a command line option.

	   has 'home_dir' => (
	       traits => [ 'CmdOpt' ],
	       is => 'rw',
	       isa => 'Str',
	       cmdopt_env => 'APP_HOME',
	       default => '/my/app/home'
	   );

	   # $ENV{APP_HOME} = /my/app/home

   has_cmdopt_env
       Test for attribute above

BUGS
       All complex software has bugs lurking in it, and this module is no
       exception. If you find a bug please either email me, or add the bug to
       cpan-RT.

AUTHOR
       Ian Sillitoe <ian.sillitoe@gmail.com>

SEE ALSO
       The idea for this code was ripped kicking and screaming from
       MooseX::Getopt::Meta::Attribute::Trait

COPYRIGHT AND LICENSE
       This library is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.

perl v5.14.1			  MooseX::Role::Cmd::Meta::Attribute::Trait(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net