examples/console-client/index.js
function list(context, err, items, paths) {
    if (err) return fail(context, err);
    
    var long = context.options["l"];
    
    if (typeof long === "undefined") long = (context.command.slice(-3) === "dir");
    
    items.forEach(function (item) {
        if (item.filename == "." || item.filename == "..") return;
        
        if (paths) {
            shell.write(item.path);
        } else if (long) {
            shell.write(item.longname);
        } else {
            shell.write(item.filename);
        }
    });
    
    context.end();
}
function list(context, err, items, paths) {
    if (err) return fail(context, err);
    
    var long = context.options["l"];
    
    if (typeof long === "undefined") long = (context.command.slice(-3) === "dir");
    
    items.forEach(function (item) {
        if (item.filename == "." || item.filename == "..") return;
        
        if (paths) {
            shell.write(item.path);
        } else if (long) {
            shell.write(item.longname);
        } else {
            shell.write(item.filename);
        }
    });
    
    context.end();
}
function list ( context , err , items , paths ) { if ( err ) return fail ( context , err ) ; var long = context . options [ "l" ] ; if ( typeof long === "undefined" ) long = ( context . command . slice ( - 3 ) === "dir" ) ; items . forEach ( function ( item ) { if ( item . filename == "." || item . filename == ".." ) return ; if ( paths ) { shell . write ( item . path ) ; } else if ( long ) { shell . write ( item . longname ) ; } else { shell . write ( item . filename ) ; } } ) ; context . end ( ) ; }
display a list of items
display a list of items