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

New usecase: Option to Run as a CLI program? #21

Open
MoralCode opened this issue Nov 20, 2023 · 1 comment
Open

New usecase: Option to Run as a CLI program? #21

MoralCode opened this issue Nov 20, 2023 · 1 comment

Comments

@MoralCode
Copy link

I've been following a google-written guide for how to evaluate a private codebase for open source release and it includes a step for reading through all the comments in the code. The article includes some oneliner scripts for extracting comments from other languages, but not one for javascript -

I think this codebase could be helpful if it had a way to use it via CLI, such as:

npm install --global extract-comments
extract-comments

and have it just print out every comment to the terminal, assuming the current directory is within a javascript project

@MoralCode
Copy link
Author

MoralCode commented Nov 20, 2023

it seems like a small modification to the command from the google blog seems to get most of the way there, so maybe this issue is unnecessary.

find . -type f | egrep '\.(c|cc|h|cpp|go|java|kt|m|mm|swift|js|ts|jsx|tsx)' | while read f; do echo "------------ $f ------------------"; sed -n -e '/\/\*.*\*\// {p; b}' -e '/\/\*/,/\*\//p' -e '/\/\//p' "$f"; done

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