-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide target info on shell invocation #1475
Conversation
Makes sense. In terms of styling, I removed one line, indented and aligned the values and I feel it looks a bit cleaner. @hannah-radish ? Diff: diff --git a/lib/inspec/shell.rb b/lib/inspec/shell.rb
index 226ffb7..ec198fd 100644
--- a/lib/inspec/shell.rb
+++ b/lib/inspec/shell.rb
@@ -100,10 +100,9 @@ module Inspec
ctx = @runner.backend
puts <<EOF
You are currently running on:
-
- OS platform: #{mark ctx.os[:name] || 'unknown'}
- OS family: #{mark ctx.os[:family] || 'unknown'}
- OS release: #{mark ctx.os[:release] || 'unknown'}
+ OS platform: #{mark ctx.os[:name] || 'unknown'}
+ OS family: #{mark ctx.os[:family] || 'unknown'}
+ OS release: #{mark ctx.os[:release] || 'unknown'}
EOF
end |
It looks beautiful! Output is really clean. Thank you @adamleff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it + great coding, kudos Adam!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea to show that information out-of-the-box. I agree with Alex, that less spaces in front look better. Nevertheless, I would like to keep the newline.
When in inspec shell, you need to type the `help` command to find out info about your target system. This info would be super helpful right out of the gate so users have confidence that they're targeting the correct system. The target info is still available via the `help` command as it always has been, as well. Signed-off-by: Adam Leff <[email protected]>
c22d491
to
bc7db89
Compare
rebased |
When in inspec shell, you need to type the
help
command to find out infoabout your target system. This info would be super helpful right out of the
gate so users have confidence that they're targeting the correct system.
The target info is still available via the
help
command as it always hasbeen, as well.
/cc @hannah-radish