diff --git a/atrim/src/atrim.cpp b/atrim/src/atrim.cpp index a40a5fd985635c4df188cbf0f4d039b4ea06c327..ec39783844eee6397406fae4fb3332a0d5673dd4 100644 --- a/atrim/src/atrim.cpp +++ b/atrim/src/atrim.cpp @@ -27,8 +27,8 @@ void help( void ) cout << "Usage: atrim [-d] [-r]" << endl << endl; cout << "If neither --dead nor --unreachable option is used, both dead and unreachable states are removed." << endl; cout << endl; - cout << " --dead \t Removes dead states only (works with FSM only)." << endl; - cout << " --unreachable \t Removes unreachable states only. (works with FSM or CFG)." << endl; + cout << " -d, --dead \t Removes dead states only (works with FSM only)." << endl; + cout << " -u, --unreachable \t Removes unreachable states only. (works with FSM or CFG)." << endl; cout << " -h, --help \t shows this." << endl; cout << endl; @@ -41,20 +41,20 @@ int main(int argc, char* argv[]) static struct option long_options[] = { {"help", no_argument, NULL, 'h'}, {"dead", no_argument, NULL, 'd'}, - {"unreachable", no_argument, NULL, 'r'}, + {"unreachable", no_argument, NULL, 'u'}, {0, 0, 0, 0} }; int long_index = 0, opt = 0; - while( ( opt = getopt_long( argc, argv, "h", long_options, & long_index ) ) != -1 ) + while( ( opt = getopt_long( argc, argv, "hdu", long_options, & long_index ) ) != -1 ) { switch( opt ) { case 'd': del_dead_only = true; break; - case 'r': + case 'u': del_unreachable_only = true; break; @@ -83,7 +83,7 @@ int main(int argc, char* argv[]) FSM fsm = AutomatonFactory::buildFSM( AutomatonParser::parse(tokens) ); if( ! del_dead_only && ! del_unreachable_only ) - del_dead_only = del_unreachable_only = 1; + del_dead_only = del_unreachable_only = true; if( del_unreachable_only ) fsm = TrimFSM::removeUnreachableStates( fsm );