From d5d77f754223c9a73d5c88c98df609565dc74f06 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen Date: Fri, 28 Nov 2014 11:16:55 -0600 Subject: [PATCH] Add usage information to VIBuildProject.sh Update Requirements for VIBuildProject Update Usage for correct markdown formatting --- README.md | 9 +++++---- documentation/Requirements.md | 1 + documentation/UsageSynopsis.md | 8 ++++---- source/bash/VIBuildProject.sh | 14 ++++++++++++++ 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 1bf9016..cd621a7 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ Tools for VIs >``` $ VIBuildProject.sh --project 'C:\path\to\VIKit.lvproj' - -$ VIBuildProject.sh --project 'C:\path\to\VIKit.lvproj' --target "VIKit.dll@My Computer" - +> +$ VIBuildProject.sh --project 'C:\path\to\VIKit.lvproj' --target 'VIKit.dll@My Computer' +> $ VIBuildProject.sh --project 'C:\path\to\VIKit.lvproj' --lv-version 2014 ``` @@ -26,7 +26,7 @@ My Computer VIKit.dll DLL >``` $ VIQueryVersion.exe 'C:\path\to\VIQueryVersion.vi' 13.0 - +> $ VIQueryVersion.exe 'C:\path\to\VIKit.lvproj' 13.0 ``` @@ -58,4 +58,5 @@ Requirements * Windows XP or later * [LabVIEW 2013 Run-Time Engine](http://www.ni.com/download/labview-run-time-engine-2013-sp1/4539/en/) +* `VIBuildProject.sh` requires a LabVIEW IDE with [Application Builder](http://sine.ni.com/nips/cds/view/p/lang/en/nid/210593) diff --git a/documentation/Requirements.md b/documentation/Requirements.md index 7439b6f..082fc8b 100644 --- a/documentation/Requirements.md +++ b/documentation/Requirements.md @@ -3,4 +3,5 @@ Requirements * Windows XP or later * [LabVIEW 2013 Run-Time Engine](http://www.ni.com/download/labview-run-time-engine-2013-sp1/4539/en/) +* `VIBuildProject.sh` requires a LabVIEW IDE with [Application Builder](http://sine.ni.com/nips/cds/view/p/lang/en/nid/210593) diff --git a/documentation/UsageSynopsis.md b/documentation/UsageSynopsis.md index b8b1e67..a470853 100644 --- a/documentation/UsageSynopsis.md +++ b/documentation/UsageSynopsis.md @@ -5,9 +5,9 @@ Tools for VIs >``` $ VIBuildProject.sh --project 'C:\path\to\VIKit.lvproj' - -$ VIBuildProject.sh --project 'C:\path\to\VIKit.lvproj' --target "VIKit.dll@My Computer" - +> +$ VIBuildProject.sh --project 'C:\path\to\VIKit.lvproj' --target 'VIKit.dll@My Computer' +> $ VIBuildProject.sh --project 'C:\path\to\VIKit.lvproj' --lv-version 2014 ``` @@ -23,7 +23,7 @@ My Computer VIKit.dll DLL >``` $ VIQueryVersion.exe 'C:\path\to\VIQueryVersion.vi' 13.0 - +> $ VIQueryVersion.exe 'C:\path\to\VIKit.lvproj' 13.0 ``` diff --git a/source/bash/VIBuildProject.sh b/source/bash/VIBuildProject.sh index 6642eab..e1db5bf 100644 --- a/source/bash/VIBuildProject.sh +++ b/source/bash/VIBuildProject.sh @@ -1,4 +1,8 @@ #!/bin/bash +# +# Copyright 2014 Joe Friedrichsen +# Licensed under the Apache License, Version 2.0 + set -e # sed RegEx to replace / with \ in a path @@ -23,6 +27,15 @@ function ToBashPath echo "$1" | sed -e "${ToBashRoot}" | sed -e "${ToBashSeparators}" } +function PrintUsage +{ + echo >&2 "Usage:" + echo >&2 " VIBuildProject.sh --project 'c:\path\to\project.lvproj' [--target 'SpecName@TargetName'] [--lv-version VersionYear]" + echo >&2 + echo >&2 "To find buildable targets for the --target option, use \"VIQueryBuildSpecs c:\path\to\project.lvproj\"" + echo >&2 +} + function ExitWithError { echo >&2 "ERROR: $1" @@ -184,6 +197,7 @@ while test $# -gt 1; do done if test -z "${ProjectPath}"; then + PrintUsage ExitWithError "argument '--project c:\path\to\project.lvproj' is required." fi