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

Support spaces in filenames #287

Closed
youhavethewrong opened this issue Oct 11, 2021 · 6 comments · Fixed by #288
Closed

Support spaces in filenames #287

youhavethewrong opened this issue Oct 11, 2021 · 6 comments · Fixed by #288
Labels
enhancement New feature or request
Milestone

Comments

@youhavethewrong
Copy link
Contributor

It would be nice to be able to have spaces in filenames, for example:

POST http://localhost:8000
Content-type: text/plain
file, ../../Text file test.txt;

This currently produces a parse error:

error: Parsing literal
  --> example.hurl:3:18
   |
 3 | file, ../../Text file test.txt;
   |                  ^ expecting ';'
   |

@youhavethewrong
Copy link
Contributor Author

I've opened PR #288 to support this behavior.

@fabricereix
Copy link
Collaborator

It's a good idea to support space in filename.
But I think that they should be escaped as in the terminal, because they are not enclosed within quotes.

$ ls space\ in\ filename.txt 
'space in filename.txt'

You example would become:

POST http://localhost:8000
Content-type: text/plain
file, ../../Text\ file\ test.txt;

@youhavethewrong
Copy link
Contributor Author

I see your point, but doesn't the semi-colon function as the end-of-filename delimiter, rendering the backslashes unnecessary?

@fabricereix
Copy link
Collaborator

There is also the whitespace issue.
Whitespace can be added/removed without changing the content.

the following lines all use the same file 'myfile':

file, myfile;  # leading space (recommended)
file, myfile ; # unnecessay trailing space
file,myfile;   # missing leading space

@lepapareil lepapareil added this to the 1.4 milestone Oct 12, 2021
@lepapareil lepapareil removed the 1.4.0 label Oct 12, 2021
@youhavethewrong
Copy link
Contributor Author

I'm happy to update my PR with additional capabilities. If I add the ability to escape spaces via backslash (\) should I allow any character to be escaped, similarly to shell?

@fabricereix
Copy link
Collaborator

Yes, you can update your PR.
We can first focus on the space, and deals with other escaping later on, with a different Issue/PR.

@jcamiel jcamiel added the enhancement New feature or request label Oct 14, 2021
@fabricereix fabricereix linked a pull request Oct 17, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants