tclmain

Difference between version 0 and 1 - Previous - Next
<<toc>>

----

**Name**

''tclmain'' - Run Tcl application via the package name.

**Description**

[DDG] 2023-01-26: ''tclmain''  is a standalone application which allows you to run applications directly from the package instead of creating separate executables placed in directories belonging to the PATH variable. This approach is based on Python's syntax "`python3 -m modulename`" which will execute the file "`__main.py__`" in the package directory.

**Links**

    * Homepage: https://github.com/mittelmark/tclmain
    * Download: https://github.com/mittelmark/tclmain/tree/master/tclmain.tcl
    * Readme: https://github.com/mittelmark/tclmain/
    * Version: 0.1 - 2023-01-26
    * License: BSD

**Examples**

These examples require the files in the examples directory from the Github repository.

======
$ tclmain -m Markdown 
Missing command for package Markdown.
Available commands are: main
$  tclmain -m Markdown main
Usage: tclmain -m Markdown main mdfile|- ?htmlfile|-?
       instead of filenames as well - can be used to indicate stdin and stdout

Example:
   echo '**Hello World!**' |  tclmain -m Markdown main - out.html
   
$  echo '**Hello world!**'  | tclmain -m Markdown main -
<p><strong>Hello world!</strong></p>======
======

**Discussion**

[DDG] 2023-01-26: The principal idea is to simplify development of packages and applications and providing a standard interface for the user to run the application, to get help or to execute some demos. The package developer just place files like `pkgname_main.tcl`, `pkgname_demo.tcl`, `pkgname_help.tcl` in the package folder. Which would allow to run commands main, demo or help for the package or the command line application. There is as well a facility to add such files to a `config` folder in its own home directory to add these unified syntax to packages which does not (yet) provide this functionality.
<<categories>> Package | WidgDeployment | Snit WidPackagets