Skip to content

Commit 98dd689

Browse files
committed
docs: clarify get_cli_string shell quoting behavior
1 parent 3f0e3e0 commit 98dd689

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/dotenv/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ def get_cli_string(
1616
value: Optional[str] = None,
1717
quote: Optional[str] = None,
1818
):
19-
"""Returns a string suitable for running as a shell script.
19+
"""Return a command string for invoking the dotenv CLI.
2020
21-
Useful for converting a arguments passed to a fabric task
22-
to be passed to a `local` or `run` command.
21+
This helper is intended for simple command construction and display. It does
22+
not shell-escape arbitrary input. If you pass the returned string to a shell,
23+
quote or validate any user-controlled values first. Prefer passing arguments as
24+
a list to subprocess APIs when possible.
2325
"""
2426
command = ["dotenv"]
2527
if quote:

0 commit comments

Comments
 (0)