Skip to content

Commit

Permalink
Improve handling options in Python beautifier.
Browse files Browse the repository at this point in the history
See #35.
  • Loading branch information
Glavin001 committed Dec 28, 2014
1 parent b7a34b6 commit 974897b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/langs/python-beautify.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ getCmd = (inputPath, outputPath, options) ->
path = options.autopep8_path # jshint ignore: line
# jshint ignore: line
# jshint ignore: line
optionsStr = "--max-line-length " + options.max_line_length + " --indent-size " + options.indent_size + " --ignore " + options.ignore.join(",") # jshint ignore: line
optionsStr = ""
if options.max_line_length?
optionsStr += "--max-line-length #{options.max_line_length}"
if options.indent_size?
optionsStr += " --indent-size #{options.indent_size}"
if options.ignore?
optionsStr += " --ignore " + options.ignore.join(",") # jshint ignore: line
if path
# Use absolute path
"#{path} \"#{inputPath}\" #{optionsStr}"
else
# Use command available in $PATH
"autopep8 \"" + inputPath + "\" " + optionsStr
"autopep8 \"#{inputPath}\" #{optionsStr}"
"use strict"
cliBeautify = require("./cli-beautify")
isStdout = true
Expand Down

0 comments on commit 974897b

Please sign in to comment.