flamegraph icon indicating copy to clipboard operation
flamegraph copied to clipboard

Fix examples for arbitrary process

Open Niederb opened this issue 3 years ago • 4 comments

The examples for arbitrary processes seems wrong. At least I had to change them to make them work.

Niederb avatar Jun 03 '22 18:06 Niederb

Hmm, that's a little surprising, I guess this might be a regression from migrating to clap? Would you be able to check if this can fixed with our declarative clap setup instead?

djc avatar Jun 06 '22 09:06 djc

I just had a quick look at the clap documentation and this is documented behavior. trailing_arguments is marked as last=true:

    #[clap(last = true)]
    trailing_arguments: Vec<String>

And from the clap-doc (https://docs.rs/clap/3.1.18/clap/struct.Arg.html#method.last)

This arg is the last, or final, positional argument (i.e. has the highest index) and is only able to be accessed via the -- syntax

I don't know if there would be another way to get it working without --.

Niederb avatar Jun 06 '22 20:06 Niederb

So could we leave off the last = true?

djc avatar Jun 08 '22 07:06 djc

https://github.com/flamegraph-rs/flamegraph/pull/218/files

It looks like one of these changes already made it into main, so only the latter is relevant.

lukehsiao avatar Jan 19 '23 16:01 lukehsiao