adding module list command#165
Conversation
|
Thanks for the PR! @matro and I talked a little bit about features like this last year (#101), so I'm glad to start looking at code. It would help me think about the requirements, if you could describe an example script that would consume this. Here are some of the questions that come up for me:
If there's an 80% use case that can be satisfied by a simple command or two, that'll probably make sense to add into peru. But if we find ourselves imagining a bunch of different flags and filters and things like that (to do things like "list all the (Another thought that's come up before, is that in use cases that involve a lot of automated editing of the Let me know some more of your thoughts. I'll go ahead and comment inline on implementation details in this PR too. |
| def do_list(params): | ||
| modules = params.scope.modules.values() | ||
| output = '' | ||
| delim = ' | ' if params.args['-z'] else "\n " |
There was a problem hiding this comment.
I think the convention with find and git is to use the null character \x00 as a delimiter in the machine-readable mode. That makes it at least a little less likely that one of the strings you're printing will accidentally contain the delimiter inside of it. (For example, if we were listing full targets like module_name|rule_name, the | in there would kind of conflict with the | delimiter we have here.)
|
For my needs, getting just the module names would easily pass the 80% mark. That'd get me a list to loop over and get atomic commits for each When we came back to this recently, @spasarok and I got feedback along the lines of "more info spat into the terminal is better". I'm kind of on the fence about it, but I'm kind of thinking it's a brain thing; folks used to Tugging on the And anything beyond that... I feel like taking a stance of "simmer down, |
|
Or, heck... maybe |
|
We've replaced this PR with #171 |
Hello! The ops guy at my company (@matro) is interested in using Peru to automate some build tasks. I was wondering if you'd be interested in integrating some sort of
peru module listcommand. The code here would list modules in either a human readable format or, if the -z flag is specified, in a format better suited for iteration. Let me know what you think! Thanks!