Skip to content
Snippets Groups Projects
Commit e3517048 authored by Sebastien Luttringer's avatar Sebastien Luttringer
Browse files

new display and option for command repo

repo have now -s and -u option
new display and color
parent 42958993
No related branches found
No related tags found
No related merge requests found
......@@ -304,7 +304,7 @@ def c_repo(parser, args):
repoman = load_repositories(args)
for pattern in args.repository:
repoman.show_repos(pattern, online=args.online, local=args.local,
url=args.verbose, state=not args.no_state)
url=args.url, state=args.state)
def c_search(parser, args):
'''
......@@ -566,10 +566,10 @@ p_repo_mgroup.add_argument("-o", "--online", action="store_true", default=None,
help="list online repository (filter)")
p_repo_mgroup.add_argument("-O", "--offline", action="store_false", dest="online",
help="list offline repository (filter)")
p_repo.add_argument("-S", "--no-state", action="store_true", default=False,
help="doesn't display repository state (online/offline)")
p_repo.add_argument("-v", "--verbose", action="store_true", default=False,
help="verbose output")
p_repo.add_argument("-s", "--state", action="store_true", default=False,
help="display repository state (online/offline/local/remote)")
p_repo.add_argument("-u", "--url", action="store_true", default=False,
help="display repository url")
p_repo.add_argument("repository", nargs='*', default=["*"], help="repository pattern")
p_repo.set_defaults(func=c_repo)
......
......@@ -139,7 +139,7 @@ _is() {
_filedir -d
;;
repo)
[[ "$cur" == -* ]] && _opt '-h --help -v --verbose -l --local -r --remote -o --online -O --offline -S --no-state --force-offline' && return 0
[[ "$cur" == -* ]] && _opt '-h --help -l --local -r --remote -o --online -O --offline -s --state --force-offline -u --url' && return 0
_repo
;;
search)
......
......@@ -643,11 +643,16 @@ class RepositoryManager(object):
continue
if not repo.local and local is True:
continue
s = "#light##blue#%s#reset#"% repo.config.name
so = "#l##r#Off#R# " if repo.config.offline else "#l##g#On#R# "
sl = "#l##y#Local#R# " if repo.local else "#l##c#Remote#R# "
rc = "#l##r#" if repo.config.offline else "#l##g#"
s = ""
if state:
s += "%s%s " % (so, sl)
rc = "#l##b#"
s += "%s%s#R#"% (rc, repo.config.name)
if url:
s += " (%s)" % repo.config.path
if state and repo.config.offline:
s += " #light##red#[offline]#reset#"
s += " (%s)" % repo.config.path
out(s)
def show_images(self, pattern, o_json=False, o_long=False,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment