thlorenz / deoptigate

⏱️ Investigates v8/Node.js function deoptimizations.
https://nodesource.github.io/deoptigate-examples/xml2js/01_start/?selectedFileIdx=31&selectedLocation=157&includeAllSeverities=false&highlightCode=true&selectedTabIdx=1&selectedSummaryTabIdx=1
MIT License
1.16k stars 22 forks source link

Select log file to open with --open/-o #7

Open OliverUv opened 6 years ago

OliverUv commented 6 years ago

deoptigate -o some_named_log_file.log now works, as well as --open.

It's nice to be able to name my log files whatever I want.

thlorenz commented 6 years ago

Thanks for the idea, but what's wrong with selecting the file from the list? I'd like to keep the tool as easy to use as possible and that also means having the least amount of flags if avoidable.

OliverUv commented 6 years ago

1) I have a file manager that lets me sort logs by date. I want to use its functionality to easily select the log file I want to open. I don't want to implement this functionality in files-provider as it's already solved well by another tool. (files-provider also appears to want to be a minimal lib, so I'm not feeling comfortable adding tons of new options to it. Nor do I want to spend the time doing so.)

2) I want to name my log files so I can easily do comparisons between versions when writing blog posts. /^(isolate-.+-)?v8.log$/ leaves some room for me to add my own metadata, I guess, but it's a bother.

I suppose in general I'm just used to programs allowing me to specify which file I want them to open, without having to use their non-standard UIs. Unix philosophy and whatnot.

thlorenz commented 6 years ago

OK, I get your point, let's add this in, but I'd like you to use minimist since more flags may be added in the future and parsing by hand is not the way to go.

See some example use inside docme. Don't worry about printing usage for now.