Skip to content

Commit

Permalink
feat(methods): adds command line options for remaining http verbs
Browse files Browse the repository at this point in the history
  • Loading branch information
nahime0 committed Dec 5, 2023
1 parent 5d255a9 commit 9438053
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,36 @@ public function handleArguments(array $arguments): array
$run->concurrently((int) str_replace('--concurrency=', '', $argument));
}

if ($argument === '--delete') {
$run->delete();
}

if ($argument === '--get') {
$run->get();
}

if ($argument === '--head') {
$run->head();
}

if (str_starts_with($argument, '--options=')) {
$run->options($this->extractPayload('options', $argument));
} elseif ($argument === '--options') {
$run->options();
}

if (str_starts_with($argument, '--patch=')) {
$run->patch($this->extractPayload('patch', $argument));
} elseif ($argument === '--patch') {
$run->patch();
}

if (str_starts_with($argument, '--put=')) {
$run->put($this->extractPayload('put', $argument));
} elseif ($argument === '--put') {
$run->put();
}

if (str_starts_with($argument, '--post=')) {
$run->post($this->extractPayload('post', $argument));
}
Expand Down

0 comments on commit 9438053

Please sign in to comment.