Fail behaviour of klog switch
/ klog start
#287
jotaen
started this conversation in
Feature ideas & discussions
Replies: 1 comment
-
Voting +1 for having a "--force" flag added to the switch command. :) Having such a command would be convenient in my use case, because I call klog via iOS shortcuts "Run script over ssh". |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a spin-off discussion of #285.
klog switch
currently fails if there is no open range in the record. It could be argued, thatklog switch
could just fall back to behaving likeklog start
if there is no open range in the record, mostly for convenience.A similar point could be made about
klog start
, which currently fails if there is already an open range in the record. But one could say thatklog start
could behave likeklog switch
in this case, again for convenience.Back then, I’ve deliberately made it fail, because I was thinking the inconvenience of it failing explicitly would be better than having some potentially unexpected, implicit default behaviour that may lead to wrong data. Also, because if both commands would automatically fall back to behaving like the other respective command, then why would there be two separate commands to begin with?
One potential approach could be to leave the current behaviour as is, but add some sort of
--force
option. I’d only find that sensible forklog switch
, though. It also may be useful to print a warning if the precondition isn’t met.Beta Was this translation helpful? Give feedback.
All reactions