Beispiel #1
0
 def command(self, value):
     if hasattr(value, '__iter__'):
         it = iter(value)
         cmd = EscapedString.disallow(it.next())
         args_str = ' '.join(self.escape_string(x) for x in it)
         value = "%s %s" % (cmd, args_str)
     else:
         value = EscapedString.disallow(value)
     self._addline(value)
Beispiel #2
0
 def command(self, value):
     if hasattr(value, '__iter__'):
         it = iter(value)
         cmd = EscapedString.disallow(it.next())
         args_str = ' '.join(self.escape_string(x) for x in it)
         value = "%s %s" % (cmd, args_str)
     else:
         value = EscapedString.disallow(value)
     self._addline(value)
Beispiel #3
0
 def command(self, value):
     if is_non_string_iterable(value):
         it = iter(value)
         cmd = EscapedString.disallow(next(it))
         args_str = ' '.join(self.escape_string(x) for x in it)
         value = "%s %s" % (cmd, args_str)
     else:
         value = EscapedString.disallow(value)
     self._addline(value)
Beispiel #4
0
Datei: csh.py Projekt: rvsiy/rez
 def alias(self, key, value):
     value = EscapedString.disallow(value)
     self._addline("alias %s '%s';" % (key, value))
Beispiel #5
0
 def alias(self, key, value):
     value = EscapedString.disallow(value)
     cmd = "function {key}() {{ {value} $args }}"
     self._addline(cmd.format(key=key, value=value))
Beispiel #6
0
 def alias(self, key, value):
     value = EscapedString.disallow(value)
     # TODO: Find a way to properly escape paths in alias() calls that also
     # contain args
     cmd = "function {key}() {{ {value} $args }}"
     self._addline(cmd.format(key=key, value=value))
Beispiel #7
0
 def alias(self, key, value):
     value = EscapedString.disallow(value)
     cmd = 'function {key}() {{ {value} "$@"; }};export -f {key};'
     self._addline(cmd.format(key=key, value=value))
Beispiel #8
0
 def alias(self, key, value):
     value = EscapedString.disallow(value)
     cmd = 'function {key}() {{ {value} "$@"; }};export -f {key};'
     self._addline(cmd.format(key=key, value=value))
 def alias(self, key, value):
     value = EscapedString.disallow(value)
     self._addline("alias %s '%s';" % (key, value))