Changeset 5507

Show
Ignore:
Timestamp:
05/17/08 01:27:03 (5 months ago)
Author:
egypt
Message:

"set foo" prints the value of foo if it exists; really, that's it this time

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • framework3/trunk/lib/msf/ui/console/command_dispatcher/core.rb

    r5506 r5507  
    802802                                        datastore) + "\n") 
    803803                        return true 
    804                 elsif (args.length < 2) 
    805                         print( 
    806                                 "Usage: set name value\n\n" + 
    807                                 "Sets an arbitrary name to an arbitrary value.\n") 
    808                         return false 
     804                elsif (args.length == 1) 
     805                        if (not datastore[args[0]].nil?) 
     806                                print_line("#{args[0]} => #{datastore[args[0]]}") 
     807                                return true 
     808                        else 
     809                                print_error("Unknown variable") 
     810                                print( 
     811                                        "Usage: set name value\n\n" + 
     812                                        "Sets an arbitrary name to an arbitrary value.\n") 
     813                                return false 
     814                        end 
    809815                end 
    810816