vprof
vprof copied to clipboard
Invalid handling of multi-word script argument
Description
I'm trying to run the vprof profiler on a script that accepts cmdline arguments. I want to use it on the following command:
./tw_gcal_sync --gcal-calendar 'TW Reminders' --taskwarrior-tag 'remindme'
When I run that command on its own it works fine, but when I prepend vprof
as in the following case my script complains about invalid extra arguments. Here's the complete output
~/taskw_gcal_sync$ vprof -c cmh "./tw_gcal_sync --gcal-calendar 'TW Reminders' --taskwarrior-tag 'remindme'"
Running MemoryProfiler...
Usage: tw_gcal_sync [OPTIONS]
Try "tw_gcal_sync --help" for help.
Error: Got unexpected extra argument (Reminders')
Running FlameGraphProfiler...
Usage: tw_gcal_sync [OPTIONS]
Try "tw_gcal_sync --help" for help.
Error: Got unexpected extra argument (Reminders')
Running CodeHeatmapProfiler...
Usage: tw_gcal_sync [OPTIONS]
Try "tw_gcal_sync --help" for help.
Error: Got unexpected extra argument (Reminders')
How to reproduce
I think it's down to wrong management of multi-word arguments of the script under profiling.
If I run the same command and substitute TW Reminders
with just TW
it works fine.
Just run vprof with a script that accepts multi-word arguments. It will split them into separate arguments
Version and platform
Installed via pip - 0.37.6