diff options
Diffstat (limited to 'tools/qmlformat/main.cpp')
-rw-r--r-- | tools/qmlformat/main.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/tools/qmlformat/main.cpp b/tools/qmlformat/main.cpp index a021971710..a7e6c64bf3 100644 --- a/tools/qmlformat/main.cpp +++ b/tools/qmlformat/main.cpp @@ -44,7 +44,7 @@ #include "dumpastvisitor.h" #include "restructureastvisitor.h" -bool parseFile(const QString &filename, bool inplace, bool verbose, bool sortImports, bool force, +bool parseFile(const QString &filename, bool inplace, bool verbose, bool force, int indentWidth, bool tabs, const QString &newline) { QFile file(filename); @@ -91,11 +91,8 @@ bool parseFile(const QString &filename, bool inplace, bool verbose, bool sortImp qWarning().noquote() << orphaned << "comments are orphans."; } - if (verbose && sortImports) - qWarning().noquote() << "Sorting imports"; - // Do the actual restructuring - RestructureAstVisitor restructure(parser.rootNode(), sortImports); + RestructureAstVisitor restructure(parser.rootNode()); // Turn AST back into source code if (verbose) @@ -185,9 +182,6 @@ int main(int argc, char *argv[]) parser.addOption(QCommandLineOption({"V", "verbose"}, QStringLiteral("Verbose mode. Outputs more detailed information."))); - parser.addOption(QCommandLineOption({"n", "no-sort"}, - QStringLiteral("Do not sort imports."))); - parser.addOption(QCommandLineOption({"i", "inplace"}, QStringLiteral("Edit file in-place instead of outputting to stdout."))); @@ -248,7 +242,7 @@ int main(int argc, char *argv[]) if (file.isEmpty()) continue; - if (!parseFile(file, true, parser.isSet("verbose"), !parser.isSet("no-sort"), + if (!parseFile(file, true, parser.isSet("verbose"), parser.isSet("force"), indentWidth, parser.isSet("tabs"), parser.value("newline"))) success = false; @@ -256,7 +250,7 @@ int main(int argc, char *argv[]) } else { for (const QString &file : parser.positionalArguments()) { if (!parseFile(file, parser.isSet("inplace"), parser.isSet("verbose"), - !parser.isSet("no-sort"), parser.isSet("force"), indentWidth, + parser.isSet("force"), indentWidth, parser.isSet("tabs"), parser.value("newline"))) success = false; } |