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

Quiet, Other Language Recipes don't Quiet #601

Closed
plus7wist opened this issue Feb 28, 2020 · 4 comments
Closed

Quiet, Other Language Recipes don't Quiet #601

plus7wist opened this issue Feb 28, 2020 · 4 comments
Labels

Comments

@plus7wist
Copy link

When a recipe is written by other language. Quiet symbol @ seems to have a reverse meaning.

hello:
    #!/usr/bin/env python
    print('Hello')

@quiet_hello:
    #!/usr/bin/env python
    print('Hello')

just hello will not print recipe, but just quiet_hello will.

$ just hello
Hello
$ just quiet_hello
#!/usr/bin/env python
print('Hello')
Hello

I am using just v0.5.8. Is this a bug? I can't find any documents describe this feature.

@casey casey self-assigned this Feb 28, 2020
@casey casey added the bug label Feb 28, 2020
@casey
Copy link
Owner

casey commented Feb 29, 2020

Thanks for reporting this! This is definitely weird behavior, and I don't remember what I was thinking when I implemented it.

I'm not entirely sure what the right thing to do is. In linewise recipes, printing each line before executing it is useful because it shows you what just is doing as it does it. Printing shebang recipes doesn't seem useful, because the only option is printing the whole script before executing anything, which doesn't seem useful.

The current behavior does seem useful, although perhaps confusing. My hunch is that the right thing to do might just be to document the current behavior in the readme.

What do you think?

@dionjwa
Copy link

dionjwa commented Mar 4, 2020

I would reverse the current implementation, so the documentation doesn't need to be changed. No @ means print everything, with @ then be quiet. Yes, printing shebang recipes is not normally useful, but I would strongly argue to keep behaviour consistent so that documentation doesn't need unexpected edge cases specifically documented. Adding a @ to a shebang recipes is small price to pay for less mental complexity.

@casey
Copy link
Owner

casey commented Mar 5, 2020

I definitely agree with everything you've said. I do however think it's unfortunate to make basically every shebang recipe use a @. I, personally, have never needed to print out the text of a shebang recipe. Another factor is that switching the behavior of @ for shebang recipes would be a breaking change. (Well, it wouldn't really break anything, but it would change the behavior of current justfiles.)

I'm going to document the current behavior in the readme, and then open an issue for feedback on whether people would like the behavior switched.

@casey casey removed their assignment Mar 6, 2020
@casey
Copy link
Owner

casey commented Mar 6, 2020

I just landed #602, which documents the current behavior, and opened #603, for discussion of changing the current behavior to be more consistent.

@casey casey closed this as completed Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants