Make the em dash (—) also work when using options (#160)
Some devices (such as iPhones) automatically change it to `—` when you type `--`. To get it to stay as `--` you have to type something like `-f-` and then delete the f, which can be annoying. Some people probably don't realize this problem and wonder why it didn't work. Allowing both should make for a better user experience.
This commit is contained in:
parent
59e63065f1
commit
7f8eb04a2e
1 changed files with 3 additions and 3 deletions
|
@ -5,9 +5,9 @@ export default (input) => {
|
|||
let concated = "";
|
||||
for (let i = 0; i < input.length; i++) {
|
||||
const a = input[i];
|
||||
if (a.startsWith("--") && !curr) {
|
||||
if ((a.startsWith("--") || a.startsWith("—")) && !curr) {
|
||||
if (a.includes("=")) {
|
||||
const [arg, value] = a.slice(2).split("=");
|
||||
const [arg, value] = (a.startsWith("--") ? a.slice(2).split("=") : a.slice(1).split("="));
|
||||
let ended = true;
|
||||
if (arg !== "_") {
|
||||
if (value.startsWith("\"")) {
|
||||
|
@ -109,4 +109,4 @@ export default (input) => {
|
|||
// }
|
||||
// })
|
||||
// return results;
|
||||
// }
|
||||
// }
|
||||
|
|
Loading…
Reference in a new issue