diff --git a/bin/cc-cli b/bin/cc-cli index 1a2eed7df3d83624466548104746bc8a9f2f418d..60f2b8d1c5359b7ba0bd74729717709ab3352fa0 100755 --- a/bin/cc-cli +++ b/bin/cc-cli @@ -44,7 +44,7 @@ try: help="Debug mode") oparser.add_option("-D", "--no-debug", action="store_false",dest="debug", help="Unset debug mode") - oparser.add_option("-l", "--login",action="store",dest="login", + oparser.add_option("-L", "--login",action="store",dest="login", help="Server login") oparser.add_option("-H", "--hostname",action="store",dest="server", help="Server hostname") @@ -54,6 +54,8 @@ try: help="Connection timeout") oparser.add_option("-p", "--profile",action="store",dest="profile", help="Profile name") + oparser.add_option("-l", "--list-profile", action="store_true",dest="proflist", + help="List available profile") oparser.add_option("--history-file",action="store",dest="history", help="History file") oparser.add_option("--history-size",action="store",dest="hsize", @@ -66,6 +68,12 @@ try: propath = "%s/profile"%BaseDirectory.save_config_path(cccli.canonical_name) fparser = ConfigParser.RawConfigParser() fparser.read(propath) + # profile listing + if options.proflist: + l = list(fparser.sections()) + l.remove("cli") + printer.out(os.linesep.join(l)) + sys.exit(0) # load default profile if fparser.has_section("cli"): settings.update(fparser.items("cli"))