mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-09 09:06:12 +02:00
Piping data into jrnl and multiline composing
This commit is contained in:
parent
e541b6bf3c
commit
e801c62cef
2 changed files with 10 additions and 3 deletions
|
@ -157,10 +157,13 @@ def cli(manual_args=None):
|
|||
journal = Journal.Journal(journal_name, **config)
|
||||
|
||||
if mode_compose and not args.text:
|
||||
if config['editor']:
|
||||
if not sys.stdin.isatty():
|
||||
# Piping data into jrnl
|
||||
raw = util.py23_read()
|
||||
elif config['editor']:
|
||||
raw = get_text_from_editor(config)
|
||||
else:
|
||||
raw = util.py23_input("[Compose Entry] ")
|
||||
raw = util.py23_read("[Compose Entry, press Ctrl+D to finish writing]\n")
|
||||
if raw:
|
||||
args.text = [raw]
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue