Skip to content

Commit

Permalink
Switch to just using --directory more than once
Browse files Browse the repository at this point in the history
I wasn't aware that this was our standard way of doing this. Works for me.

Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 committed Aug 5, 2018
1 parent d938ce8 commit 9574440
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
11 changes: 11 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 4 additions & 6 deletions lib/ohai/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9574440

Please sign in to comment.