Custom CLI

I have to create an interface to allow several users to perform various
tasks over ssh. The users will have different permissions.

I want to create a custom shell/CLI to be set as the users shell when
they
log in. The interface should have scroll back, command line editing and
history like a normal shell. The commands would be custom commands, i.e.
no relation to system commands.
Is there any library, framework or something to make this easy with
ruby?

readline is part of the stdlib. It’s not documented in rdoc, but
more or less trivial to use once you’ve looked at the examples in the
distribution.
-Tim

On Wed, 14 Mar 2007, Jesper Andersen wrote:

I have to create an interface to allow several users to perform various
tasks over ssh. The users will have different permissions.

I want to create a custom shell/CLI to be set as the users shell when they
log in. The interface should have scroll back, command line editing and
history like a normal shell. The commands would be custom commands, i.e.
no relation to system commands.
Is there any library, framework or something to make this easy with ruby?

i would customize irb. for example

harp:~ > cat a.rb
def ls g = ‘*’
Dir.glob(g){|entry| puts entry}
end

def cd d = File.expand_path(’~’)
Dir.chdir d
end

irb:~ > irb -r ./a.rb
irb(main):001:0> ls ‘skype*’
skype-1.2.0.18
skype-1.3.0.53
skype_staticQT-1.3.0.53-generic.tar.bz2
=> nil

irb(main):002:0> cd ‘/tmp’
=> 0

others have done this extensively - check out the raa

cheers

-a

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs