Pass 'unknown' args to the backend EDITOR #2
Reference in New Issue
Block a user
Delete Branch "mig/pass-extra-args-to-editor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #1
I found a nice way. argparse's
parse_known_argscreates a separate tuple for unrecognised args. We can then leverage this to pass them to the backend EDITOR (on the assumption that any unknown args might be known by the backend EDITOR tool).To test: run this version with
EDITOR=vim mirro somefile +3and check that it jumps to line 3 of the filesomefile.Thank you for your PR 😄
Unfortunatelly this will only work when
+3is expected aftersomefile(e.g. using Vim).It won't work for Nano as the expected command should be
EDITOR=nano mirro +3 somefileI'm closing this PR.
Pull request closed