GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Prophet::CLI::Command(3) User Contributed Perl Documentation Prophet::CLI::Command(3)

Prophet::CLI::Command

version 0.751

This is the Prophet CLI's way of supporting short forms for arguments, e.g. you want to let '-v' be able to used for the same purpose as '--verbose' without dirtying your code checking both or manually setting them if they exist. We want it to be as easy as possible to have short commands.

To use, have your command subclass do:

    sub ARG_TRANSLATIONS { shift->SUPER::ARG_TRANSLATIONS(),  f => 'file' };

You can register as many translations at a time as you want. The arguments will be translated when the command object is instantiated. If an arg already exists in the arg translation table, it is overwritten with the new value.

Checks to make sure the uuid attribute is set. Prints an error and dies with the command's usage string if it is not set.

Filters the given text through the user's $EDITOR using Proc::InvokeEditor. If $ENV{$self->editor_var} is specified ("$self->editor_var" defaults to PROPHET_EDITOR), it is favored over $EDITOR.

Filters the hash through the user's $EDITOR using Proc::InvokeEditor. If $ENV{$self->editor_var} is specified ("$self->editor_var" defaults to PROPHET_EDITOR), it is favored over $EDITOR.

No validation is done on the input or output.

If the optional ordering argument is specified, hash keys will be presented in that order (with unspecified elements following) for edit.

If the record class for the current type defines a "immutable_props" routine, those props will not be presented for editing.

False values are not returned unless a prop is removed from the output.

Returns a hashref of the command's props mixed in with any default props. If the "arg" argument is specified, (default "edit", use "undef" if you only want default arguments), then "edit_hash" is invoked on the property list.

If the "ordering" argument is specified, properties will be presented in that order (with unspecified props following) if filtered through "edit_hash".

Asks user the question and returns 0 if answer was the second choice, 1 otherwise. (First choice is the default.)

Asks user the question and returns true if answer was positive or false otherwise. Default answer is 'Yes' (returns true).
Print the command's usage message to STDERR and die. Commands should implement "usage_msg", which returns the usage message.

If the usage message method needs arguments passed in, use a closure.

Gets the name of the script that was run and the primary commands that were specified on the command-line. If a true boolean is passed in as "no_type", won't add '<record-type>' to the subcmd if no type was passed in via the primary commands.

  • Jesse Vincent <jesse@bestpractical.com>
  • Chia-Liang Kao <clkao@bestpractical.com>
  • Christine Spang <christine@spang.cc>

This software is Copyright (c) 2009 by Best Practical Solutions.

This is free software, licensed under:

  The MIT (X11) License

You can make new bug reports, and view existing ones, through the web interface at <https://rt.cpan.org/Public/Dist/Display.html?Name=Prophet>.

  • Alex Vandiver <alexmv@bestpractical.com>
  • Casey West <casey@geeknest.com>
  • Cyril Brulebois <kibi@debian.org>
  • Florian Ragwitz <rafl@debian.org>
  • Ioan Rogers <ioanr@cpan.org>
  • Jonas Smedegaard <dr@jones.dk>
  • Kevin Falcone <falcone@bestpractical.com>
  • Lance Wicks <lw@judocoach.com>
  • Nelson Elhage <nelhage@mit.edu>
  • Pedro Melo <melo@simplicidade.org>
  • Rob Hoelz <rob@hoelz.ro>
  • Ruslan Zakirov <ruz@bestpractical.com>
  • Shawn M Moore <sartak@bestpractical.com>
  • Simon Wistow <simon@thegestalt.org>
  • Stephane Alnet <stephane@shimaore.net>
  • Unknown user <nobody@localhost>
  • Yanick Champoux <yanick@babyl.dyndns.org>
  • franck cuny <franck@lumberjaph.net>
  • robertkrimen <robertkrimen@gmail.com>
  • sunnavy <sunnavy@bestpractical.com>
2022-04-08 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.