Coder Social home page Coder Social logo

simplecli's Introduction

SimpleCLI

Quick modules I wrote to make a standalone CLI app

To use:

The parser is located in the SimpleCLI module and will continually accept input. The default commands are:

help - shows every command, their descriptions, and their usage

exit -exits the bug tracker

Commands are in the form of [COMMAND] [OPTIONS] [ARGUMENT], commands can only be a single word. Options/flags can also only be one letter, but can allow groupings. The argument can be hacked to accept multiple arguments like I did for some commands for the SimpleBugTracker.

All command inherit from the base class Command with certain attributes that can be overridden: name, aliases, options, usage and run.

Name is the name of the command and what every alias will associate with.

Aliases are other names that can be used. They are bound in a key->value pair where the key is the alias and the value is the associated name.

Options are flags that can be used in conjunction with the command. The SimpleCLI parser only allows for single letter flags, but does allow groupings. -abc is only valid if a,b and c are all separate flags, it won't work if -a is a flag and -bc is another.

Usage is the litte blurb that tells you how to use a command.

Run is the function associated with that command.

The description for any given command is the docstring of the function assigned to the command.

See SimpleBugTracker for a quick and dirty demo on how to use this.

simplecli's People

Contributors

normanzhao avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.