From 014d500546a2713be0b789fbccd3350c96d22a4f Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Mon, 14 Oct 2019 07:59:17 -0500 Subject: hscript-validate: add dangerous -i flag --- tests/spec/validator.rb | 4 ++++ tools/hscript-validate/validator.cc | 3 +++ 2 files changed, 7 insertions(+) diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb index fb17fa6..cdcd38b 100644 --- a/tests/spec/validator.rb +++ b/tests/spec/validator.rb @@ -19,6 +19,10 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do run_command 'hscript-validate' expect(last_command_started).to have_output(/usage/) end + it "accepts -i flag" do + run_command 'hscript-validate foo -i' + expect(last_command_started).to_not have_output(/usage/) + end it "doesn't output ANSI colours when instructed not to" do run_command 'hscript-validate foo -n' expect(last_command_started).to_not have_output(/\033/) diff --git a/tools/hscript-validate/validator.cc b/tools/hscript-validate/validator.cc index cfaf38d..84c3be3 100644 --- a/tools/hscript-validate/validator.cc +++ b/tools/hscript-validate/validator.cc @@ -30,6 +30,9 @@ int main(int argc, char *argv[]) { auto cli = ( clipp::value("installfile", installfile), + clipp::option("-i", "--install").doc("Set Installation Environment flag (DANGEROUS)")( + [&opts] { opts.set(ScriptOptionFlags::InstallEnvironment); } + ), clipp::option("-k", "--keep-going").doc("Continue parsing after errors")( [&opts] { opts.set(ScriptOptionFlags::KeepGoing); } ), -- cgit v1.2.3-70-g09d2