From 8f9076f374c6b4e67db9a6c28c3d44b3ede5679e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 29 Aug 2012 21:27:59 -0400 Subject: v3: sisu -v, provide version information, fix --- data/doc/sisu/CHANGELOG_v3 | 2 ++ lib/sisu/v3/hub.rb | 6 ++---- lib/sisu/v3/options.rb | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index d63ed66a..f7fc8126 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -31,6 +31,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.3.orig.tar.xz sisu_3.3.3-1.dsc sisu_3.3.3-1.debian.tar.gz +* v3: sisu -v, provide version information, fix + * v3: constants, year static (current): YEAR=2012 %% 3.3.2.orig.tar.xz (2012-06-30:26/6) diff --git a/lib/sisu/v3/hub.rb b/lib/sisu/v3/hub.rb index c4eed640..6fa69753 100644 --- a/lib/sisu/v3/hub.rb +++ b/lib/sisu/v3/hub.rb @@ -501,10 +501,8 @@ p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on def do_initialization @cX=SiSU_Screen::Ansi.new(@opt.cmd).cX flag=SiSU_Env::InfoProcessingFlag.new - if @opt.cmd =~/[vVM]/ #% version information - unless @opt.files.empty? - SiSU_Help::Help.new('env',@opt).sisu_version - end + if @opt.act[:version_info][:set]==:on #% version information + SiSU_Help::Help.new('env',@opt).sisu_version end if @opt.act[:license][:set]==:on #% license information SiSU_Help::Help.new('license',@opt).help_request diff --git a/lib/sisu/v3/options.rb b/lib/sisu/v3/options.rb index 7aa3622d..5871d8db 100644 --- a/lib/sisu/v3/options.rb +++ b/lib/sisu/v3/options.rb @@ -509,6 +509,12 @@ module SiSU_Commandline { bool: false, set: :off } else { bool: true, set: :na } #fix default color end + act[:version_info]=if cmd =~/[vVM]/ \ + || mod.inspect =~/"--verbose"|"--maintenance"/ + { bool: true, set: :on } + else + { bool: false, set: :na } + end # act[:color_toggle]=if cmd =~/c/ \ # or mod.inspect =~/"--color-toggle"/ # true -- cgit v1.2.3