MCPcopy Index your code
hub / github.com/aws/aws-cli / compat_shell_quote

Function compat_shell_quote

awscli/compat.py:275–289  ·  view source on GitHub ↗

Return a shell-escaped version of the string *s* Unfortunately `shlex.quote` doesn't support Windows, so this method provides that functionality.

(s, platform=None, shell=False)

Source from the content-addressed store, hash-verified

273
274
275def compat_shell_quote(s, platform=None, shell=False):
276 """Return a shell-escaped version of the string *s*
277
278 Unfortunately `shlex.quote` doesn't support Windows, so this method
279 provides that functionality.
280 """
281 if platform is None:
282 platform = sys.platform
283
284 if platform == "win32":
285 if shell:
286 return _windows_cmd_shell_quote(s)
287 return _windows_argv_quote(s)
288 else:
289 return shlex.quote(s)
290
291
292def _windows_argv_quote(s):

Callers 6

__call__Method · 0.90
_sshMethod · 0.90

Calls 2

_windows_cmd_shell_quoteFunction · 0.85
_windows_argv_quoteFunction · 0.85