def execute_ls_command(db, objs, tags, options, credentials, unixPaths=None):
    long_ = options.long or options.group or options.longest
    if len(tags) == 0:
        tags = [(u'/' if db.unixStyle else u'') + db.credentials.username]
    for tag in tags:
        fulltag = db.abs_tag_path(tag, inPref=True)
        if options.namespace or options.ns:
            if db.ns_exists(fulltag):
                if long_ or options.longer or options.longest:
                    nsResult = db.full_perms(fulltag[1:] + u'/',
                                             options.longer, options.group,
                                             options.longest)
                else:
                    nsResult = fulltag
                db.Print(nsResult)
            else:
                nsResult = u'Error status 404'
        else:
            nsResult = db.list_sorted_ns(fulltag[1:], long_=long_,
                                         recurse=options.recurse, prnt=True,
                                         longer=options.longer,
                                         longest=options.longest)
        tagExists = db.tag_exists(fulltag)
        if nsResult == 'Error status 404':
            if not tagExists:
                db.Print(u'%s not found' % fulltag)
        if tagExists:
            if long_ or options.longer or options.longest:
                db.Print(db.full_perms(fulltag[1:], options.longer,
                         options.group, options.longest))
            else:
                db.Print(tag)
dataset/ETHPy150Open njr0/fish/fish/ls.py/execute_ls_command/original