__init__.py (js-beautify-1.13.13) | : | __init__.py (js-beautify-1.14.0) | ||
---|---|---|---|---|
skipping to change at line 214 | skipping to change at line 214 | |||
filepath_params.extend(args) | filepath_params.extend(args) | |||
outfile_param = "stdout" | outfile_param = "stdout" | |||
replace = False | replace = False | |||
for opt, arg in opts: | for opt, arg in opts: | |||
if opt in ("--file", "-f"): | if opt in ("--file", "-f"): | |||
filepath_params.append(arg) | filepath_params.append(arg) | |||
elif opt in ("--keep-array-indentation", "-k"): | elif opt in ("--keep-array-indentation", "-k"): | |||
js_options.keep_array_indentation = True | js_options.keep_array_indentation = True | |||
elif opt in ("--keep-function-indentation"): | elif opt in ("--keep-function-indentation",): | |||
js_options.keep_function_indentation = True | js_options.keep_function_indentation = True | |||
elif opt in ("--outfile", "-o"): | elif opt in ("--outfile", "-o"): | |||
outfile_param = arg | outfile_param = arg | |||
elif opt in ("--replace", "-r"): | elif opt in ("--replace", "-r"): | |||
replace = True | replace = True | |||
elif opt in ("--indent-size", "-s"): | elif opt in ("--indent-size", "-s"): | |||
js_options.indent_size = int(arg) | js_options.indent_size = int(arg) | |||
elif opt in ("--indent-char", "-c"): | elif opt in ("--indent-char", "-c"): | |||
js_options.indent_char = arg | js_options.indent_char = arg | |||
elif opt in ("--eol", "-e"): | elif opt in ("--eol", "-e"): | |||
skipping to change at line 240 | skipping to change at line 240 | |||
elif opt in ("--max-preserve-newlines", "-m"): | elif opt in ("--max-preserve-newlines", "-m"): | |||
js_options.max_preserve_newlines = int(arg) | js_options.max_preserve_newlines = int(arg) | |||
elif opt in ("--space-in-paren", "-P"): | elif opt in ("--space-in-paren", "-P"): | |||
js_options.space_in_paren = True | js_options.space_in_paren = True | |||
elif opt in ("--space-in-empty-paren", "-E"): | elif opt in ("--space-in-empty-paren", "-E"): | |||
js_options.space_in_empty_paren = True | js_options.space_in_empty_paren = True | |||
elif opt in ("--jslint-happy", "-j"): | elif opt in ("--jslint-happy", "-j"): | |||
js_options.jslint_happy = True | js_options.jslint_happy = True | |||
elif opt in ("--space-after-anon-function", "-a"): | elif opt in ("--space-after-anon-function", "-a"): | |||
js_options.space_after_anon_function = True | js_options.space_after_anon_function = True | |||
elif opt in ("--space-after-named-function"): | elif opt in ("--space-after-named-function",): | |||
js_options.space_after_named_function = True | js_options.space_after_named_function = True | |||
elif opt in ("--eval-code"): | elif opt in ("--eval-code",): | |||
js_options.eval_code = True | js_options.eval_code = True | |||
elif opt in ("--quiet"): | elif opt in ("--quiet",): | |||
js_options.keep_quiet = True | js_options.keep_quiet = True | |||
elif opt in ("--brace-style", "-b"): | elif opt in ("--brace-style", "-b"): | |||
js_options.brace_style = arg | js_options.brace_style = arg | |||
elif opt in ("--unescape-strings", "-x"): | elif opt in ("--unescape-strings", "-x"): | |||
js_options.unescape_strings = True | js_options.unescape_strings = True | |||
elif opt in ("--e4x", "-X"): | elif opt in ("--e4x", "-X"): | |||
js_options.e4x = True | js_options.e4x = True | |||
elif opt in ("--end-with-newline", "-n"): | elif opt in ("--end-with-newline", "-n"): | |||
js_options.end_with_newline = True | js_options.end_with_newline = True | |||
elif opt in ("--comma-first", "-C"): | elif opt in ("--comma-first", "-C"): | |||
js_options.comma_first = True | js_options.comma_first = True | |||
elif opt in ("--operator-position", "-O"): | elif opt in ("--operator-position", "-O"): | |||
js_options.operator_position = arg | js_options.operator_position = arg | |||
elif opt in ("--wrap-line-length ", "-w"): | elif opt in ("--wrap-line-length ", "-w"): | |||
js_options.wrap_line_length = int(arg) | js_options.wrap_line_length = int(arg) | |||
elif opt in ("--indent-empty-lines"): | elif opt in ("--indent-empty-lines",): | |||
js_options.indent_empty_lines = True | js_options.indent_empty_lines = True | |||
elif opt in ("--templating"): | elif opt in ("--templating",): | |||
js_options.templating = arg.split(",") | js_options.templating = arg.split(",") | |||
elif opt in ("--stdin", "-i"): | elif opt in ("--stdin", "-i"): | |||
# stdin is the default if no files are passed | # stdin is the default if no files are passed | |||
filepath_params = [] | filepath_params = [] | |||
elif opt in ("--editorconfig"): | elif opt in ("--editorconfig",): | |||
js_options.editorconfig = True | js_options.editorconfig = True | |||
elif opt in ("--version", "-v"): | elif opt in ("--version", "-v"): | |||
return print(__version__) | return print(__version__) | |||
elif opt in ("--help", "--usage", "-h"): | elif opt in ("--help", "--usage", "-h"): | |||
return usage() | return usage() | |||
try: | try: | |||
filepaths, replace = get_filepaths_from_params(filepath_params, replace) | filepaths, replace = get_filepaths_from_params(filepath_params, replace) | |||
for filepath in filepaths: | for filepath in filepaths: | |||
if not replace: | if not replace: | |||
End of changes. 7 change blocks. | ||||
7 lines changed or deleted | 7 lines changed or added |