Skip to content
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

Merged
merged 1 commit into from
Feb 14, 2017

Conversation

adamleff
Copy link
Contributor

@adamleff adamleff commented Feb 8, 2017

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.

/cc @hannah-radish

@alexpop
Copy link
Contributor

alexpop commented Feb 10, 2017

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 ?

screen shot 2017-02-10 at 3 55 31 pm

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

@hannah-radish
Copy link
Contributor

hannah-radish commented Feb 10, 2017

It looks beautiful! Output is really clean. Thank you @adamleff
Let's go with the indentation and extra line (top one)

Copy link
Contributor

@arlimus arlimus left a 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!!

Copy link
Contributor

@chris-rock chris-rock left a 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 <adam@leff.co>
@arlimus arlimus force-pushed the adamleff/show-target-in-shell branch from c22d491 to bc7db89 Compare February 14, 2017 13:46
@arlimus
Copy link
Contributor

arlimus commented Feb 14, 2017

rebased

@arlimus arlimus merged commit 34247f7 into master Feb 14, 2017
@arlimus arlimus deleted the adamleff/show-target-in-shell branch February 14, 2017 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants