chapter_5_section_4.html   [plain text]


<html>
    <head>
        <META NAME="Generator" CONTENT="Gutenberg">
		<META NAME="GeneratorVersion" CONTENT="v100.1">
        <META http-equiv="content-type" CONTENT="text/html;charset=iso-8859-1">
        <META NAME = "Copyright" CONTENT="Copyright 2004 Apple Computer, Inc. All Rights Reserved.">
        <TITLE>Tools: HeaderDoc Unfettered: A Simple Command Example</TITLE>
        <base target="content">

        <LINK REL="stylesheet" TYPE="text/css" HREF="../Resources/CSS/frameset_styles.css">
        <style type="text/css"></style>
        <script language="JavaScript" src="../Resources/JavaScript/page.js"></script>
    </head>
    
    <BODY bgcolor="#ffffff" onload="initialize_page();"><a name="//apple_ref/doc/uid/TP40001215-CH357-DontLinkElementID_1084" title="A Simple Command Example" turn_anchor="no"></a>
        <a name="top"></a>
        <!-- start of header -->
        <!--#include virtual="/includes/framesetheader" -->
        <!-- end of header -->
        
        <!-- start of path -->
<div class="breadcrumb"><a href="http://developer.apple.com/" target="_top">ADC Home</a> &gt; <!--a logicalPath="//apple_ref/doc/uid/TP30000943"  -->Reference Library<!--/a--> &gt; <!--a logicalPath="//apple_ref/doc/uid/TP30000440"  -->Documentation<!--/a--> &gt; <!--a logicalPath="//apple_ref/doc/uid/TP30000436"  -->Tools<!--/a--> &gt; <a logicalPath="//apple_ref/doc/uid/TP40001215-CH345" href="../intro/chapter_1_section_1.html#//apple_ref/doc/uid/TP40001215-CH345">HeaderDoc Unfettered</a> &gt; <a logicalPath="//apple_ref/doc/uid/TP40001215-CH357" href="chapter_5_section_1.html#//apple_ref/doc/uid/TP40001215-CH357">Using the MPGL Suite</a> &gt; </div><br>
<!-- end of path -->
        
        <table width="100%" cellpadding=0 cellspacing=0 border=0 class="mini_nav_text"><tr>
        <td align=left scope="row">

        <!-- insert Show/Hide frames -->
        <script type="text/javascript" language="JavaScript"><!--
  
        if (self != top) {
            // loaded in frames
            document.write('<a href="'+self.location+'" target="_top"><img src="../Resources/Images/show_toc_icon.gif" width="15" height="14" border="0" style="margin-bottom: -2px;" alt=""></a> <a href="'+self.location+'" target="_top">Hide TOC</a>');
        }
        else {
            // not loaded frames
            document.write('<a href="../index.html?'+self.location+'" target="_top"><img src="../Resources/Images/show_toc_icon.gif" width="15" height="14" border="0" style="margin-bottom: -2px;" alt=""></a> <a href="../index.html?'+self.location+'" target="_top">Show TOC</a>');
        }
        //--></script>
        <!-- end Show/Hide frames -->

        </td><td align=right>
        
        <a href="chapter_5_section_3.html" target="_self">&lt; Previous Page</a><span style="margin-left: 8px"><a href="chapter_5_section_5.html" target="_self">Next Page &gt;</a></span>
        
        </td>
        </tr></table>
        
        <hr>
        
        <br><h2>A Simple Command Example</h2>
<p><span class="content_text"><a logicalPath="//apple_ref/doc/uid/TP40001215-CH357-CHDHBDCF" href="chapter_5_section_4.html#//apple_ref/doc/uid/TP40001215-CH357-CHDHBDCF">Listing 1-2</a></span> is an example of how to write an MPGL manual page
for a single command or a series of commands with the same syntax.</p>
<table><a name="//apple_ref/doc/uid/TP40001215-CH357-CHDHBDCF" turn_anchor="no"></a><a name="CHDHBDCF" turn_anchor="no"></a><p><b><font face="lucida grande, geneva, helvetica, arial, sans-serif" size="2">Listing 5-2 A simple MPGL example for a command</font></b></p>
<table cellpadding="8" width="100%" bgcolor="#F1F5F9" style="border: 1px solid #C9D1D7;"><tr><td scope="row"><table bgcolor="#F1F5F9" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><pre><code>&lt;manpage&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;docdate&gt;August 28, 2002&lt;/docdate&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;doctitle&gt;Document title&lt;/doctitle&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;os&gt;Darwin&lt;/os&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;section&gt;1&lt;/section&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;names&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;name&gt;foo&lt;desc&gt;this is a description&lt;/desc&gt;&lt;/name&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;name&gt;bar&lt;desc&gt;this is also a description&lt;/desc&gt;&lt;/name&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;/names&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;usage&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;flag optional=&quot;1&quot;&gt;a&lt;arg&gt;attributes&lt;/arg&gt;&lt;desc&gt;This is the atts flag&lt;/desc&gt;&lt;/flag&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;flag&gt;d&lt;arg&gt;date&lt;/arg&gt;&lt;desc&gt;This is the date flag&lt;/desc&gt;&lt;/flag&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;flag&gt;x&lt;desc&gt;This is the -x flag&lt;/desc&gt;&lt;/flag&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;arg&gt;filename&lt;desc&gt;This is the filename&lt;/desc&gt;&lt;/arg&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;/usage&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;returnvalues&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;p&gt;Returns kIONotANumber if you can't count.&lt;/p&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;p&gt;Returns kIOMoron if you REALLY can't count.&lt;/p&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;/returnvalues&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;environment&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        TEXT</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;/environment&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;files&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;file&gt;/path/to/filename&lt;desc&gt;This is a waste of time&lt;/desc&gt;&lt;/file&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;file&gt;/path/to/another/filename&lt;desc&gt;This is also a waste of time&lt;/desc&gt;&lt;/file&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;/files&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;examples&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        TEXT</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;/examples&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;diagnostics&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        TEXT</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;/diagnostics&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;errors&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        TEXT</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;/errors&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;seealso&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;p&gt;This is a text container, really, but generally contains</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        lines like this:&lt;/p&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;manpage&gt;foo&lt;section&gt;1&lt;/section&gt;, &lt;/manpage&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;manpage&gt;bar&lt;section&gt;3&lt;/section&gt;&lt;/manpage&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;/seealso&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;conformingto&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;p&gt;Here's a list of conformance:&lt;/p&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;ul&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>            &lt;li&gt;Single UNIX Specification&lt;/li&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>            &lt;li&gt;POSIX&lt;/li&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;/ul&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;p&gt;Here's a definition list:&lt;/p&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;dl&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>            &lt;dd&gt;foo_aaa&lt;/dd&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>                &lt;dt&gt;This is foo&lt;/dt&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>            &lt;dd&gt;bar&lt;/dd&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>                &lt;dt&gt;This is bar&lt;/dt&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;/dl&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;/conformingto&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;history&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        This program should be history....</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;/history&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;bugs&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;p&gt;Here are some bugs:&lt;/p&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;p&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;ol&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>                &lt;li&gt;Bug one....&lt;/li&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>                &lt;li&gt;Bug two....&lt;/li&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>                &lt;li&gt;Bug three....&lt;/li&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;/ol&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;/p&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>        &lt;p&gt;I think that pretty much covers it.&lt;/p&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;/bugs&gt;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>&lt;/manpage&gt;</code></pre></td><td><code><pre></pre></code></td></tr></table></td></tr></table></table>

        <br><br> 
        
        <table width="100%" cellpadding=0 cellspacing=0 border=0 class="mini_nav_text"><tr>
        <td align=left scope="row">

        <!-- insert Show/Hide frames -->
        <script type="text/javascript" language="JavaScript"><!--
           
        if (self != top) {
            // loaded in frames
            document.write('<a href="'+self.location+'" target="_top"><img src="../Resources/Images/show_toc_icon.gif" width="15" height="14" border="0" style="margin-bottom: -2px;" alt=""></a> <a href="'+self.location+'" target="_top">Hide TOC</a>');
        }
        else {
            // not loaded frames
            document.write('<a href="../index.html?'+self.location+'" target="_top"><img src="../Resources/Images/show_toc_icon.gif" width="15" height="14" border="0" style="margin-bottom: -2px;" alt=""></a> <a href="../index.html?'+self.location+'" target="_top">Show TOC</a>');
        }
        //--></script>
        <!-- end Show/Hide frames -->

        </td><td align=right>
        
        <a href="chapter_5_section_3.html" target="_self">&lt; Previous Page</a><span style="margin-left: 8px"><a href="chapter_5_section_5.html" target="_self">Next Page &gt;</a></span>
        
        </td>
        </tr></table>

        <br><hr><p class="content_text"> <!--#if expr="0=1" -->&#169; 1999, 2004 Apple Computer, Inc. All Rights Reserved. (<!--#endif -->Last updated: 2004-05-27<!--#if expr="0=1" -->)<!--#endif --></p>

        
        <!-- start of footer -->
        <!--#include virtual="/includes/framesetfooter" -->
        <!-- end of footer -->
    </BODY>
</html>