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

allow for multi-line commands #25

Open
noonien opened this issue Nov 14, 2019 · 2 comments
Open

allow for multi-line commands #25

noonien opened this issue Nov 14, 2019 · 2 comments

Comments

@noonien
Copy link

noonien commented Nov 14, 2019

something of the sorts would be really helpful, and would help not require having to write too many build scripts, or have too long lines.

| mkdir -p build/src
| for f in src/*; do
|   echo  "| gcc -I../include/ -Wall -Werror -pedantic -std=gnu18 -c \"../$f\" -o \"${f%.c}.o\""
| done | tee build/.fac

Perhaps | would not work since it seems to not require a blank line between rules, and this might break old facfiles.

@droundy
Copy link
Owner

droundy commented Nov 14, 2019

Something like that could certainly work. It would not work so well for a portable build script, but since fac isn't very portable that isn't a steering argument against.

I agree that '|' can't be the continuation character for the reason you give. In fact your example would end up creating one rule that compiles all the files, since you didn't add blank spaces between the rules.

On the other hand, you can achieve the same outcome by using semicolons in your shell command, and then you would be able to copy and paste your rule into a shell to test it out...

@noonien
Copy link
Author

noonien commented Nov 14, 2019

Yes, I've currently resorted to using semicolons, but it makes reading the .fac harder, especially for more commands.

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

2 participants