Cmdo (pronounced "commando") is a tool that makes it easier to build other
tools. It selectively exposes Python modules and functions as a complete
command line interface. Specifically, Cmdo finds modules in standard
locations, interprets command line arguments, invokes functions, imports
modules on demand, and supplies help. It also manages documentation
resources containing structured text.
The current version only has built-in support for command line interfaces.
Function writers are free to implement graphical interfaces. Future Cmdo
releases may provide more help in this area. Since the engine understands a
great deal about the the data handled by exported functions it could
generate code for simple GUIs.
See "INSTALL" or "install.html" for installation instructions.
See "DEVELOPMENT" or "development.html" for guidance on building your own
applications.
What's in it for Developers? | Top |
-
Maximizes the ability of Python programmers to focus on application logic.
-
Minimizes the extra work needed for user interfaces and documentation.
What's in it for the Author?
I'm scratching an itch. The results are useful to me. Even if nobody else
uses it, Cmdo will remain an important component of my computing and
development environment.
Cmdo is the start of an experimental application construction tool set and
philosophy. Similar to many other development tools, the ultimate goal is
to reduce or eliminate as many non-core development burdens as possible.
Minimizing the demands of interface construction, help system maintenance,
and documentation production allows greater focus on the real-world
problems demanding your software solution.
I personally find this a fun and easy way to build tools. Nothing would
make me happier than to know I'm helping other people be more productive.
I eagerly await your feedback to help me craft the tool YOU want. Are the
notions useful, misguided, or do they need improvement? Thanks for at
least checking it out!
Feedback (Please...)
This is the first Cmdo release. It is used every day, but by a very
limited number of people. So I rely on your feedback to help improve
quality and functionality.
So please report problems (with as many details as you can provide), but
also voice what would make this software more useful to you. Don't
hesitate to ask, even if you have ideas that seem unrelated to the current
feature set.
Cmdo supports two distinct syntax alternatives, a simplified command line
syntax allowing one command per command line, and full Python syntax with
each argument as a complete command.
Since Cmdo is a development tool, the following examples use a fictional
cmdo-based application called "fido". Think of Fido as a general fetcher of
stuff, with "newspaper", "lottery", "weather", and "tv" modules.
Simplified Syntax
Simplified syntax allows one command per command line. The first argument
is a function name. The remaining arguments are passed to the function
call. For example, to have "fido" fetch newspaper #3 from yesterday...
fido newspaper.fetch 3 yesterday
Full Python Syntax
Full Python syntax accepts anything Python can handle on a single line,
including nested calls, conditionals, etc. Each argument is a full
command. The "-e" option is not generally needed, since the engine
recognizes more complex syntax by looking for imbedded blanks or certain
punctuation. If used, "-e" must precede the first command.
For example, to fetch both yesterday's newspaper #3 and tomorrow's
Washingon lottery results (smart dog, eh?)...
fido -e 'newspaper.fetch(3, "yesterday")' 'lottery.download("WA", "tomorrow")'
Note that strings are now quoted, arguments are comma-separated, and
within the parentheses of a function call. Single quotes around each
command prevent shell interpretation of parentheses and other special
characters.
The next example shows slightly more complex Python code with conditional
logic, because we want to restrict television watching to rainy days.
fido 'if weather.israiny(): tv.guide("now")'
The two examples above are only possible using full Python syntax. In the
first case, it's the only way to have two commands on the same command
line. The conditional statement in the second example wouldn't be
possible, because simplified syntax is limited to just the function call
and its arguments.
Getting Help
To list available functions:
fido help
To see available options and parameters for the help command:
fido help help
To get help for a particular function:
fido help newspaper.fetch
To save the reference guide for all modules and functions in HTML format:
fido help reference format=html output=reference.html
To display the reference guide in a web browser:
fido help reference format=html view=yes