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

Response file not working from powershell terminal #19

Open
davidpfister opened this issue Apr 9, 2024 · 4 comments
Open

Response file not working from powershell terminal #19

davidpfister opened this issue Apr 9, 2024 · 4 comments

Comments

@davidpfister
Copy link

I was experimenting response file for fpm and running command like fpm @build from a powershell terminal on Windows.
The issue is that @ has a special meaning in powershell and the command cannot be interpreted. It only returns the help for fpm

Fortran Package Manager:
 
USAGE: fpm [ SUBCOMMAND [SUBCOMMAND_OPTIONS] ]|[--list|--help|--version]
       where SUBCOMMAND is commonly new|build|run|test

 subcommand may be one of

  build     Compile the package placing results in the "build" directory
  help      Display help
  list      Display this list of subcommand descriptions
  new       Create a new Fortran package directory with sample files    
  run       Run the local package application programs
  test      Run the test programs
  update    Update and manage project dependencies
...

Workaround

sections in the rsp containing hyphens are perfectly fine, so I can run fpm @gfortran-build.
Or, I can also use the classical cmd prompt.

There is probably not much to do here, but I thought I report the issue for the record in case someone faces the same problem.

@lockstockandbarrel
Copy link

I do not use MSWindows/powershell at all; and could not find a simple table of what characters are special in powershell. It would
be easy to make some other character such as up-caret ^ or comma as an alternate for @, but I do not know if those characters are special in a powershell script. Perhaps two @ characters might work if I changed it to treat multiple @ characters as a single @?

So if the @ is single-quoted or preceded by a backslash does it work?

@davidpfister
Copy link
Author

The problem with @ is splatting. And a lot of other special characters are used in powershell.

@urbanjost
Copy link
Owner

urbanjost commented Jun 18, 2024 via email

@davidpfister
Copy link
Author

Powershell uses so many special characters that Microsoft probably did not bother editing an exclusion list 😄.
From the top of my head, in PS the characters @, &, $, ., ..., !, ?, `, # all have a special meaning.
I found this link to be quite useful.
Just a thought here, but why not letting the developer specify its desired symbol? That could be a cla like --rsp-symbol=@ (default), or directly in the rsp file symbol @.

  • PS: indeed @ is so common that Microsoft also uses it for response files processed by msbuild
  • PS2: double-quoting the command would work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants