Improve CLI usage output

* Move -h option at tail;
* Add separator between standard and tail options.
This commit is contained in:
Thibault Jouan
2015-04-18 17:08:18 +00:00
parent 0f2d658986
commit 7d011dad60
3 changed files with 21 additions and 25 deletions

View File

@@ -106,20 +106,6 @@ module Uh
end
describe '#parse_arguments!' do
context 'with help option' do
let(:arguments) { %w[-h] }
it 'prints the usage banner on standard output' do
trap_exit { cli.parse_arguments! }
expect(stdout.string).to match /\AUsage: .+/
end
it 'prints options usage on standard output' do
trap_exit { cli.parse_arguments! }
expect(stdout.string).to match /\n^options:\n\s+-/
end
end
context 'with verbose option' do
let(:arguments) { %w[-v] }
@@ -185,6 +171,20 @@ module Uh
end
end
context 'with help option' do
let(:arguments) { %w[-h] }
it 'prints the usage banner on standard output' do
trap_exit { cli.parse_arguments! }
expect(stdout.string).to match /\AUsage: .+/
end
it 'prints options usage on standard output' do
trap_exit { cli.parse_arguments! }
expect(stdout.string).to match /\n^options:\n\s+-/
end
end
context 'with version option' do
let(:arguments) { %w[-V] }