xpath = args[0];
for(int i = 0; i < args.length; i++) { xpath += args[i] + " "; }
	public void execute(Environment env, String commandLine) {		if( env instanceof Shell) {			Shell shell = (Shell)env;						if( commandLine == null || commandLine.length() == 0 ) {				commandLine = "input()";			}						String[] tokens = commandLine.split("\\s+");			CommandLineParser parser = new PosixParser();			CommandLine cmd = null;			try {				cmd = parser.parse(options, tokens);			} catch (ParseException e) {				env.printError(e);				return;			}						String xpath = null;						String[] args = cmd.getArgs();			if(args != null && args.length > 0) {				xpath = args[0];			} else {				xpath = "input()";			}					StringBuffer xquery = new StringBuffer();			if(cmd.hasOption("l")) {				xquery.append("let $roles := xdmp:eval-in('<roles>{ ");				xquery.append("for $i in //sec:role ");				xquery.append("return <role id=\"{ data($i/sec:role-id) }\" name=\"{ ");				xquery.append("data($i/sec:role-name) }\">{ data($i/sec:description) }</role> ");				xquery.append("}</roles>', xdmp:database(\"Security\")) ");				xquery.append("let $max := max(for $i in input() return string-length(base-uri($i))) ");				xquery.append("for $i in " + xpath + " ");				xquery.append("let $name := string(base-uri($i)) ");				xquery.append("order by $name ");				xquery.append("return concat($name, string-join(for $z in (1 to $max - ");				xquery.append("string-length($name) + 3) return \" \", \"\"), string-join( ");				xquery.append("for $perm in xdmp:document-get-permissions($name) ");				xquery.append("return ");				xquery.append("concat(substring($perm/sec:capability, 1, 1), \":\", ");				xquery.append("$roles/role[@id = $perm/sec:role-id]/@name), \",\")) ");			} else {				xquery.append("distinct-values(for $i in " + xpath + " let $name := string(base-uri($i)) order by $name return $name)");			}						try {				int scroll = Shell.DEFAULT_SCROLL;				try {    					scroll = shell.getProperties().getInt("scroll");   				} catch(ConversionException e) { }								ShellQuery squery = new ShellQuery(xquery.toString(), shell);				XQDataSource dataSource = env.getDataSource();				XQRunner runner = dataSource.newSyncRunner();				XQResult result = runner.runQuery(squery.asXQuery());				int lineCount = 0;				for( int x = 0; x < result.getSize(); x++) {					lineCount++;					XQResultItem item = result.getItem(x);					env.printLine(item.asString());					if((lineCount % scroll) == 0  && shell.checkStopScroll(lineCount)) {						break;					}				}			} catch(XQException e) {				shell.printError(e);	        }		}	}