summaryrefslogtreecommitdiff
path: root/tools/aapt2/cmd/Diff.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt2/cmd/Diff.cpp')
-rw-r--r--tools/aapt2/cmd/Diff.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/tools/aapt2/cmd/Diff.cpp b/tools/aapt2/cmd/Diff.cpp
index 12113ed8a48a..7875a2bb7a86 100644
--- a/tools/aapt2/cmd/Diff.cpp
+++ b/tools/aapt2/cmd/Diff.cpp
@@ -14,9 +14,10 @@
* limitations under the License.
*/
+#include "Diff.h"
+
#include "android-base/macros.h"
-#include "Flags.h"
#include "LoadedApk.h"
#include "ValueVisitor.h"
#include "process/IResourceTableConsumer.h"
@@ -64,6 +65,10 @@ class DiffContext : public IAaptContext {
return 0;
}
+ bool IsAutoNamespace() override {
+ return false;
+ }
+
private:
std::string empty_;
StdErrDiagnostics diagnostics_;
@@ -344,23 +349,18 @@ static void ZeroOutAppReferences(ResourceTable* table) {
VisitAllValuesInTable(table, &visitor);
}
-int Diff(const std::vector<StringPiece>& args) {
+int DiffCommand::Action(const std::vector<std::string>& args) {
DiffContext context;
- Flags flags;
- if (!flags.Parse("aapt2 diff", args, &std::cerr)) {
- return 1;
- }
-
- if (flags.GetArgs().size() != 2u) {
+ if (args.size() != 2u) {
std::cerr << "must have two apks as arguments.\n\n";
- flags.Usage("aapt2 diff", &std::cerr);
+ Usage(&std::cerr);
return 1;
}
IDiagnostics* diag = context.GetDiagnostics();
- std::unique_ptr<LoadedApk> apk_a = LoadedApk::LoadApkFromPath(flags.GetArgs()[0], diag);
- std::unique_ptr<LoadedApk> apk_b = LoadedApk::LoadApkFromPath(flags.GetArgs()[1], diag);
+ std::unique_ptr<LoadedApk> apk_a = LoadedApk::LoadApkFromPath(args[0], diag);
+ std::unique_ptr<LoadedApk> apk_b = LoadedApk::LoadApkFromPath(args[1], diag);
if (!apk_a || !apk_b) {
return 1;
}