resedit 1.3.1 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1b2afae945b0bfe8559010f9de3ecd21889a036
4
- data.tar.gz: 9ec879c124f71706f9d5e90b988c88a1a7576457
3
+ metadata.gz: eabff0ab69b6b4b0518043c87df22ab64975fd75
4
+ data.tar.gz: 00d3c5fa263598370ea4f0ad4c26c745db7c0e01
5
5
  SHA512:
6
- metadata.gz: 85ac7bb3ccf16019f0314d6ffed992c47636ebe0a20451e4988a3afde9e03d67dea91dee2c0a003e619b018189538f962e45398bf6d058efde2796abdb85f6ea
7
- data.tar.gz: 9cbbafcba61f4bc3fef2787a70f9c4e971d80edf508e56b979ee13e891a54431c110d0a1d94dd6dd7e2b1dd9980547a319c643a0c1ae36417468e2bfa5be59c5
6
+ metadata.gz: 6cd69c1fc4bfc35d4c07089eeea46842c493882e8d65b7ae84ed8b288d45daf5d092eb66b75e0bdb2c72280f27d9063342e6cb06e8d292dd899d4ef866a83b45
7
+ data.tar.gz: 554a4024f40a615059eb46190808fcc2c3711ce590b650a344df47e0f30eae78c062a59d7395c9bfa06f28d8e02dd4ba48c3b9096f846dc0f55db2c91c5584f5
@@ -8,7 +8,7 @@ module Resedit
8
8
 
9
9
  class App
10
10
  HIST_FILE = "~/.resedithist"
11
- attr_reader :name, :version, :commands, :logger, :copyright, :cmdInterface, :shell, :col
11
+ attr_reader :name, :version, :commands, :logger, :copyright, :cmdInterface, :shell, :col, :cmds
12
12
 
13
13
  def self.get()
14
14
  return @@instance
@@ -1,7 +1,7 @@
1
1
  module Resedit
2
2
 
3
3
  class AppCommand
4
- attr_reader :names, :type, :params
4
+ attr_reader :names, :type, :params, :opts, :ohash
5
5
  def initialize(names, type=:std)
6
6
  @names, @continue = names, type
7
7
  @names = [@names] if not @names.kind_of?(Array)
@@ -28,9 +28,45 @@ module Resedit
28
28
  addParam('command', 'help on specific command', '')
29
29
  end
30
30
  def job(params)
31
- App.get().commands.each{|c|
32
- puts c.names[0]
33
- }
31
+ if params['command']
32
+ cmd = App.get().cmds[params['command']]
33
+ raise "Unknown command: #{params['command']}" if !cmd
34
+ puts "Command:"
35
+ print "\t" + cmd.names[0]
36
+ if cmd.names.length > 1
37
+ print ' ( '
38
+ cmd.names.each.with_index{|n,i|
39
+ print n + ' ' if i > 0
40
+ }
41
+ print ')'
42
+ end
43
+ puts
44
+ puts "Usage:"
45
+ print "\t" + cmd.names[0] + ' <options>'
46
+ cmd.params.each{|p|
47
+ print ' '
48
+ print '[' if p[:def] != nil
49
+ print p[:name]
50
+ print ']' if p[:def] != nil
51
+ }
52
+ puts
53
+ puts "Params:"
54
+ cmd.params.each{|p|
55
+ puts "\t" + p[:name] + "\t - " + p[:descr]
56
+ }
57
+ puts "Options:"
58
+ rohash = cmd.ohash.invert
59
+ cmd.opts.each{|n, o|
60
+ nm = "\t--" + n
61
+ nm += '=' if o[:param]==nil
62
+ nm += ", -" + rohash[o[:name]] if rohash[o[:name]]
63
+ puts nm + "\t - " + o[:descr]
64
+ }
65
+ else
66
+ App.get().commands.each{|c|
67
+ puts c.names[0]
68
+ }
69
+ end
34
70
  end
35
71
  end
36
72
 
@@ -58,7 +94,7 @@ module Resedit
58
94
  class ShellCommand < AppCommand
59
95
  def initialize
60
96
  super(['shell'])
61
- addParam('shell', 'script file', "")
97
+ addParam('shell', 'shell name', "")
62
98
  end
63
99
  def job(params)
64
100
  App::get().setShell(params['shell'])
@@ -8,7 +8,7 @@ module Resedit
8
8
  super('text', fname)
9
9
  @font = nil
10
10
  addOption('format','f',nil,'output file format')
11
- addOption('encodinc','e',nil,'output file encoding')
11
+ addOption('encoding','e',nil,'output file encoding')
12
12
  end
13
13
 
14
14
  def import(inname)
data/lib/resedit.rb CHANGED
@@ -13,5 +13,5 @@ require 'resedit/mz/mz'
13
13
 
14
14
 
15
15
  module Resedit
16
- VERSION = "1.3.1"
16
+ VERSION = "1.3.3"
17
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resedit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - bjfn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-29 00:00:00.000000000 Z
11
+ date: 2017-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chunky_png