radare2-r2pipe
radare2-r2pipe copied to clipboard
handle arguments when passed with filename
so if I do "filename arg1 arg2" it works as expected, this doesn't manage to work when there are spaces in filenames, but this is good since spaces in filenames are really bad practice XD
will be good to document this in the pydoc and add a example script. @a1ext what do you think about this pr?
will be good to document this in the pydoc and add a example script. @a1ext what do you think about this pr?
Agree with you. @cryptid11 do you think it is good to just check for a whitespace?
P.S. @radare, can you set up dummy appveyor/travisci for this repo? I'm planning to add some tests.
in theory should be, except file with whitespace in name, right? anyway that was really useful for me, obviously if this create damage more than good should not be included.
anyway integrate that with other checks if you feel, probably the code can also be cleaner, or other shapes you prefer (i prefer one line for example like cmd = cmd[:1] + flags + cmd[1:-1] + [cmd[-1].split(' ')[0]] + ['-Rarg'+str(x+1)+'='+arg for x,arg in enumerate(filename.split(' ')[1:])]
), etc
what about checking if file is an array and handle r2pipe.open(['ls', '-l', '/'], ['-d']) or so?
On 14 Jan 2019, at 22:02, cryptid11 [email protected] wrote:
in theory should be, except file with whitespace in name, right? anyway that was really useful for me, obviously if this create damage more than good should not be included.
anyway integrate that with other checks if you feel, probably the code can also be cleaner, or other shapes you prefer (i prefer one line for example like cmd = cmd[:1] + flags + cmd[1:-1] + [cmd[-1].split(' ')[0]] + ['-Rarg'+str(x+1)+'='+arg for x,arg in enumerate(filename.split(' ')[1:])]), etc
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/radare/radare2-r2pipe/pull/91#issuecomment-454160317, or mute the thread https://github.com/notifications/unsubscribe-auth/AA3-lmb5azygwf53PfMIXsUNsSxtSeIBks5vDPB5gaJpZM4Z_LVg.
what about checking if file is an array and handle r2pipe.open(['ls', '-l', '/'], ['-d']) or so?
good idea
can you update the PR? do you agree with the change?
@cryptid11 Could you adjust the code as @radare proposed:
what about checking if file is an array and handle r2pipe.open(['ls', '-l', '/'], ['-d']) or so?
honestly I forget this stuff, but if you tell me what to change in what I will do that surely
The idea is to also handle the case where the function receives an array insteaad of a string
please resolve conflicts