示例#1
0
 def do_shell(self, args):
     """Execute a shell command or start an interactive shell (Usage: ! [<command>])"""
     args = splitargs(args)
     if args:
         cmd = args[0]
         if cmd == 'ls':
             self.shell_ls(*args[1:])
         elif cmd == 'll':
             self.shell_ll(*args[1:])
         elif cmd == 'cd' or cmd == 'chdir':
             self.shell_chdir(*args[1:])
         elif cmd == 'umask':
             self.shell_umask(*args[1:])
         elif cmd == 'man':
             self.shell_man(*args[1:])
         else:
             self.system(*args)
     else:
         self.system(os.environ.get('SHELL'))
示例#2
0
 def default(self, args):
     """Unknown command"""
     args = splitargs(args)
     self.stderr.write("gpgkeys: unknown command '%s'\n" % args[0])
     self.rc = 1