Coder Social home page Coder Social logo

commandeer's People

Contributors

def- avatar fenekku avatar pandanautinspace avatar shaunc avatar singularperturbation avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

commandeer's Issues

Can't have the same options specified for multiple subcommands

commandline:
  subcommand codecmd, "code":
    arguments name, string
    exitoption "help", "h", codeUsage

  subcommand newSecretcmd, "newSecret":
    arguments newSecretName, string
    exitoption "help", "h", newSecretUsage

  subcommand lscmd, "ls":
    exitoption "help", "h", lsUsage

  exitoption "help", "h", usageHelp
$ totptool --help                                 
Usage: totptool code <name>

This will generate a TOTP code for the given secret
name in the secret store.

Code is here. Is this intended?

Throw error if subcommand is missing

When an argument is missing, an error is thrown. So this code guarantees that the param is provided:

commandline:
  argument foo, int

But with subcommands, this is not so. This code does not guarantee that the command is specified:

commandline:
  subcommand sub, "sub":
    argument foo, int

proposal: seq types for repeated options

I have been using comandeer happily, but now need to collect multiple values of an argument. To support this, if an option is specified as:

option name, seq[type], long, short [, default]

Perhaps that could trigger the ability to receive multiple values of type?

Can't pass in an empty string to an option

commandline:
    option variableA, string, "var", "v", "default"
# none of the following work
executable --var:
# out: Missing value for option 'var'
executable --var=
# out: Missing value for option 'var'
executable --var ""
# out: Couldn't convert '' to string

There should only be an error if the user hasn't explicitly given a blank value, like the following

executable --var
# out: Missing value for option 'var'

Allow to specify option values without ":" or "="

Consider the following code:

commandline:
  argument path, string
  option target, char, "target", "t"

Calling myapp -t t path doesn't throw an error but doesn't do the expected thing, because path is t and target is empty. The correct call is myapp -t:t path or myapp -t=t path.

It should either throw an error or set target to t in the first case.

Aliases for subcommands

I would be great to be able to define a subcommand like so:

commandline:
  subcommand build, ["build", "make"]:
    option projectPath, string, "path", "p", "."
    option targetFormat, string, "target", "t"
    exitoption "help", "h", buildUsage

I.e. provide multiple names pointing to the same subcommand.

update from 0.9.1 to 0.10.2 fails

I am using nim 0.13.0. Updating from 0.9.1 to 0.10.2 fails with:

/Volumes/Macintosh_HD/Users/shauncutts/.nimble/pkgs/commandeer-0.10.2/commandeer.nim(246, 7) Error: expression 'strtabs' has no type (or is ambiguous)

Calling context:

  var appName = getAppFilename()
  {.push warning[Deprecated]:off.}
  commandline:
    arguments paths, string, false
    option verbosity, int, "verbosity", "v", 0
    option bail, bool, "bail", "b", false
    option tags, string, "tags", "t", nil
    option defineTags, string, "define", "d", nil

    exitoption "help", "h", 
      "\n" & """Usage: $1 [path [path ...] ]
    where paths may denote ".feature" files or directories. Paths ending in 
    "/**" will be searched recursively for features. By default, "./features"
    directory is searched.
      """ % appName
  {.pop.}

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.