add arg for listing with a folder name
This commit is contained in:
14
flit.py
14
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()
|
||||
|
||||
@@ -394,7 +403,10 @@ 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 """
|
||||
|
||||
Reference in New Issue
Block a user