On 10/03/2012 05:02 PM, Ilya Dryomov wrote:
+static int cmd_disk_free(int argc, char **argv)
>  +{
>  +
>  + int     flags=DF_SHOW_SUMMARY|DF_SHOW_DETAIL|DF_HUMAN_UNIT;
>  + int     i, more_than_one=0;
>  +
>  + if (check_argc_min(argc, 2))
>  +         usage(cmd_disk_free_usage);
>  +
>  + for(i=1; i<  argc ; i++){
>  +         if(!strcmp(argv[i],"-d"))
>  +                 flags&= ~DF_SHOW_DETAIL;
>  +         else if(!strcmp(argv[i],"-s"))
>  +                 flags&= ~DF_SHOW_SUMMARY;
>  +         else if(!strcmp(argv[i],"-k"))
>  +                 flags&= ~DF_HUMAN_UNIT;
>  +         else{
>  +                 int r;
>  +                 if(more_than_one)
>  +                         printf("\n");
>  +                 r = _cmd_disk_free(argv[i], flags);
>  +                 if( r ) return r;
>  +                 more_than_one=1;
>  +         }
Is there any reason getopt(), or better yet, getopt_long() won't work?

I re-changed idea: I will use getopt()




--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to