diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 8e7afa2b8..b104e9add 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,14 @@ +# UNRELEASED + +## Multiple plugin directories + +You can now specify more than one directory to load additional Ohai plugins from by using the `--directory` / `-d` flag more than once. + +Example: +```bash +ohai -d /path/to/more/plugins -d /another/path/to/more/plugins +``` + # Ohai Release Notes 14.3 ## Detection of Amazon Linux 2.0 diff --git a/lib/ohai/application.rb b/lib/ohai/application.rb index f64f9e97f..dc16d111c 100644 --- a/lib/ohai/application.rb +++ b/lib/ohai/application.rb @@ -34,12 +34,10 @@ class Ohai::Application option :directory, short: "-d DIRECTORY", long: "--directory DIRECTORY", - description: "A directory to add to the Ohai plugin search path. If passing multiple directories comma separate directories.", - proc: lambda { |paths| - paths = paths.split(",") - paths.map do |path| - Ohai::Config.platform_specific_path(path) - end + description: "A directory to add to the Ohai plugin search path. If passing multiple directories use this option more than once.", + proc: lambda { |path, path_array| + (path_array ||= []) << Ohai::Config.platform_specific_path(path) + path_array } option :log_level,