-
-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify shell assignment #4451
base: dev
Are you sure you want to change the base?
Unify shell assignment #4451
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[0x000061d0]> e log.file=/dev/null log.level=5 [0x000061d0]> e log.file /dev/null log.level=5
This is bad and generally Rizin shouldn't react like this.
i think this is the correct behavior, but also that should have failed (because it is not a valid file). that said, also |
This is the same as what
Since the prior version didn't allow for whitespace in the values it should be possible to check for whitespace after the value is trimmed and either warn or error if there is any. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @kazarmy FLAG_LAST was added just to support cases like this and it is widely used automatically in many cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ret2libc I was complaining more about the possibly bad user experience ... I do understand that both the old and new ways can be implemented (if there is a good reason) and I do not actually have strong feelings either way (meh maybe later) ... though I do have a preference for less keystrokes if possible
2ef818b
to
6019fe0
Compare
@kazarmy I see your point, I think there is a better solution here. Since changing
Either way all the commands would be using equals with no spaces at that point. Let me know if its preferred to switch to this version and I'll go ahead and make this to a draft. |
Your checklist for this pull request
Detailed description
This change is in response to (#2129) and changes the behavior of the the
e
andaezv
commands to match the existing assignment behavior of thear
&dr
commands.The changes related to
e
:e k=v k=v ...
allowing multiple assignments and no spaces around the '=' character.e k = v
ore k=v
.e
command description updated to new help message and arguments.e
command handler updated to new argument format.e
's help message to reflect the new output.The changes to
aezv
:aezv k v
with two args for assignment, and no '=' character.aezv k = v
oraezv k=v
, and functionality ofaezv k
is preserved.aezv
command description updated to new help message and arguments.aezv
command handler updated to new argument format.aezv
for assignment to have the '=' character.The rational for selecting the
ar
/dr
assignment form over thee
form (as discussed in #2129) is that multiple assignments of config variables can still be accomplished in a single line viae k=v; e k=v
as well as the alias and macro features. In addition, theaezv
,ar
, anddr
commands support other operations than just assignment so something likear rax=0x1 xmm PC
could be valid, but is not as intuitive. Finally, allowing spaces around the '=' makes the shell a bit less picky.This PR does not address the assignment used by
$
to assign aliases. To do so would require additional clarification as$
also supports:=
,-=
and+=
for various features....
Test plan
Testing involves ensuring correct functionality of the
e
andaezv
commands....
Closing issues
Partially closes #2129
...