jacksonh.tumblr.com

3 notes &

Command Line Args for Manos Apps

One of the use cases for Manos is embedding a web server in your app. So it would be natural to do something like this:

int level_of_foo = 15;
.....
var app = new FooApp ("Some foo string", level_of_foo);
AppHost.Start (app);

However there are two other ways you can invoke a manos app. You can compile your app into an exe (not supported yet) or you can use the manos tool in your application directory:

manos -server

This will find your app’s .dll, load it and host your app.

To handle the second two scenarios your app needed a default constructor. I don’t want to force people to create stub applications just to have constructor parameters, so the manos -server command now supports passing arguments to the constructor on the command line. It does type conversion on all the params, finds a constructor that matches what was passed, and creates your app.

So this does the same thing as the top example:

manos -server "Some foo string" 15
  1. jacksonh posted this