ManageIQ / ManageIQ/awesome_spawn

[RFE] Disallow spaces in the command parameter

Open
#59 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
Ruby
Stars
9
Forks
14
PR merge metrics
No merged PRs in 30d

Description

This would enforce the usage of the :params when needed, and a user would not be able to bypass it. If they are going to bypass anyway, then there is no point in using AwesomeSpawn.

The only use case we might have to account for is sudo. I say might, because one case easily do

AwesomeSpawn.run!("sudo", :params => ["echo", "hi")

But that is kind of weird. I think I'd prefer another param:

AwesomeSpawn.run!("echo", :params => "hi", :sudo => true)
AwesomeSpawn.run!("echo", :params => "hi", :sudo => "someuser")

Which would be nice because a caller could build the options and call it, then on failure just tack in another option (instead of having to re-call AwesomeSpawn and reorder all of the params.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the AwesomeSpawn.run! entry point and trace how its command and params arguments are handled. Clarify whether the requested change is only rejecting spaces in the command or also adding sudo support, then define tests for the accepted and rejected forms before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.