Denomander is a solution for Deno command-line interfaces. It is inspired from commander.js by tj which is the node's version.
Installation
import Denomander from "https://raw.githubusercontent.com/siokas/denomander/master/mod.ts";
Usage example
At first initialize the app and optionally you may pass the name, description and version of the app. If not you can change them afterwards by setting the app_name, app_description and app_version variables.
let program = new Denomander(
{
app_name: "My MY App",
app_description: "My MY Description",
app_version: "1.0.1"
}
);
There are three option types: commands, options and required options. To set an option just call the corresponding method passing a) the sort and the long flag seperated by space and b) the description
program
.command("new [name]", "Generate a new file")
.option("-a --address", "Define the address")
.option("-p --port", "Define the port")
.requiredOption("-s --server", "Server Name")
.parse(Deno.args);
if(program.address){
server.name = program.server;
}
if(program.port){
s = serve({ port: program.port });
}
if(program.new){
console.log("Creating the file " + program.new);
}
ToDo
- program.on() method
- Custom option processing
- Option to change default commands (help, version)
- description(), action() methods
Used
- Deno
- Deno STD Libraries
- FlatIcon for the logo
Release History
- 0.1.0
- Initial Commit
Meta
Apostolos Siokas – @siokas_ – apostolossiokas@gmail.com
Contributing
- Fork it (https://github.com/yourname/yourproject/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
License
Distributed under the MIT License.