The MGI Windows Console API Provides an easy interface to the windows console. This allows command line based LabVIEW applications to write directly to read from standard input, write to standard out, specify exit codes.
When your application first starts, call Console.vi
to acquire the console.
Now you can use the utility methods such as Write Line.vi
, Read Line
, Prompt.vi
, etc to interact with the user at the console.
When your application is complete, use Close.vi
to exit and set the return code.
The argument parser helps developers quickly parse command line arguments. The class provides an API to read flags and settings from the command line. It also provides a framework for generating descriptive arugment documentation.s
By default, the LabVIEW runtime engine releases the console before your application code has even started. That means the order of operations for a CLI application is:
This can cause an awkward user experience, as the console seems to reset before your application has completed.
To work around this, just wrap your application with a batch file. When the application is called from the batch file the console behaves as expected.
For example, to call Application.exe
I would create Application.bat
:
@echo off
"Application.exe" %*
This would launch the application and pass any arguments from the batch file to the application.
See Contributing.md for information on how to submit pull requests. Bugs can be reported using the repositories issue tracker.
Added Arugment Parser
Added Current Working Directory
Updated Readme.
Added password prompt Changed prompts to no longer use newline.
Initial Release
Copyright (c) 2018 Moore Good Ideas, Inc . All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Moore Good Ideas, Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.