MCPcopy Index your code
hub / github.com/python/cpython / join_command

Function join_command

Platforms/Apple/__main__.py:121–130  ·  view source on GitHub ↗

Format a command so it can be copied into a shell. Similar to `shlex.join`, but also accepts arguments which are Paths, or a single string/Path outside of a list.

(args: str | Path | ArgsT)

Source from the content-addressed store, hash-verified

119
120
121def join_command(args: str | Path | ArgsT) -> str:
122 """Format a command so it can be copied into a shell.
123
124 Similar to `shlex.join`, but also accepts arguments which are Paths, or a
125 single string/Path outside of a list.
126 """
127 if isinstance(args, (str, Path)):
128 return str(args)
129 else:
130 return shlex.join(map(str, args))
131
132
133def print_env(env: EnvironmentT) -> None:

Callers 2

runFunction · 0.70

Calls 2

strFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…