radare2-r2pipe icon indicating copy to clipboard operation
radare2-r2pipe copied to clipboard

handle arguments when passed with filename

Open cryptid11 opened this issue 5 years ago • 10 comments

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

cryptid11 avatar Jan 14 '19 17:01 cryptid11

will be good to document this in the pydoc and add a example script. @a1ext what do you think about this pr?

radare avatar Jan 14 '19 20:01 radare

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.

a1ext avatar Jan 14 '19 20:01 a1ext

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

cryptid11 avatar Jan 14 '19 21:01 cryptid11

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.

radare avatar Jan 15 '19 09:01 radare

what about checking if file is an array and handle r2pipe.open(['ls', '-l', '/'], ['-d']) or so?

good idea

a1ext avatar Jan 15 '19 09:01 a1ext

can you update the PR? do you agree with the change?

radare avatar Apr 15 '19 22:04 radare

@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?

a1ext avatar Apr 16 '19 07:04 a1ext

honestly I forget this stuff, but if you tell me what to change in what I will do that surely

cryptid11 avatar Apr 18 '19 12:04 cryptid11

The idea is to also handle the case where the function receives an array insteaad of a string

radare avatar Jun 23 '19 01:06 radare

please resolve conflicts

trufae avatar Jun 03 '22 11:06 trufae