implement VERSION and UNAME
This commit is contained in:
parent
717e04549e
commit
6e77c313b2
2 changed files with 15 additions and 2 deletions
|
@ -9,6 +9,21 @@ module Rpl
|
|||
def nop( stack, dictionary )
|
||||
[stack, dictionary]
|
||||
end
|
||||
|
||||
# show version
|
||||
def version( stack, dictionary )
|
||||
stack += Rpl::Interpreter.parse( Rpl::Lang.version.to_s )
|
||||
|
||||
[stack, dictionary]
|
||||
end
|
||||
|
||||
# show complete identification string
|
||||
def uname( stack, dictionary )
|
||||
stack += Rpl::Interpreter.parse( "\"Rpl Interpreter version #{Rpl::Lang.version}\"" )
|
||||
|
||||
[stack, dictionary]
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
2
repl.rb
2
repl.rb
|
@ -21,8 +21,6 @@ class RplRepl
|
|||
|
||||
pp Readline::HISTORY if input == 'history'
|
||||
|
||||
input = '"rpn.rb version 0.0"' if %w[version uname].include?( input )
|
||||
|
||||
# Remove blank lines from history
|
||||
Readline::HISTORY.pop if input.empty?
|
||||
|
||||
|
|
Loading…
Reference in a new issue