Error when passing multiple tags to the short-url:create
console command
#2181
-
SummaryI think that in the option description for short-url tags, it should be indicated that multiple values are to be comma separated. "Tags to apply to the short URL (multiple values allowed)" would change to "Tags to apply to the short URL (multiple comma-separated values allowed)" Use caseIncreases accessibility, reduces confusion and likelihood of |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Can you be more specific on where do you see that description? |
Beta Was this translation helpful? Give feedback.
-
@acelaya running |
Beta Was this translation helpful? Give feedback.
-
And how did you run the command? Supposedly Supporting comma-separated tags (as in Does the approach above fail for you in any way? |
Beta Was this translation helpful? Give feedback.
-
By looking at the error again, I have the suspicion you did something like this: That's unfortunately never going to work, because spaces have a special meaning in the CLI. In this case, the command parser is interpreting every "word" which is not preceded by a flag as an individual argument. Since this command only expects one "free" argument (the long URL), it throws that error. In console commands, when a flag is an array that accepts multiple values, you need to prepend the flag identifier (or the shortcut, in this case |
Beta Was this translation helpful? Give feedback.
And how did you run the command? Supposedly
shlink short-url:create --tag foo --tag bar --tag baz
should work and add the three tags to the short URL.Supporting comma-separated tags (as in
--tag foo,bar,baz
) is there only for backwards compatibility, but it is not the expected approach.Does the approach above fail for you in any way?