mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-20 04:58:32 +02:00
Allows to create entries from editor with specified date.
This commit is contained in:
parent
60ce0a03ea
commit
ed09d2309c
1 changed files with 6 additions and 4 deletions
10
jrnl/cli.py
10
jrnl/cli.py
|
@ -183,10 +183,12 @@ def run(manual_args=None):
|
|||
else:
|
||||
_exit_multiline_code = "press Ctrl+D"
|
||||
|
||||
if mode_compose and not args.text:
|
||||
partial_raw = " ".join(args.text).split(':')
|
||||
|
||||
if mode_compose and partial_raw[1].strip() == '':
|
||||
if not sys.stdin.isatty():
|
||||
# Piping data into jrnl
|
||||
raw = util.py23_read()
|
||||
raw = partial_raw + ': ' + util.py23_read()
|
||||
elif config['editor']:
|
||||
template = ""
|
||||
if config['template']:
|
||||
|
@ -195,10 +197,10 @@ def run(manual_args=None):
|
|||
except:
|
||||
util.prompt("[Could not read template at '']".format(config['template']))
|
||||
sys.exit(1)
|
||||
raw = util.get_text_from_editor(config, template)
|
||||
raw = partial_raw + ': ' + util.get_text_from_editor(config, template)
|
||||
else:
|
||||
try:
|
||||
raw = util.py23_read("[Compose Entry; " + _exit_multiline_code + " to finish writing]\n")
|
||||
raw = partial_raw + ': ' + util.py23_read("[Compose Entry; " + _exit_multiline_code + " to finish writing]\n")
|
||||
except KeyboardInterrupt:
|
||||
util.prompt("[Entry NOT saved to journal.]")
|
||||
sys.exit(0)
|
||||
|
|
Loading…
Add table
Reference in a new issue