@cli.command()
def edit():
 MARKER = '# Everything below is ignored\n'
 message = click.edit(('\n\n' + MARKER))
 if (message is not None):
  msg = message.split(MARKER, 1)[0].rstrip('\n')
  if (not msg):
   click.echo('Empty message!')
  else:
   click.echo(('Message:\n' + msg))
 else:
  click.echo('You did not enter anything!')

@ cli . command ( ) def edit ( ) : MARKER = '# Everything below is ignored\n' message = click . edit ( ( '\n\n' + MARKER ) ) if ( message is not None ) : msg = message . split ( MARKER , 1 ) [ 0 ] . rstrip ( '\n' ) if ( not msg ) : click . echo ( 'Empty message!' ) else : click . echo ( ( 'Message:\n' + msg ) ) else : click . echo ( 'You did not enter anything!' )
open filename in a text editor .