mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
remove default image in the example and rewrite usage
This commit is contained in:
parent
2e2e0c741e
commit
bfbb4f70c4
|
@ -16,8 +16,6 @@ add_executable(sandboxed
|
||||||
main_sandboxed.cc
|
main_sandboxed.cc
|
||||||
../sandboxed.h
|
../sandboxed.h
|
||||||
../test/data.h
|
../test/data.h
|
||||||
../test/helper.h
|
|
||||||
../test/helper.cc
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(sandboxed PRIVATE
|
target_link_libraries(sandboxed PRIVATE
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
#include "../sandboxed.h" // NOLINT(build/include)
|
#include "../sandboxed.h" // NOLINT(build/include)
|
||||||
#include "../test/data.h" // NOLINT(build/include)
|
#include "../test/data.h" // NOLINT(build/include)
|
||||||
#include "../test/helper.h" // NOLINT(build/include)
|
|
||||||
#include "absl/algorithm/container.h"
|
#include "absl/algorithm/container.h"
|
||||||
#include "absl/strings/str_join.h"
|
#include "absl/strings/str_join.h"
|
||||||
#include "sandboxed_api/sandbox2/util/fileops.h"
|
#include "sandboxed_api/sandbox2/util/fileops.h"
|
||||||
|
@ -250,16 +249,12 @@ absl::Status LibTIFFMain(const std::string& srcfile) {
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
gflags::ParseCommandLineFlags(&argc, &argv, true);
|
gflags::ParseCommandLineFlags(&argc, &argv, true);
|
||||||
|
|
||||||
std::string srcfile;
|
if (argc != 2) {
|
||||||
std::string srcfilerel = "quad-tile.jpg.tiff";
|
LOG(ERROR) << "usage: sandboxed input";
|
||||||
|
return EXIT_FAILURE;
|
||||||
if (argc < 2) {
|
|
||||||
srcfile = GetFilePath(srcfilerel);
|
|
||||||
} else {
|
|
||||||
srcfile = GetFilePath(argv[1], srcfilerel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
absl::Status status = LibTIFFMain(srcfile);
|
absl::Status status = LibTIFFMain(argv[1]);
|
||||||
if (!status.ok()) {
|
if (!status.ok()) {
|
||||||
LOG(ERROR) << "LibTIFFMain failed with error:\n"
|
LOG(ERROR) << "LibTIFFMain failed with error:\n"
|
||||||
<< status.ToString() << '\n';
|
<< status.ToString() << '\n';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user