usage: program [ -i ] src dest
- main(int ac, char *av[])
- {
-
- char *src = NULL, *dest = NULL;
- int i_option = 0;
- /* check args */
- while( --ac ){
- if ( strcmp("-i", *++av) == 0 )
- i_option = 1;
- else if ( !src )
- src = *av;
- else if ( !dest )
- dest = *av;
- else
- usage();
- }
- if ( !src || !dest )
- usage();
- }
阅读(1033) | 评论(0) | 转发(1) |