aboutsummaryrefslogtreecommitdiff
path: root/src/bin/fstprint.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/fstprint.cc')
-rw-r--r--src/bin/fstprint.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/bin/fstprint.cc b/src/bin/fstprint.cc
index b42bb7e..b5b23e5 100644
--- a/src/bin/fstprint.cc
+++ b/src/bin/fstprint.cc
@@ -44,7 +44,7 @@ int main(int argc, char **argv) {
usage += " [binary.fst [text.fst]]\n";
std::set_new_handler(FailedNewHandler);
- SetFlags(usage.c_str(), &argc, &argv, true);
+ SET_FLAGS(usage.c_str(), &argc, &argv, true);
if (argc > 3) {
ShowUsage();
return 1;
@@ -56,7 +56,7 @@ int main(int argc, char **argv) {
s::FstClass *fst = s::FstClass::Read(in_name);
if (!fst) return 1;
- ostream *ostrm = &std::cout;
+ ostream *ostrm = &cout;
string dest = "standard output";
if (argc == 3) {
dest = argv[2];
@@ -70,13 +70,16 @@ int main(int argc, char **argv) {
const SymbolTable *isyms = 0, *osyms = 0, *ssyms = 0;
+ fst::SymbolTableTextOptions opts;
+ opts.allow_negative = FLAGS_allow_negative_labels;
+
if (!FLAGS_isymbols.empty() && !FLAGS_numeric) {
- isyms = SymbolTable::ReadText(FLAGS_isymbols, FLAGS_allow_negative_labels);
+ isyms = SymbolTable::ReadText(FLAGS_isymbols, opts);
if (!isyms) exit(1);
}
if (!FLAGS_osymbols.empty() && !FLAGS_numeric) {
- osyms = SymbolTable::ReadText(FLAGS_osymbols, FLAGS_allow_negative_labels);
+ osyms = SymbolTable::ReadText(FLAGS_osymbols, opts);
if (!osyms) exit(1);
}
@@ -99,7 +102,7 @@ int main(int argc, char **argv) {
if (osyms && !FLAGS_save_osymbols.empty())
osyms->WriteText(FLAGS_save_osymbols);
- if (ostrm != &std::cout)
+ if (ostrm != &cout)
delete ostrm;
return 0;
}