diff options
author | elijah <elijah@riseup.net> | 2014-09-23 15:04:22 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2014-09-23 15:04:22 -0700 |
commit | bf6c804a7ed36043d6f43c1e38172b11ed50160a (patch) | |
tree | 9fe113498613b21705665a8c55b6600f27126791 /lib/leap_cli/commands | |
parent | be87d1e2039c4f552bef28c4c2749ec72cff3545 (diff) |
leap compile - allow optional ENVIRONMENT argument
Diffstat (limited to 'lib/leap_cli/commands')
-rw-r--r-- | lib/leap_cli/commands/compile.rb | 8 |
1 files changed, 7 insertions, 1 deletions
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 |