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 reading from stdin and writing to stdout. #64

Open
SanjayVas opened this issue Mar 19, 2021 · 1 comment
Open

Allow for reading from stdin and writing to stdout. #64

SanjayVas opened this issue Mar 19, 2021 · 1 comment

Comments

@SanjayVas
Copy link

addlicense currently always modifies source files in-place. This makes it difficult to use in scripts or integrate into other formatting tools, such as the fix Mercurial extension.

Since the filename is unknown when operating on content from stdin, this would entail adding an option to specify the filename to assume. For example, clang-format has an --assume-filename option for this purpose.

@SanjayVas
Copy link
Author

A workaround is to create a wrapper script that reads from stdin and writes to a temporary file with a specified basename. After addlicense modifies this file in place, the script can print it to stdout.

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

1 participant