mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-02 06:56:12 +02:00
Fix editor config when an argument with a space is used (#953)
* Fix editor config when an argument with a space is used * skip broken test on windows * fix jrnl not behaving nicely with testing suite * fix argument parsing for test suite * fix one windows test, disable one windows test
This commit is contained in:
parent
e6f828214b
commit
a4d020423f
5 changed files with 72 additions and 10 deletions
12
jrnl/cli.py
12
jrnl/cli.py
|
@ -194,11 +194,14 @@ def parse_args(args=None):
|
|||
help="Opens an interactive interface for deleting entries.",
|
||||
)
|
||||
|
||||
if not args:
|
||||
args = []
|
||||
|
||||
# Handle '-123' as a shortcut for '-n 123'
|
||||
num = re.compile(r"^-(\d+)$")
|
||||
if args is None:
|
||||
args = sys.argv[1:]
|
||||
return parser.parse_args([num.sub(r"-n \1", a) for a in args])
|
||||
args = [num.sub(r"-n \1", arg) for arg in args]
|
||||
|
||||
return parser.parse_args(args)
|
||||
|
||||
|
||||
def guess_mode(args, config):
|
||||
|
@ -300,6 +303,9 @@ def configure_logger(debug=False):
|
|||
|
||||
|
||||
def run(manual_args=None):
|
||||
if manual_args is None:
|
||||
manual_args = sys.argv[1:]
|
||||
|
||||
args = parse_args(manual_args)
|
||||
|
||||
configure_logger(args.debug)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue