Sha256: e04de5a5e1d6600e498bee90d44624e707c1b24ae4cf4c0a26f0e4a4c4dfc41d
Contents?: true
Size: 762 Bytes
Versions: 14
Compression:
Stored size: 762 Bytes
Contents
#!/bin/env ruby require "Getopt/Declare" shell_cmds = <<'EOCMDS'; Commands: [repeatable] echo [-n] <words:/.*/> ECHO WITHOUT NEWLINE { print words; print "\n" unless _PUNCT_['-n'] } [pvtype: chwho /u?g?a?/] [pvtype: chwhat /r?w?x?/] chmod [-R] <who:chwho>=<what:chwhat> <files>... CHANGE FILE PERMISSIONS { files.each { |i| print "chmod who=what #{i}\n" } } help SHOW THIS SUMMARY { self.usage() } exit EXIT SHELL { finish(1) } <error:/.*/> { print "Unknown command: error\n"; print "(Try the 'help' command?)\n"; } EOCMDS shell = Getopt::Declare.new(shell_cmds,['-BUILD']) # Pass a proc count = 1 pt = proc { print "#{count}> "; count += 1; return $stdin.readline } shell.parse(pt)
Version data entries
14 entries across 14 versions & 1 rubygems