66from code_counter import __version__
77
88
9- def config_args_type (args ):
9+ def split_args (args ):
1010 return list (args .split (',' ))
1111
1212
@@ -32,19 +32,19 @@ def __init__(self):
3232 def search (self ):
3333 parser = argparse .ArgumentParser (
3434 description = "Search code in the given path(s)" )
35- parser .add_argument ('path' ,
35+ parser .add_argument ('input_path' , type = split_args ,
3636 help = "specify a file or directory path you want to count or use CONFIG placeholder to configure" )
3737 parser .add_argument ('-v' , '--verbose' , dest = "verbose" , action = 'store_true' ,
3838 help = "show verbose infomation" )
3939 parser .add_argument ('-g' , '--graph' , dest = 'graph' , action = 'store_true' ,
4040 help = "choose to whether to visualize the result" )
4141 parser .add_argument ('-o' , '--output' , dest = 'output_path' ,
4242 help = "specify a output path if you want to store the result" )
43- parser .add_argument ('--suffix' , dest = 'suffix' , type = config_args_type ,
43+ parser .add_argument ('--suffix' , dest = 'suffix' , type = split_args ,
4444 help = "what code files do you want to count, this parameter is disposable" )
45- parser .add_argument ('--comment' , dest = 'comment' , type = config_args_type ,
45+ parser .add_argument ('--comment' , dest = 'comment' , type = split_args ,
4646 help = "the comment symbol, which can be judged whether the current line is a comment, this parameter is disposable" )
47- parser .add_argument ('--ignore' , dest = 'ignore' , type = config_args_type ,
47+ parser .add_argument ('--ignore' , dest = 'ignore' , type = split_args ,
4848 help = "ignore some directories or files that you don't want to count, this parameter is disposable" )
4949 return parser .parse_args (sys .argv [2 :])
5050
@@ -53,19 +53,19 @@ def config(self):
5353 description = "A command-line interface (CLI) utility that can help you easily count code and display detailed results." )
5454 parser .add_argument ('--list' , dest = 'show_list' , action = 'store_true' ,
5555 help = "list all variables set in config file, along with their values" )
56- parser .add_argument ('--suffix-reset' , dest = 'suffix_reset' , type = config_args_type ,
56+ parser .add_argument ('--suffix-reset' , dest = 'suffix_reset' , type = split_args ,
5757 help = "override 'suffix' in config and count codes according to this value" )
58- parser .add_argument ('--suffix-add' , dest = 'suffix_add' , type = config_args_type ,
58+ parser .add_argument ('--suffix-add' , dest = 'suffix_add' , type = split_args ,
5959 help = "append new value for 'suffix' in config and count codes according to this value" )
6060
61- parser .add_argument ('--comment-reset' , dest = 'comment_reset' , type = config_args_type ,
61+ parser .add_argument ('--comment-reset' , dest = 'comment_reset' , type = split_args ,
6262 help = "override 'comment' in config and count comment lines according to this value" )
63- parser .add_argument ('--comment-add' , dest = 'comment_add' , type = config_args_type ,
63+ parser .add_argument ('--comment-add' , dest = 'comment_add' , type = split_args ,
6464 help = "append new value for 'comment' in config and count comment lines according to this value" )
6565
66- parser .add_argument ('--ignore-reset' , dest = 'ignore_reset' , type = config_args_type ,
66+ parser .add_argument ('--ignore-reset' , dest = 'ignore_reset' , type = split_args ,
6767 help = "override 'ignore' in config and ignore some files or directory according to this value" )
68- parser .add_argument ('--ignore-add' , dest = 'ignore_add' , type = config_args_type ,
68+ parser .add_argument ('--ignore-add' , dest = 'ignore_add' , type = split_args ,
6969 help = "append new value for 'ignore' in config and ignore some files or directory according to this value" )
7070
7171 parser .add_argument ('--restore' , dest = 'restore' , action = 'store_true' ,
0 commit comments