I think the time has come to let everyone (who is willing to participate) test out the commandline for Delphinus! Before we start, this is still a work in progress, and therefore not in the Masterbranch. You can grab the source from the extrabranch here (Tools\Commandline): Delphinus Commandline. Before we start a little sidenote: The commandline pulls the settings (OAUTH-Token) from the same place as the UI. To configure it you need to install Delphinus.
Lets get started!
DPM.exe supports interactive and non-interactive sessions. For simplicity, lets start with interactive. Just start it without any parameter. This is what you’ll see when opening DPM.exe:
Not much to see. The first line tells you which Delphi-Version is currently selected. You can switch the current Delphi at any time in the same session to operate on different Delphis! But more on this at a later time. To get an overview of what is possible, just type “help” which will give you a complete overview of all commands:
We can see which packages are available, and which version. Packages without a version are unversioned. Use versioned ones whereever possible to take advantage of the updatesystem. The “Info” command will give us more details. Type “info asciiimage”:
Using “Info AsciiImage -Versions” will give you a complete list of available versions and “Info AsciiImage -License” will show the license-text. But we’ll skip that for now. If we want to install it, we can simply type “install Asciiimage”, if we want the most recent version. Add the version as second parameter to select anotherone. I’ll skip the picture for this right now, the log is a bit long. Type “list installed” to get a listed of installed packages. Asciimage will show up in this list (the other ones were installed before):
Aha! From thereon we have 2 options. We can use the “Install” command to update a specific package or use the “Update” command if we have multiple pending updates. The Update-Command simply installs all available updates. Quite handy to keep your environment uptodate with a single line!
The DPM.exe has the “-Delphi” switch. That one is supported on Environmentsensitive-commands (like install/update) and on the exe itself. When you start DPM.exe with “-Delphi XE6″. It will select the XE6 environment, and throw an error if XE6 is not installed. At anytime in an interactive session, you can simply write “-Delphi Shortname” to switch the Environment permanently (for the active session). To get a list of valid shortnames, use the Delphis-Command:
Simple Setupscript for your environment
Imagine you have setup your IDE and want to install your favourite packages. By preparing a batch it is even simpler if you have to reinstall at a later time! To do this, we will pipe a list of commands into DPM.exe and specify the target Delphi at calltime. Open a new textdocument and write the following:
save the document as Packages.txt (or any other name). The last line is VERY important. Otherwhise DPM will not exit after execution! After adding all of your packages, you cann call DPM.exe like this:
DPM.exe -Delphi XE < Packages.txt
The “<” is the default PipeIn-operator supported by the windows CMD and allows us to feed the Inputbuffer of a commandline tool with content from a file instead of typing. Do not get confused by the input cursor “DPM>”. At this time it loads the online list of packages which needs some time. Just wait.
This is just the first iteration and i am seeking for help to find bugs and improve. Right now only the Online-Repository is supported. For a proper Commandline, local repositories are required. Those are on my list. However the Dependency-feature i postponed for so long is now at the top of my list. (And it must be available in Commandline and UI ofcourse).
When this tool has become stable enough (which means tested enough) i will merge it back to master.