Last active
March 20, 2018 17:51
-
-
Save nick-brady/5faa6e360ad9cabf2087944b6814cdfa to your computer and use it in GitHub Desktop.
dumb script for writing the boilerplate javascript to log out the arguments in a function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python console.py arg1, arg2, arg3, arg4 | |
import sys | |
def cleanString(string): | |
if string[-1] == ',': | |
return string[:-1] | |
else: | |
return string | |
def eslintDisable(): | |
print('// eslint-disable-next-line') | |
cleaned_arguments = [cleanString(s) for s in sys.argv[1:]] | |
eslintDisable() | |
print('console.group(\'generated console group\');') | |
for argument in cleaned_arguments: | |
eslintDisable() | |
print('console.log(\'{}: \', {});'.format(argument, argument)) | |
eslintDisable() | |
print('console.groupEnd(\'end group\');') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment