<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 3.7.2013 10:38, Roman Rakus wrote:<br>
</div>
<blockquote cite="mid:51D3E312.4040900@redhat.com" type="cite">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<div class="moz-cite-prefix">On 07/03/13 09:38, Jan Safranek
wrote:<br>
</div>
<blockquote cite="mid:51D3D4DF.3040005@redhat.com" type="cite">
<pre wrap=""> o we need documentation (on wiki), how to create new subcommands
+ the part in /usr/libexec/lmi/cmd just registers new
subcommands and parses command line, calling functions
imported from <i class="moz-txt-slash"><span class="moz-txt-tag">/</span>usr/lib/python2.7/site-packages/lmi/scripts<span class="moz-txt-tag">/</span></i></pre>
</blockquote>
What about to have filename defining the subcommand? It should
simplify things a lot.<br>
Example:<br>
<pre wrap="">/usr/libexec/lmi/account/list_user
/usr/libexec/lmi/account/create_user
/usr/libexec/lmi/account/delete_user
/usr/libexec/lmi/storrage/create_vg
...
pros:
- simplifies the process
- one file do one thing - the UNIX way
- transparency
cons:
- a lot of files to maintain
Any ideas, objections?</pre>
</blockquote>
I like the idea, but each such scripton could define its own
subcommands. Example above would result in commands:<br>
<ul>
<li>lmi list_user ...</li>
<li>lmi create_user ...</li>
<li>lmi delete_user ...</li>
<li>lmi create_vg ...</li>
</ul>
I would prefer following layout:<br>
<ul>
<li>
<pre wrap="">/usr/libexec/lmi/account/account</pre>
</li>
<li>
<pre wrap="">/usr/libexec/lmi/storrage/vg</pre>
</li>
<li>
<pre wrap="">/usr/libexec/lmi/storrage/md</pre>
</li>
<li>
<pre wrap="">/usr/libexec/lmi/software/sw</pre>
</li>
</ul>
Each would define its own subcommands. Then the metacommand would
take:<br>
<ul>
<li>lmi account list ...<br>
</li>
<li>lmi account create ...<br>
</li>
<li>lmi account delete ...</li>
<li>lmi vg ...</li>
<li>lmi md ...</li>
<li>lmi sw ...</li>
</ul>
<p>Mm<br>
</p>
<blockquote cite="mid:51D3E312.4040900@redhat.com" type="cite">
<pre wrap="">
RR
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
openlmi-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:openlmi-devel@lists.fedorahosted.org">openlmi-devel@lists.fedorahosted.org</a>
<a class="moz-txt-link-freetext" href="https://lists.fedorahosted.org/mailman/listinfo/openlmi-devel">https://lists.fedorahosted.org/mailman/listinfo/openlmi-devel</a>
</pre>
</blockquote>
<br>
</body>
</html>