portray icon indicating copy to clipboard operation
portray copied to clipboard

portray should provide a way to run specific commands in the authorized environment

Open radix opened this issue 6 years ago • 2 comments

Right now it's difficult to write scripts that make use of portray, because it strictly opens a shell and doesn't parameterize any command to run.

I propose the following syntax:

portray auth [flags] [--] [command] [args…]

and

portray switch [flags] [--] [command] [args…]

This would cause portray to run the given command with the given list of args instead of invoking $SHELL.

(I hope I'm not missing an existing way to do this...)

radix avatar Sep 14 '18 03:09 radix

I think this would be great to have, though I have no time to implement it. I've also found myself wanting to use portray in scripts. We'd need to put some thought into how auth and switch interact with each other, since auth is designed to be more interactive.

Definitely something I'd like to have, so I'm willing to review any PRs!

timoguin avatar Sep 14 '18 22:09 timoguin

Just FYI, my use cases are for "interactive scripting" anyway -- i.e. convenience scripts that humans would run to do complex sequences of commands across multiple roles/accounts, so prompting is still okay.

radix avatar Sep 17 '18 15:09 radix