MCPcopy
hub / github.com/pallets/click / edit

Function edit

examples/termui/termui.py:118–129  ·  view source on GitHub ↗

Opens an editor with some text in it.

()

Source from the content-addressed store, hash-verified

116
117@cli.command()
118def edit():
119 """Opens an editor with some text in it."""
120 MARKER = "# Everything below is ignored\n"
121 message = click.edit(f"\n\n{MARKER}")
122 if message is not None:
123 msg = message.split(MARKER, 1)[0].rstrip("\n")
124 if not msg:
125 click.echo("Empty message!")
126 else:
127 click.echo(f"Message:\n{msg}")
128 else:
129 click.echo("You did not enter anything!")
130
131
132@cli.command()

Callers

nothing calls this directly

Calls 1

editMethod · 0.80

Tested by

no test coverage detected