Skip to content

Commit 1690265

Browse files
committed
fix for #56
also added -o option to folialint as an alternative for --output
1 parent 9eb0e30 commit 1690265

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/folialint.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void usage(){
4141
cerr << "\t-V, --version\t\t Show versions" << endl;
4242
cerr << "\t--strip\t\t\t strip variable items from the FoLiA. Like all dates." << endl;
4343
cerr << "\t\t\t\t This is usefull to generate FoLiA that can be diffed." << endl;
44-
cerr << "\t--output='file'\t\t name an outputfile. (default is stdout)" << endl;
44+
cerr << "\t-o or --output='file'\t\t name an outputfile. (default is stdout)" << endl;
4545
cerr << "\t--nooutput\t\t Suppress output. Only warnings/errors are displayed." << endl;
4646
cerr << "\t--nochecktext\t\t DO NOT check if text is consistent inside structure tags." << endl;
4747
cerr << "\t\t\t\t Default is to do so." << endl;
@@ -74,7 +74,7 @@ int main( int argc, const char* argv[] ){
7474
vector<string> fileNames;
7575
string command;
7676
try {
77-
TiCC::CL_Options Opts( "hVd:ax",
77+
TiCC::CL_Options Opts( "hVd:axo:",
7878
"nochecktext,debug:,permissive,strip,output:,"
7979
"nooutput,help,fixtext,warn,version,canonical,"
8080
"KANON,explicit,autodeclare");
@@ -112,7 +112,7 @@ int main( int argc, const char* argv[] ){
112112
return EXIT_FAILURE;
113113
}
114114
Opts.extract( "debug", debug ) || Opts.extract( 'd', debug );
115-
Opts.extract( "output", outputName );
115+
Opts.extract( "output", outputName ) || Opts.extract( 'o', outputName );
116116
autodeclare = Opts.extract( "autodeclare" ) || Opts.extract( 'a' );
117117

118118
if ( !Opts.empty() ){
@@ -178,7 +178,6 @@ int main( int argc, const char* argv[] ){
178178
cmd += mode;
179179
// cerr << "running " << cmd << endl;
180180
folia::Document d( cmd );
181-
d.set_canonical(kanon);
182181
if ( !d.version_below(2,0)
183182
&& !(kanon||strip)
184183
&& d.get_processors_by_name( "folialint" ).empty() ){
@@ -193,9 +192,10 @@ int main( int argc, const char* argv[] ){
193192
proc->set_metadata( "valid", "yes" );
194193
}
195194
if ( !outputName.empty() ){
196-
d.save( outputName );
195+
d.save( outputName, kanon );
197196
}
198197
else if ( !nooutput ){
198+
d.set_canonical(kanon);
199199
cout << d;
200200
}
201201
else {

0 commit comments

Comments
 (0)