Oct 10, 2010 at 4:18 AM
Edited Oct 18, 2010 at 4:59 AM
lately i had been thinking of how to extend NuPack.exe command line.
i came up with the ideas of git and hg (mercurial command line tools).
actually u don't need to create nupack-tools.exe you can just create nupack.
to make it clear let me take an example of git.
lets say u type
git --version or git -help
see the first argument (--version, --help), it start with "--" or "-" or "/" (for windows). if this is the case just parse the whole arguments as a normal command line app.
git cherry-pick 1225AB
git log --pretty=oneline
if the 1st argument doesn't start with "--", "-", or "/" it is a sub command. this allows to register for any arbitary subcommands which basically works like extensions. it also allows to extend the core git.exe (or nupack.exe)
without recompiling it.
the above two example might not make much sense. lets see a better example.
git svn clone https://.....
i can create a module called svn, then use svn to access git.
so now you can have nupack-tools as "nupack tools"
the basic idea is the idea of subcommands.
actually i had already sort of started coding out here
you can see the example of sub commands.