Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle option like value as option #61

Merged
merged 1 commit into from
Jun 3, 2021
Merged

Handle option like value as option #61

merged 1 commit into from
Jun 3, 2021

Conversation

yykamei
Copy link
Owner

@yykamei yykamei commented Jun 3, 2021

From this patch, thwack handles an option like value as option.

For example, these arguments are invalid:

thwack --exec --help                # Error
thwack --exec --version             # Error
thwack --starting-point --exec=open # Error

However, an option suffixed with = still accepts the value as is.

thwack --exec=--help                          # OK
thwack --starting-point=--special-directory-- # OK

In addition, this patch introduces -- (double hyphens) to assume the
rest arguments as query. If more than one rest arguments are remained,
these arguments are just joined by a whitespace.

From this patch, thwack handles an option like value as **option**.

For example, these arguments are invalid:

```console
thwack --exec --help                # Error
thwack --exec --version             # Error
thwack --starting-point --exec=open # Error
```

However, an option suffixed with `=` still accepts the value as is.

```console
thwack --exec=--help                          # OK
thwack --starting-point=--special-directory-- # OK
```

In addition, this patch introduces `--` (double hyphens) to assume the
rest arguments as `query`. If more than one rest arguments are remained,
these arguments are just joined by a whitespace.
@yykamei yykamei added the bug Something isn't working label Jun 3, 2021
@yykamei yykamei enabled auto-merge (squash) June 3, 2021 13:22
@yykamei yykamei merged commit 65e53cb into main Jun 3, 2021
@yykamei yykamei deleted the option-like-value branch June 3, 2021 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant