diff --git a/flit.py b/flit.py index e018858..d18af4c 100755 --- a/flit.py +++ b/flit.py @@ -117,6 +117,15 @@ def parse_opts(): default=False, help="Print individual files too", ) + list_parser.add_argument( + "name", + action="store", + type=str, + help="List only named share", + default=None, + nargs="?" + ) + del_parser = subparsers.add_parser("del", add_help=False) return parser.parse_args() @@ -393,8 +402,11 @@ if __name__ == "__main__": if opts.command == "list" or opts.command is None: """ List shares """ - - list_folders(opts.root, verbose=opts.verbose) + + if opts.name: + if os.path.isdir(os.path.join(cwd, opts.name)): + opts.name = os.path.basename(os.path.realpath(os.path.join(cwd, opts.name))) + list_folders(opts.root, verbose=opts.verbose, filter_name=opts.name) if opts.command == "del": """ Delete due shares """