cntOutput ++;
}
}
int i;
for( i=0;i<cntOutput;i++ )
dostat( Output[ i ].FileName );
closedir( dir_ptr );
}
/**********************************************************
ls -l
***********************************************************/
else {
display_Ls_tmp( cntOutput );
closedir( dir_ptr );
}
/**********************************************************
ls /tmp
***********************************************************/
}
return ;
}/*sovle*/
int main( int argc, char *argv[] ){
getWidth( );
int i ;
if( argc==1 ){
do_ls( LS,"ls" );
}
else{
int ord;
while( (ord = getopt(argc,argv,":lat"))!=-1 ){
switch( ord ){
case 'a':
do_ls( LS_A,"ls-a" );
break;
case 'l':{
if(argc == 2) do_ls( LS_L,"/" );
else {
for( i= 2;i<argc;i++ ){
if( argv[ i ][ 0 ]=='-' ) continue;
printf("%s:\n",argv[ i ]);
do_ls( LS_L,argv[ i ] );
}
}
return;
}
break;
case 't':
do_ls( LS_T,"ls-t" );
break;
default :
break;
}
}
for( i=1;i<argc;i++ ){
if( argv[ i ][ 0 ]=='-' ) continue;
printf("%s:\n",argv[ i ]);
do_ls( LS_TMP,argv[ i ] );
}
}
return 0;
}
/*main*/