@sathyamoorthi No need to execute another command.  I would implement it like this:

function _doCloseDocumentList(list, promptOnly) {
      // code to do the closing...
}

function handleFileCloseDocumentList(commandData) {
       _doCloseDocumentList (commandData.documentList, commandData.promptOnly);
}

function handleFileCloseAll(commandData) {
       _doCloseDocumentList (DocumentManager.getWorkingSet, commandData.promptOnly);
}