From bf6c804a7ed36043d6f43c1e38172b11ed50160a Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 23 Sep 2014 15:04:22 -0700 Subject: leap compile - allow optional ENVIRONMENT argument --- lib/leap_cli/commands/compile.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/leap_cli/commands/compile.rb b/lib/leap_cli/commands/compile.rb index 63c2047..eaedfbf 100644 --- a/lib/leap_cli/commands/compile.rb +++ b/lib/leap_cli/commands/compile.rb @@ -5,9 +5,15 @@ module LeapCli desc "Compile generated files." command :compile do |c| c.desc 'Compiles node configuration files into hiera files used for deployment.' + c.arg_name 'ENVIRONMENT', :optional => true c.command :all do |all| all.action do |global_options,options,args| - compile_hiera_files + environment = args.first + if environment && manager.environment_names.include?(environment) + compile_hiera_files(manager.filter(args)) + else + compile_hiera_files + end end end -- cgit v1.2.3