mysh 0.5.1 → 0.5.2

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: caf0e17ddfe565a9883116d157cca1f3772fcc05
4
- data.tar.gz: 04a6413689175a43a349fb0efc2242a51d0d59b5
3
+ metadata.gz: 38cf3bacc20c417b5df8adfc3e4a7786944f0624
4
+ data.tar.gz: 5d7753ad9b621ae820fb742f8442cac9c9c4ad76
5
5
  SHA512:
6
- metadata.gz: 0fa4599a510f9551f78b69bedb27ff8ed2cc69f20dad700adc2b30719ab063d515578c21fabcfd482c13d0ea06c676224e825279639199f4e801f421a956e146
7
- data.tar.gz: 57ab67631c8553fefc7f7b454cf2b97f658aa95e73198d1f72785cefdd34da43804e381066f407e56c7cf34425bcb8fa9da9b4d30b3b743a62217b2047a03cb4
6
+ metadata.gz: 3b6812bfbcc46d549be723bb0f2cf1e76f879ed2943a689df40e14b284b9c6edaa98192d38b1d860a63651f394a1b83c1ca01bdd36f0b31adfde7f2e75d86b8f
7
+ data.tar.gz: 9af474a69894cf5a75e26234f07877a582b5041c2ac41130ac0595df813e99f4a17e74619f533030b4a52788f2af77e9294bd7f1823352e2e105880363574229
data/README.md CHANGED
@@ -334,11 +334,12 @@ command is controlled by an optional parameter.
334
334
  If the longer form, show is used, a space is required before the parameter. If
335
335
  the quick form, ! is used, the space is optional.
336
336
 
337
- Quick Form | Long Form | Command Description
337
+ Quick Form | Long Form | Command Description
338
338
  -----------|--------------|--------------------------------
339
339
  ! | history | Display the entire history buffer.
340
340
  !5 | history 5 | Retrieve history entry 5 and present this to the user as the next command.
341
341
  !clear | history clear| Clear the command history.
342
+ !pattern | history pattern | Display the part history buffer containing the specified regular expression pattern. Note: The pattern cannot be the word "clear", use "clea[r]" instead.
342
343
 
343
344
  ### Shell Variables
344
345
 
@@ -7,13 +7,17 @@ command is controlled by an optional parameter.
7
7
  If the longer form, show is used, a space is required before the parameter. If
8
8
  the quick form, ! is used, the space is optional.
9
9
 
10
- Quick Long Command
11
- Form Form Description
12
- ===== ======= ===========
13
- ! history Display the entire history buffer.
10
+ Quick Long Command
11
+ Form Form Description
12
+ ===== ======= ===========
13
+ ! history Display the entire history buffer.
14
14
 
15
- !5 history 5 Retrieve history entry 5 and present this to the user
16
- as the next command.
15
+ !index history index Retrieve history entry number index and present this
16
+ to the user as the next command.
17
17
 
18
- !clear history clear Clear the command history.
18
+ !clear history clear Clear the command history.
19
+
20
+ !pattern history pattern Display the part of the history buffer containing the
21
+ regex pattern. Note: This pattern cannot be 'clear'
22
+ so use 'clea[r]' instead.
19
23
 
@@ -46,18 +46,19 @@ module Mysh
46
46
 
47
47
  #Just show the history.
48
48
  def show_history
49
+ pattern = Regexp.new(@args[0] || /./)
50
+
49
51
  @history.each_with_index do |item, index|
50
- puts "#{index+1}: #{item}"
52
+ puts "#{index+1}: #{item}" if item =~ pattern
51
53
  end
52
54
  end
53
55
 
54
56
  end
55
57
 
56
58
  #Add the history commands to the library.
57
- desc = 'Display the mysh command history, or if an index is specified, ' +
58
- 'retrieve the command with that index value.'
59
- COMMANDS.add_action(HistoryCommand.new('history <index>', desc))
59
+ desc = 'Display the mysh command history. See ?! for more info.'
60
+ COMMANDS.add_action(HistoryCommand.new('history <arg>', desc))
60
61
  #The history command action object.
61
- HISTORY_COMMAND = HistoryCommand.new('!<index>', desc)
62
+ HISTORY_COMMAND = HistoryCommand.new('!<arg>', desc)
62
63
  COMMANDS.add_action(HISTORY_COMMAND)
63
64
  end
data/lib/mysh/version.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Mysh
4
4
  #The version string of MY SHell.
5
- VERSION = "0.5.1"
5
+ VERSION = "0.5.2"
6
6
 
7
7
  #A brief summary of this gem.
8
8
  SUMMARY = "mysh -- a Ruby inspired command line shell."
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Camilleri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-19 00:00:00.000000000 Z
11
+ date: 2017-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake