Skip to content

Commit

Permalink
Added padding
Browse files Browse the repository at this point in the history
  • Loading branch information
hemanth-hk committed Apr 7, 2020
1 parent 8d0c51d commit 94db7e5
Showing 1 changed file with 23 additions and 81 deletions.
104 changes: 23 additions & 81 deletions commands/help.js
Original file line number Diff line number Diff line change
@@ -1,124 +1,66 @@
var commands = {
"init": {
def : "Initialises synix with the specified text-editor",
args : "<name of the text-editor>",
optionalArgs : "none",
usage : "sx init code #for vscode"
def: "Initialises synix with the specified text-editor"
},
'version': {
def : "Prints the version of synix",
args : "none",
optionalArgs : "none",
usage : "sx v #or sx version"
def: "Prints the version of synix"
},
'ls': {
def : "Lists the files and folders in your cwd",
args : "none",
optionalArgs : "none",
usage : "sx ls"
def: "Lists the files and folders in your cwd"
},
'pwd': {
def : "Gives the path of the cwd",
args : "nope",
optionalArgs : "none",
usage : "sx pwd"
def: "Gives the path of the cwd"
},
'open': {
def : "Opens the specified folder as a project in your preferred editor",
args : "<folder-name>",
optionalArgs : "none",
usage : "sx open <folder-name>"
def: "Opens the specified folder as a project in your preferred editor"
},
'mkdir': {
def : "Creates the specified folder in your cwd",
args : "<folder-name>",
optionalArgs : "none",
usage : "sx mkdir <folder-name> #creates folder in cwd"
def: "Creates the specified folder in your cwd"
},
'cat': {
def : "Prints the contents of the file to the terminal/cmd",
args : "<file-name>",
optionalArgs : "none",
usage : "sx mkdir <file-name>"
def: "Prints the contents of the file to the terminal/cmd"
},
'rm': {
def : "Removes the specified file/folder from your cwd",
args : "<file-name> or <folder-name>",
optionalArgs : "none",
usage : "sx mkdir <file-name>/<folder-name>"
def: "Removes the specified file/folder from your cwd"
},
'mkpro': {
def : "Creates the folder and opens it as a peoject in your text-editor",
args : "<folder-name>",
optionalArgs : "none",
usage : "sx mkpro <folder-name>"
def: "Creates the folder and opens it as a peoject in your text-editor"
},
'mv': {
def : "Moves the file contents into another",
args : "<from-file-name> and <to-file-name>",
optionalArgs : "none",
usage : "sx mv <from-file-name> <to-file-name>"
def: "Moves the file contents into another"
},
'cp': {
def : "Copies the file contents into another",
args : "<from-file-name> and <to-file-name>",
optionalArgs : "none",
usage : "sx cp <from-file-name> <to-file-name>"
def: "Copies the file contents into another"
},
'touch': {
def : "Creates the specified file in your cwd",
args : "<file-name>",
optionalArgs : "none",
usage : "sx touch <file-name>"
def: "Creates the specified file in your cwd"
},
'clone': {
def : "Clones a git repository and sets it's upstream",
args : "<forked-repository-url> and <upstream-repository-url>",
optionalArgs : "<name-of-the-upstream-variable>",
usage : "sx clone <forked-repository-url> <upstream-repository-url>"
def: "Clones a git repository and sets it's upstream"
},
'sync': {
def : "Syncs the local, origin and the upstream repositories",
args : "none",
optionalArgs : "<upstream-branch-name> and <origin-branch-name>",
usage : "sx sync"
def: "Syncs the local, origin and the upstream repositories"
},
'edit': {
def : "Opens the base configuration file in edit mode",
args : "none",
optionalArgs : "none",
usage : "sx edit"
def: "Opens the base configuration file in edit mode"
},
'des': {
def : "Opens desktop in file-manager",
args : "none",
optionalArgs : "none",
usage : "sx des"
def: "Opens desktop in file-manager"
},
'dow': {
def : "Opens downloads in file-manager",
args : "none",
optionalArgs : "none",
usage : "sx dow"
def: "Opens downloads in file-manager"
},
'doc': {
def : "Opens documents in file-manager",
args : "none",
optionalArgs : "none",
usage : "sx doc"
def: "Opens documents in file-manager"
}
};

function help(){
for(var key in commands){
console.log(`Command : ${key}`)
console.log(`Def : ${commands[key].def}`)
console.log(`*Args : ${commands[key].args}`)
console.log(`*Optional Args : ${commands[key].optionalArgs}`)
console.log(`Usage : ${commands[key].usage}`)
console.log('---\n')
function help() {
for (var key in commands) {
const padding = " ".repeat((10 - key.length))
console.log(`${key}${padding}:${commands[key].def}`)
}
console.log('A detailed explation is available in the docs : https://synix-docs.netlify.com/ccc/commands.html')
console.log('A detailed explation is available in the docs :https://synix-docs.netlify.com/ccc/commands.html\n')
}

module.exports = help;

0 comments on commit 94db7e5

Please sign in to comment.